Closed
Description
This code:
fn main() {
let o: Option<u32> = None;
let foo = || -> ! {
loop {}
};
o.unwrap_or_else(|| {
foo();
});
}
Will yield this warning:
main.rs:8:25: 10:6 warning: broken MIR (return = ()): bad assignment (u32 = ()): Sorts(ExpectedFound { expected: u32, found: () })
main.rs: 8 o.unwrap_or_else(|| {
main.rs: 9 foo();
main.rs:10 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlRelevant to the language team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.