Skip to content

Commit c612ef8

Browse files
committed
treat mir::ConstantKind::Val correctly in check_static_ptr
1 parent 5e0fab6 commit c612ef8

File tree

2 files changed

+4
-37
lines changed

2 files changed

+4
-37
lines changed

Cargo.lock

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ dependencies = [
369369
"tar",
370370
"tempfile",
371371
"termcolor",
372-
"toml_edit",
372+
"toml",
373373
"unicode-width",
374374
"unicode-xid",
375375
"url 2.2.2",
@@ -455,7 +455,7 @@ dependencies = [
455455
"serde_json",
456456
"tar",
457457
"termcolor",
458-
"toml_edit",
458+
"toml",
459459
"url 2.2.2",
460460
]
461461

@@ -710,16 +710,6 @@ dependencies = [
710710
"winapi",
711711
]
712712

713-
[[package]]
714-
name = "combine"
715-
version = "4.6.3"
716-
source = "registry+https://github.com/rust-lang/crates.io-index"
717-
checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062"
718-
dependencies = [
719-
"bytes",
720-
"memchr",
721-
]
722-
723713
[[package]]
724714
name = "commoncrypto"
725715
version = "0.2.0"
@@ -1949,15 +1939,6 @@ dependencies = [
19491939
"unicase",
19501940
]
19511941

1952-
[[package]]
1953-
name = "kstring"
1954-
version = "1.0.6"
1955-
source = "registry+https://github.com/rust-lang/crates.io-index"
1956-
checksum = "8b310ccceade8121d7d77fee406160e457c2f4e7c7982d589da3499bc7ea4526"
1957-
dependencies = [
1958-
"serde",
1959-
]
1960-
19611942
[[package]]
19621943
name = "lazy_static"
19631944
version = "1.4.0"
@@ -3165,14 +3146,13 @@ dependencies = [
31653146
"tokio-stream",
31663147
"tokio-util",
31673148
"toml",
3168-
"toml_edit",
31693149
"url 2.2.2",
31703150
"walkdir",
31713151
]
31723152

31733153
[[package]]
31743154
name = "rls-analysis"
3175-
version = "0.18.3"
3155+
version = "0.18.2"
31763156
dependencies = [
31773157
"derive-new",
31783158
"env_logger 0.9.0",
@@ -5171,19 +5151,6 @@ dependencies = [
51715151
"serde",
51725152
]
51735153

5174-
[[package]]
5175-
name = "toml_edit"
5176-
version = "0.13.4"
5177-
source = "registry+https://github.com/rust-lang/crates.io-index"
5178-
checksum = "744e9ed5b352340aa47ce033716991b5589e23781acb97cad37d4ea70560f55b"
5179-
dependencies = [
5180-
"combine",
5181-
"indexmap",
5182-
"itertools 0.10.1",
5183-
"kstring",
5184-
"serde",
5185-
]
5186-
51875154
[[package]]
51885155
name = "topological-sort"
51895156
version = "0.1.0"

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ pub enum ConstantKind<'tcx> {
25222522

25232523
impl<'tcx> Constant<'tcx> {
25242524
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
2525-
match self.literal.const_for_ty()?.val().try_to_scalar() {
2525+
match self.literal.try_to_scalar() {
25262526
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
25272527
GlobalAlloc::Static(def_id) => {
25282528
assert!(!tcx.is_thread_local_static(def_id));

0 commit comments

Comments
 (0)