summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
new file mode 100644
index 000000000..15f08486f
--- /dev/null
+++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
@@ -0,0 +1,11 @@
+fn main() {
+ let A = 3;
+ //~^ ERROR refutable pattern in local binding
+ //~| patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
+ //~| missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
+ //~| HELP introduce a variable instead
+ //~| SUGGESTION a_var
+
+ const A: i32 = 2;
+ //~^ constant defined here
+}