-
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
Compiler panic playing with "Err" and lifetimes #67072
Comments
Code copied from play link to make this easier to read: #[derive(PartialEq, Debug)]
enum Res<'a, T> {
Ok(&'a str, T),
Err(String)
}
fn get_res<'a, T>(s: &'a str) -> Res<'a, T> {
Ok(s, 0)
}
macro_rules! is_err { ($e:expr) => (match $e { Err(_) => true, Ok(_, _) => false})}
fn main() {
println!("{}", is_err!(get_res()));
} Locally I can't reproduce the ICE with rustc built from HEAD with just |
minified: enum Res {
Something
}
fn main() {
if let Ok() = Res::Something {}
} Backtrace:
|
@hellow554 is this output from play.rust-lang.org or locally? How do you run rustc exactly to get this? I'm still not getting any ICEs locally, I wonder how you do it. |
Interesting, I get an ICE on another tree (I wonder what the difference is ...). The exact ICE message is different than the one in play.rust-lang, but the panic is in the same module ( |
This is a regression from 1.38.0 to 1.39.0 and was introduced in ef906d0 |
This should have been fixed by #67044. |
triage: P-high, removing nomination |
Nightly output:
Closing as fixed by that PR. |
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6c164108f5d960cd9bab160927e69986
Hitting "Run" will generate a compiler panic.
The text was updated successfully, but these errors were encountered: