rust/tests/ui/let-else/issue-94176.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
280 B
Rust
Raw Normal View History

2022-07-15 16:53:23 +00:00
// Issue #94176: wrong span for the error message of a mismatched type error,
// if the function uses a `let else` construct.
2022-07-15 16:53:23 +00:00
pub fn test(a: Option<u32>) -> Option<u32> { //~ ERROR mismatched types
let Some(_) = a else { return None; };
println!("Foo");
}
fn main() {}