]> git.lizzy.rs Git - rust.git/blob - tests/ui/pattern/pat-type-err-let-stmt.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / pattern / pat-type-err-let-stmt.rs
1 // Test the `.span_label` to the type / scrutinee
2 // when there's a type error in checking a pattern.
3
4 fn main() {
5     // We want to point at the `Option<u8>`.
6     let Ok(0): Option<u8> = 42u8;
7     //~^ ERROR mismatched types
8     //~| ERROR mismatched types
9
10     // We want to point at the `Option<u8>`.
11     let Ok(0): Option<u8>;
12     //~^ ERROR mismatched types
13
14     // We want to point at the scrutinee.
15     let Ok(0) = 42u8; //~ ERROR mismatched types
16 }