]> git.lizzy.rs Git - rust.git/commitdiff
Adapt test case to match current set of emitted warnings. (or lack
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 18 Jun 2014 13:27:49 +0000 (15:27 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 18 Jun 2014 14:44:21 +0000 (16:44 +0200)
thereof.)

PR 14739 injected the new message that this removes from one test
case: borrowck-vec-pattern-loan-from-mut.rs

When reviewing the test case, I was not able to convince myself that
the error message was a legitimate thing to start emitting.  Niko did
not see an obvious reason for it either, so I am going to remove it
and wait for someone (maybe Cameron Zwarich) to explain to me why we
should be emitting it.

src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs

index ff029ce624c9be24c3adc97764d05397382ade40..393ec8b0b1b3ba9d80e8a7a44e6a2e03dbbf9a60 100644 (file)
@@ -12,7 +12,7 @@ fn a() {
     let mut v = vec!(1, 2, 3);
     let vb: &mut [int] = v.as_mut_slice();
     match vb {
-        [_a, ..tail] => { //~ ERROR cannot use `vb[..]` because it was mutably borrowed
+        [_a, ..tail] => {
             v.push(tail[0] + tail[1]); //~ ERROR cannot borrow
         }
         _ => {}