-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure nested statics have a HIR node to prevent various queries from ICEing #122719
Conversation
…om other hir nodes that were fed
r? @fee1-dead rustbot has assigned @fee1-dead. Use r? to explicitly pick a reviewer |
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri The Miri subtree was changed cc @rust-lang/miri |
Does that test repo the issue? The reporter wrote
… But to get the issue to reproduce, I had to add it as a crate in test-cargo-miri -- adding it as a regular test was not sufficient.
|
oh fun. I didn't check. |
fae64e1
to
3a09680
Compare
I removed the test. The change is useful on its own. We should always have HIR available for all |
Will this also fix the codegen ICEs related to nested statics?
|
no, this PR just makes better ICEs |
@@ -3531,7 +3526,8 @@ pub enum Node<'hir> { | |||
WhereBoundPredicate(&'hir WhereBoundPredicate<'hir>), | |||
// FIXME: Merge into `Node::Infer`. | |||
ArrayLenInfer(&'hir InferArg), | |||
AssocOpaqueTy(&'hir AssocOpaqueTy), | |||
// Created by query feeding | |||
Synthetic, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can give it a field where we can encode the kind of synthetic node that we have here. Then it can be handled the same everywhere and get custom handling where desirable
We usually can get this information by asking for the DefId
and then the DefKind
, but that's not always immediately there I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. FWIW, I don't think it is necessary to add any info that distinguishes nested statics from associated types coming from RPITITs, since the def_kind
already has it, and we rarely print the HIR after the queries are fed.
r=me
@bors r=fee1-dead I'll revisit when we have an actual ICE where it isn't obvious from the query stack already |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#122435 (Don't trigger `unused_qualifications` on global paths) - rust-lang#122556 (Extend format arg help for simple tuple index access expression) - rust-lang#122634 (compiletest: Add support for `//@ aux-bin: foo.rs`) - rust-lang#122677 (Fix incorrect mutable suggestion information for binding in ref pattern.) - rust-lang#122691 (Fix ICE: `global_asm!()` Don't Panic When Unable to Evaluate Constant) - rust-lang#122695 (Change only_local to a enum type.) - rust-lang#122717 (Ensure stack before parsing dot-or-call) - rust-lang#122719 (Ensure nested statics have a HIR node to prevent various queries from ICEing) - rust-lang#122720 ([doc]:fix error code example) - rust-lang#122724 (add test for casting pointer to union with unsized tail) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122719 - oli-obk:nested_static_feed_hir, r=fee1-dead Ensure nested statics have a HIR node to prevent various queries from ICEing fixes rust-lang/miri#3389
fixes rust-lang/miri#3389