mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 03:03:21 +00:00
treat mir::ConstantKind::Val correctly in check_static_ptr
This commit is contained in:
parent
5e0fab6da5
commit
c612ef8f48
39
Cargo.lock
39
Cargo.lock
@ -369,7 +369,7 @@ dependencies = [
|
||||
"tar",
|
||||
"tempfile",
|
||||
"termcolor",
|
||||
"toml_edit",
|
||||
"toml",
|
||||
"unicode-width",
|
||||
"unicode-xid",
|
||||
"url 2.2.2",
|
||||
@ -455,7 +455,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tar",
|
||||
"termcolor",
|
||||
"toml_edit",
|
||||
"toml",
|
||||
"url 2.2.2",
|
||||
]
|
||||
|
||||
@ -710,16 +710,6 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "4.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "commoncrypto"
|
||||
version = "0.2.0"
|
||||
@ -1949,15 +1939,6 @@ dependencies = [
|
||||
"unicase",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kstring"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b310ccceade8121d7d77fee406160e457c2f4e7c7982d589da3499bc7ea4526"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.4.0"
|
||||
@ -3165,14 +3146,13 @@ dependencies = [
|
||||
"tokio-stream",
|
||||
"tokio-util",
|
||||
"toml",
|
||||
"toml_edit",
|
||||
"url 2.2.2",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rls-analysis"
|
||||
version = "0.18.3"
|
||||
version = "0.18.2"
|
||||
dependencies = [
|
||||
"derive-new",
|
||||
"env_logger 0.9.0",
|
||||
@ -5171,19 +5151,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.13.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "744e9ed5b352340aa47ce033716991b5589e23781acb97cad37d4ea70560f55b"
|
||||
dependencies = [
|
||||
"combine",
|
||||
"indexmap",
|
||||
"itertools 0.10.1",
|
||||
"kstring",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "topological-sort"
|
||||
version = "0.1.0"
|
||||
|
@ -2522,7 +2522,7 @@ pub enum ConstantKind<'tcx> {
|
||||
|
||||
impl<'tcx> Constant<'tcx> {
|
||||
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
||||
match self.literal.const_for_ty()?.val().try_to_scalar() {
|
||||
match self.literal.try_to_scalar() {
|
||||
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
|
||||
GlobalAlloc::Static(def_id) => {
|
||||
assert!(!tcx.is_thread_local_static(def_id));
|
||||
|
Loading…
Reference in New Issue
Block a user