-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
dont create unnecessary DefIds under mgca
#150025
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
Conversation
|
|
| #![expect(incomplete_features)] | ||
| // library crates exercise weirder code paths around | ||
| // DefIds which were created for const args. | ||
| #![crate_type = "lib"] |
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.
annoying that I literally went out of my way to add test cases for the ICEing code to catch stuff like this but it just didn't matter because the ICE occurs during metadata encoding or sth instead of some kind of HIR validation step
42f9ae3 to
487cd4f
Compare
|
|
||
| fn visit_anon_const(&mut self, constant: &'a AnonConst) { | ||
| if let MgcaDisambiguation::Direct = constant.mgca_disambiguation | ||
| && self.resolver.tcx.features().min_generic_const_args() |
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.
Is the additional feature gate check necessary?
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.
Yep, we can't set MgcaDisambiguation differently depending on whether the feature gate is enabled or not (as the parser doesn't have access to such information). So the enum is really a "if mgca is enabled, this should/shouldnt be an anon const", without mgca enabled the enum is basically meaningless
487cd4f to
d1d807a
Compare
d1d807a to
dbfc8c2
Compare
|
@bors r+ |
…uwer Rollup of 11 pull requests Successful merges: - #147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`) - #149734 (Mirror GCC 9.5.0) - #149767 (Tidying up tests/ui/issues 33 tests [4/N]) - #149804 (chore: fix some minor issues in the comments) - #149967 (custom `VaList` layout for Hexagon) - #150025 (dont create unnecessary `DefId`s under mgca) - #150032 (Use annotate-snippet as default emitter on stable) - #150033 (Add try_as_dyn and try_as_dyn_mut) - #150042 (rustc-dev-guide subtree update) - #150063 (Remove deny of manual-let-else) - #150064 (std: io: error: Add comment for UEFI unpacked repr use) Failed merges: - #150044 (Avoid unhelpful suggestion when crate name is invalid) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #150025 - BoxyUwU:mgca_no_unused_defids, r=oli-obk dont create unnecessary `DefId`s under mgca Fixes #149977 Fixes #148838 Accidentally left this out of #149136 even though being able to do this was a large part of the point of the PR :3 First ICE was caused by the fact that we create a defid but never lower the nodeid associated with it to a hirid which later parts of the compiler can't handle. See test for second ICE r? oli-obk
…uwer Rollup of 11 pull requests Successful merges: - rust-lang/rust#147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`) - rust-lang/rust#149734 (Mirror GCC 9.5.0) - rust-lang/rust#149767 (Tidying up tests/ui/issues 33 tests [4/N]) - rust-lang/rust#149804 (chore: fix some minor issues in the comments) - rust-lang/rust#149967 (custom `VaList` layout for Hexagon) - rust-lang/rust#150025 (dont create unnecessary `DefId`s under mgca) - rust-lang/rust#150032 (Use annotate-snippet as default emitter on stable) - rust-lang/rust#150033 (Add try_as_dyn and try_as_dyn_mut) - rust-lang/rust#150042 (rustc-dev-guide subtree update) - rust-lang/rust#150063 (Remove deny of manual-let-else) - rust-lang/rust#150064 (std: io: error: Add comment for UEFI unpacked repr use) Failed merges: - rust-lang/rust#150044 (Avoid unhelpful suggestion when crate name is invalid) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #149977
Fixes #148838
Accidentally left this out of #149136 even though being able to do this was a large part of the point of the PR :3
First ICE was caused by the fact that we create a defid but never lower the nodeid associated with it to a hirid which later parts of the compiler can't handle.
See test for second ICE
r? oli-obk