diff options
Diffstat (limited to 'tests/ui/pattern/pat-type-err-let-stmt.rs')
-rw-r--r-- | tests/ui/pattern/pat-type-err-let-stmt.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/pattern/pat-type-err-let-stmt.rs b/tests/ui/pattern/pat-type-err-let-stmt.rs new file mode 100644 index 000000000..6e9850b65 --- /dev/null +++ b/tests/ui/pattern/pat-type-err-let-stmt.rs @@ -0,0 +1,16 @@ +// Test the `.span_label` to the type / scrutinee +// when there's a type error in checking a pattern. + +fn main() { + // We want to point at the `Option<u8>`. + let Ok(0): Option<u8> = 42u8; + //~^ ERROR mismatched types + //~| ERROR mismatched types + + // We want to point at the `Option<u8>`. + let Ok(0): Option<u8>; + //~^ ERROR mismatched types + + // We want to point at the scrutinee. + let Ok(0) = 42u8; //~ ERROR mismatched types +} |