diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/borrowck/borrowck-box-insensitivity.nll.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/borrowck/issue-41962.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/borrowck/issue-41962.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/moves-based-on-type-match-bindings.nll.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/nll/issue-51512.rs | 19 | ||||
| -rw-r--r-- | src/test/ui/nll/issue-51512.stderr | 13 |
6 files changed, 41 insertions, 9 deletions
diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.nll.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.nll.stderr index 1b370567ed1..601f05b499c 100644 --- a/src/test/ui/borrowck/borrowck-box-insensitivity.nll.stderr +++ b/src/test/ui/borrowck/borrowck-box-insensitivity.nll.stderr @@ -7,7 +7,7 @@ LL | //~^ value moved here LL | let _y = a.y; //~ ERROR use of moved | ^^^ value used here after move | - = note: move occurs because `a.y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:108:14 @@ -18,7 +18,7 @@ LL | //~^ value moved here LL | let _y = a.y; //~ ERROR use of collaterally moved | ^^^ value used here after move | - = note: move occurs because `a.y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/issue-41962.rs b/src/test/ui/borrowck/issue-41962.rs index 29481dbe522..2a94e05016d 100644 --- a/src/test/ui/borrowck/issue-41962.rs +++ b/src/test/ui/borrowck/issue-41962.rs @@ -20,7 +20,7 @@ pub fn main(){ //~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382] //~| ERROR use of moved value: `maybe` (Mir) [E0382] //~| ERROR use of moved value: `maybe` (Mir) [E0382] - //~| ERROR use of moved value: `maybe.0` (Mir) [E0382] + //~| ERROR use of moved value (Mir) [E0382] //~| ERROR borrow of moved value: `maybe` (Mir) [E0382] } } diff --git a/src/test/ui/borrowck/issue-41962.stderr b/src/test/ui/borrowck/issue-41962.stderr index e6eb3739d8c..bd5d2a46fd8 100644 --- a/src/test/ui/borrowck/issue-41962.stderr +++ b/src/test/ui/borrowck/issue-41962.stderr @@ -26,7 +26,7 @@ LL | if let Some(thing) = maybe { LL | | } | |_________^ value used here after move | - = note: move occurs because `maybe` has type `std::option::Option<std::vec::Vec<bool>>`, which does not implement the `Copy` trait + = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait error[E0382]: borrow of moved value: `maybe` (Mir) --> $DIR/issue-41962.rs:17:9 @@ -38,7 +38,7 @@ LL | if let Some(thing) = maybe { LL | | } | |_________^ value borrowed here after move | - = note: move occurs because `maybe` has type `std::option::Option<std::vec::Vec<bool>>`, which does not implement the `Copy` trait + = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `maybe` (Mir) --> $DIR/issue-41962.rs:17:16 @@ -49,15 +49,15 @@ LL | if let Some(thing) = maybe { | | value moved here | value used here after move | - = note: move occurs because `maybe` has type `std::option::Option<std::vec::Vec<bool>>`, which does not implement the `Copy` trait + = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait -error[E0382]: use of moved value: `maybe.0` (Mir) +error[E0382]: use of moved value (Mir) --> $DIR/issue-41962.rs:17:21 | LL | if let Some(thing) = maybe { | ^^^^^ value moved here in previous iteration of loop | - = note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait + = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait error: aborting due to 6 previous errors diff --git a/src/test/ui/moves-based-on-type-match-bindings.nll.stderr b/src/test/ui/moves-based-on-type-match-bindings.nll.stderr index 6ebbf670acd..d5b18a6c962 100644 --- a/src/test/ui/moves-based-on-type-match-bindings.nll.stderr +++ b/src/test/ui/moves-based-on-type-match-bindings.nll.stderr @@ -7,7 +7,7 @@ LL | Foo {f} => {} LL | touch(&x); //~ ERROR use of partially moved value: `x` | ^^ value borrowed here after move | - = note: move occurs because `x` has type `Foo<std::string::String>`, which does not implement the `Copy` trait + = note: move occurs because `x.f` has type `std::string::String`, which does not implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/nll/issue-51512.rs b/src/test/ui/nll/issue-51512.rs new file mode 100644 index 00000000000..4543d2ba638 --- /dev/null +++ b/src/test/ui/nll/issue-51512.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(warnings)] +#![feature(nll)] + +fn main() { + let range = 0..1; + let r = range; + let x = range.start; + //~^ ERROR use of moved value: `range.start` [E0382] +} diff --git a/src/test/ui/nll/issue-51512.stderr b/src/test/ui/nll/issue-51512.stderr new file mode 100644 index 00000000000..102de43e5d7 --- /dev/null +++ b/src/test/ui/nll/issue-51512.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `range.start` + --> $DIR/issue-51512.rs:17:13 + | +LL | let r = range; + | ----- value moved here +LL | let x = range.start; + | ^^^^^^^^^^^ value used here after move + | + = note: move occurs because `range` has type `std::ops::Range<i32>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. |
