about summary refs log tree commit diff
path: root/src/test/ui/pattern
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-04-23 09:38:34 +0000
committerbors <bors@rust-lang.org>2019-04-23 09:38:34 +0000
commit31f5d69ba4f4d78740190a08ea097b41b00d96cb (patch)
treebc4730f0e3bb9ead3ee01e9d11975b1692314bde /src/test/ui/pattern
parent0f11354a9c1bf0c5ac250c7fa2bafc289a662f42 (diff)
parent87ef96d3946ed4add766c0a2cd72d8443e92e4a0 (diff)
downloadrust-31f5d69ba4f4d78740190a08ea097b41b00d96cb.tar.gz
rust-31f5d69ba4f4d78740190a08ea097b41b00d96cb.zip
Auto merge of #60125 - estebank:continue-evaluating, r=oli-obk
Don't stop evaluating due to errors before borrow checking

r? @oli-obk

Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
Diffstat (limited to 'src/test/ui/pattern')
-rw-r--r--src/test/ui/pattern/const-pat-ice.stderr2
-rw-r--r--src/test/ui/pattern/pattern-bindings-after-at.rs3
-rw-r--r--src/test/ui/pattern/pattern-bindings-after-at.stderr18
3 files changed, 21 insertions, 2 deletions
diff --git a/src/test/ui/pattern/const-pat-ice.stderr b/src/test/ui/pattern/const-pat-ice.stderr
index 03580dfecfb..261e95229a7 100644
--- a/src/test/ui/pattern/const-pat-ice.stderr
+++ b/src/test/ui/pattern/const-pat-ice.stderr
@@ -1,4 +1,4 @@
-thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', src/librustc_mir/hair/pattern/_match.rs:1069:5
+thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', src/librustc_mir/hair/pattern/_match.rs:1071:5
 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
 
 error: internal compiler error: unexpected panic
diff --git a/src/test/ui/pattern/pattern-bindings-after-at.rs b/src/test/ui/pattern/pattern-bindings-after-at.rs
index 4a24a496857..20a1d017cdd 100644
--- a/src/test/ui/pattern/pattern-bindings-after-at.rs
+++ b/src/test/ui/pattern/pattern-bindings-after-at.rs
@@ -7,6 +7,9 @@ fn main() {
     match &mut Some(1) {
         ref mut z @ &mut Some(ref a) => {
         //~^ ERROR pattern bindings are not allowed after an `@`
+        //~| WARN cannot borrow `_` as immutable because it is also borrowed as mutable
+        //~| WARN this error has been downgraded to a warning for backwards compatibility
+        //~| WARN this represents potential undefined behavior in your code and this warning will
             **z = None;
             println!("{}", *a);
         }
diff --git a/src/test/ui/pattern/pattern-bindings-after-at.stderr b/src/test/ui/pattern/pattern-bindings-after-at.stderr
index 7a3883c5854..3a2cffcbf45 100644
--- a/src/test/ui/pattern/pattern-bindings-after-at.stderr
+++ b/src/test/ui/pattern/pattern-bindings-after-at.stderr
@@ -4,6 +4,22 @@ error[E0303]: pattern bindings are not allowed after an `@`
 LL |         ref mut z @ &mut Some(ref a) => {
    |                               ^^^^^ not allowed after `@`
 
+warning[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
+  --> $DIR/pattern-bindings-after-at.rs:8:31
+   |
+LL |         ref mut z @ &mut Some(ref a) => {
+   |         ----------------------^^^^^-
+   |         |                     |
+   |         |                     immutable borrow occurs here
+   |         mutable borrow occurs here
+...
+LL |             **z = None;
+   |             ---------- mutable borrow later used here
+   |
+   = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
+   = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0303`.
+Some errors have detailed explanations: E0303, E0502.
+For more information about an error, try `rustc --explain E0303`.