-
Notifications
You must be signed in to change notification settings - Fork 13.3k
internal compiler error: librustc_mir/hair/pattern/_match.rs:959: impossible case reached #51655
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
Comments
If it may further help, the issue appeared when I wanted to replace instances of |
Please run with RUST_BACKTRACE=1 for a backtrace. |
Reduced test case: const PATH_DOT: &[u8] = &[b'.'];
fn append_to_existing_path(element: &[u8]) {
match element {
&[] => {}
PATH_DOT => {}
_ => {}
}
} |
|
I didn't have time to finish looking into it, but in case anyone else does, the issue is on: rust/src/librustc_mir/hair/pattern/_match.rs Line 936 in cca43a7
The problem is that const_val here is a ScalarPair rather than a Scalar , so converting to a pointer fails, as it needs to be scalar:rust/src/librustc/mir/interpret/value.rs Line 60 in cca43a7
|
I tried this code:
I expected to see this happen: compilation error or compilation success.
Instead, this happened: compiler crashed into an impossible case.
Meta
Backtrace:
Error messages:
The text was updated successfully, but these errors were encountered: