-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE: MIR must not use Struct(NodeId(42))
(which refers to a local ID)
#38180
Comments
/cc @eddyb |
I think this was some change to the existing AST-based |
Ran into this myself. Here is the shortest bit of code I could find that exhibits this error: #![feature(const_fn)]
#![feature(associated_consts)]
#[derive(PartialEq, Eq)]
struct Thing {
num: u8,
}
impl Thing {
const fn new(num: u8) -> Thing {
Thing { num: num }
}
const ZERO: Thing = Thing::new(0);
}
fn main() {
let thing = Thing { num: 0 };
match Some(thing) {
Some(Thing::ZERO) => println!("Hi"),
_ => println!("Hello")
}
} The ICE seems to only occur when a matched against constant comes from a |
|
Updated backtrace:
|
This has been fixed (works now without error or ICE) |
I'm getting an ICE when trying to compile my reimplementation of C#'s
decimal
type. I've trimmed it down to the following (smallest I could make it ICE without actually writing new code).As far as I can tell this should have been an error anyways (I don't think you're able to match against stuctures like this?). Everything compiles and runs as expected if I use
a if a == DECIMAL_BITS_SIGN => -1
, which is good. But still, the original form gave me the message to report bugs, so here I am. Didn't see an existing issue, although I'll admit I'm no good at searching.Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: