about summary refs log tree commit diff
path: root/src/test/ui/pattern
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-02-23 17:24:33 +0000
committerbors <bors@rust-lang.org>2021-02-23 17:24:33 +0000
commitfe1bf8e05c39bdcc73fc09e246b7209444e389bc (patch)
tree9265dd81347434a5b0b6785222fa0b5901e43a1e /src/test/ui/pattern
parent019610754363d1d92a8d0f364d2c0909d6f53dfd (diff)
parent51511c75b558beddab7fb4b6d8277a872714b87a (diff)
downloadrust-fe1bf8e05c39bdcc73fc09e246b7209444e389bc.tar.gz
rust-fe1bf8e05c39bdcc73fc09e246b7209444e389bc.zip
Auto merge of #82443 - Dylan-DPC:rollup-yni7uio, r=Dylan-DPC
Rollup of 10 pull requests

Successful merges:

 - #81629 (Point out implicit deref coercions in borrow)
 - #82113 (Improve non_fmt_panic lint.)
 - #82258 (Implement -Z hir-stats for nested foreign items)
 - #82296 (Support `pub` on `macro_rules`)
 - #82297 (Consider auto derefs before warning about write only fields)
 - #82305 (Remove many RefCells from DocContext)
 - #82308 (Lower condition of `if` expression before it's "then" block)
 - #82311 (Jsondocck improvements)
 - #82362 (Fix mir-cfg dumps)
 - #82391 (disable atomic_max/min tests in Miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui/pattern')
-rw-r--r--src/test/ui/pattern/issue-82290.rs7
-rw-r--r--src/test/ui/pattern/issue-82290.stderr20
2 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/pattern/issue-82290.rs b/src/test/ui/pattern/issue-82290.rs
new file mode 100644
index 00000000000..67f0274fe74
--- /dev/null
+++ b/src/test/ui/pattern/issue-82290.rs
@@ -0,0 +1,7 @@
+#![feature(let_chains)] //~ WARN the feature `let_chains` is incomplete
+
+fn main() {
+    if true && let x = 1 { //~ ERROR `let` expressions are not supported here
+        let _ = x;
+    }
+}
diff --git a/src/test/ui/pattern/issue-82290.stderr b/src/test/ui/pattern/issue-82290.stderr
new file mode 100644
index 00000000000..65ef018dc97
--- /dev/null
+++ b/src/test/ui/pattern/issue-82290.stderr
@@ -0,0 +1,20 @@
+error: `let` expressions are not supported here
+  --> $DIR/issue-82290.rs:4:16
+   |
+LL |     if true && let x = 1 {
+   |                ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if`- and `while`-expressions
+   = note: as well as when nested within `&&` and parenthesis in those conditions
+
+warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/issue-82290.rs:1:12
+   |
+LL | #![feature(let_chains)]
+   |            ^^^^^^^^^^
+   |
+   = note: `#[warn(incomplete_features)]` on by default
+   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
+
+error: aborting due to previous error; 1 warning emitted
+