-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Contrived example:
fn foo() {
let _x = || 'outer: loop {
let inner = 'inner: loop {
let i = Default::default();
if (break 'outer i) {
loop { break 'inner 5i8; };
} else if true {
break 'inner 6;
}
break 7;
};
break inner < 8;
};
}rust-analyzer currently infers inner, i, 6, 7, and 8 to be of type i32. Correct would be inner, 6, 7: i8 and i: bool.
I briefly looked into this and decided it would be necessary to extend the HIR Expr with block labels / break/continue targets. The AST currently only offers the pseudo-lifetimes as SyntaxTokens. What would be a good type to represent the labels in the HIR?
Metadata
Metadata
Assignees
Labels
No labels