-
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
Don't ICE when encountering ConstKind::Error
in RequiredConstsVisitor
#104233
Conversation
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@@ -17,7 +17,7 @@ impl<'tcx> Visitor<'tcx> for RequiredConstsVisitor<'_, 'tcx> { | |||
let literal = constant.literal; | |||
match literal { | |||
ConstantKind::Ty(c) => match c.kind() { | |||
ConstKind::Param(_) => {} | |||
ConstKind::Param(_) | ConstKind::Error(_) => {} | |||
_ => bug!("only ConstKind::Param should be encountered here, got {:#?}", c), |
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 don't remotely know how this works, but shouldn't this be changed too, since the above now allows another kind?
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.
It's just an error message, so I don't think it really needs to be changed -- Error isn't really expected here, we just silently swallow it.
@bors r+ rollup |
…earth Rollup of 9 pull requests Successful merges: - rust-lang#101939 (Add loongarch64 abi support) - rust-lang#103863 (Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor) - rust-lang#104036 (Suggest `is_some` when we've found `Option` but expected `bool`) - rust-lang#104060 (Make `Hash`, `Hasher` and `BuildHasher` `#[const_trait]` and make `Sip` const `Hasher`) - rust-lang#104077 (Use aapcs for efiapi calling convention on arm) - rust-lang#104186 (Tighten the 'introduce new binding' suggestion) - rust-lang#104194 (`EarlyBinder` docs) - rust-lang#104233 (Don't ICE when encountering `ConstKind::Error` in `RequiredConstsVisitor`) - rust-lang#104235 (Use `const_error_with_guaranteed` more) Failed merges: - rust-lang#104078 (Print "Checking/Building ..." message even when --dry-run is passed) - rust-lang#104169 (Migrate `:target` rules to use CSS variables) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #104209