summaryrefslogtreecommitdiffstats
path: root/src/test/ui/let-else/issue-94176.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/let-else/issue-94176.rs')
-rw-r--r--src/test/ui/let-else/issue-94176.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/let-else/issue-94176.rs b/src/test/ui/let-else/issue-94176.rs
new file mode 100644
index 000000000..f76dfc15b
--- /dev/null
+++ b/src/test/ui/let-else/issue-94176.rs
@@ -0,0 +1,10 @@
+// Issue #94176: wrong span for the error message of a mismatched type error,
+// if the function uses a `let else` construct.
+
+
+pub fn test(a: Option<u32>) -> Option<u32> { //~ ERROR mismatched types
+ let Some(_) = a else { return None; };
+ println!("Foo");
+}
+
+fn main() {}