about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/sty.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-17 22:31:43 +0000
committerbors <bors@rust-lang.org>2025-05-17 22:31:43 +0000
commit16244bc37a6ff610daa38afcddfc1a8bb226702e (patch)
treefc391d72fe14fa128e3445b30c8f1d76b9da4447 /compiler/rustc_middle/src/ty/sty.rs
parent777d372772aa3b39ba7273fcb8208a89f2ab0afd (diff)
parente011c43bcf3bc01e04738b47b7d8dc9affda8659 (diff)
downloadrust-16244bc37a6ff610daa38afcddfc1a8bb226702e.tar.gz
rust-16244bc37a6ff610daa38afcddfc1a8bb226702e.zip
Auto merge of #140856 - oli-obk:merge-queries2, r=nnethercote
Merge mir query analysis invocations

r? `@ghost`

same thing as https://github.com/rust-lang/rust/pull/140854 just a different set of queries

Doing this in general has some bad cache coherence issues because the query caches are laid out in Vec<QueryResult> lists per query where each index refers to a DefId in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
Diffstat (limited to 'compiler/rustc_middle/src/ty/sty.rs')
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index c31ce1bc630..ab1f3d6099f 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -1260,8 +1260,7 @@ impl<'tcx> Ty<'tcx> {
                     return true;
                 };
                 alloc.expect_ty().ty_adt_def().is_some_and(|alloc_adt| {
-                    let global_alloc = tcx.require_lang_item(LangItem::GlobalAlloc, None);
-                    alloc_adt.did() == global_alloc
+                    tcx.is_lang_item(alloc_adt.did(), LangItem::GlobalAlloc)
                 })
             }
             _ => false,