-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
#![feature(catch_expr, never_type)]
struct Error {
cause: &'static str,
}
fn oops() -> Result<(), Error> {
Err(Error { cause: "epic fail" } )
}
fn main() {
let Err(Error { cause }): Result<!, Error> = do catch {
oops()?;
return; // OK
};
eprintln!("Nuclear meltdown initiated: {}", cause);
}
error: internal compiler error: broken MIR (_1 = ()): bad assignment (! = ()): Sorts(ExpectedFound { expected: !, found: () })
--> src/main.rs:11:11
|
11 | fn main() {
| ___________^
12 | | let Err(Error { cause }): Result<!, Error> = do catch {
13 | | oops()?;
14 | | return; // OK
15 | | };
16 | | eprintln!("Nuclear meltdown initiated: {}", cause);
17 | | }
| |_^
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️