Skip to content

Commit 100af45

Browse files
committed
Update test
1 parent 5ddb924 commit 100af45

5 files changed

+46
-78
lines changed
+12-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
// run-fail
2-
// check-run-results
3-
4-
// exec-env:RUST_BACKTRACE=full
51
// revisions: with-remap without-remap
62
// compile-flags: -g -Ztranslate-remapped-path-to-local-path=yes
73
// [with-remap]compile-flags: --remap-path-prefix={{rust-src-base}}=remapped
84
// [without-remap]compile-flags:
5+
// error-pattern: E0507
6+
7+
use std::thread;
8+
struct Worker {
9+
thread: thread::JoinHandle<()>,
10+
}
911

10-
fn main() {
11-
Vec::<String>::with_capacity(!0);
12+
impl Drop for Worker {
13+
fn drop(&mut self) {
14+
self.thread.join().unwrap();
15+
}
1216
}
17+
18+
pub fn main(){}

tests/ui/errors/remap-path-prefix-sysroot.with-remap.run.stderr

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0507]: cannot move out of `self.thread` which is behind a mutable reference
2+
--> remapped/tests/ui/errors/remap-path-prefix-sysroot.rs:14:9
3+
|
4+
LL | self.thread.join().unwrap();
5+
| ^^^^^^^^^^^ ------ `self.thread` moved due to this method call
6+
| |
7+
| move occurs because `self.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait
8+
|
9+
note: `JoinHandle::<T>::join` takes ownership of the receiver `self`, which moves `self.thread`
10+
--> remapped/library/std/src/thread/mod.rs:LL:COL
11+
|
12+
LL | pub fn join(self) -> Result<T> {
13+
| ^^^^
14+
15+
error: aborting due to 1 previous error
16+
17+
For more information about this error, try `rustc --explain E0507`.

tests/ui/errors/remap-path-prefix-sysroot.without-remap.run.stderr

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0507]: cannot move out of `self.thread` which is behind a mutable reference
2+
--> $DIR/remap-path-prefix-sysroot.rs:14:9
3+
|
4+
LL | self.thread.join().unwrap();
5+
| ^^^^^^^^^^^ ------ `self.thread` moved due to this method call
6+
| |
7+
| move occurs because `self.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait
8+
|
9+
note: `JoinHandle::<T>::join` takes ownership of the receiver `self`, which moves `self.thread`
10+
--> $SRC_DIR_REAL/std/src/thread/mod.rs:LL:COL
11+
|
12+
LL | pub fn join(self) -> Result<T> {
13+
| ^^^^
14+
15+
error: aborting due to 1 previous error
16+
17+
For more information about this error, try `rustc --explain E0507`.

0 commit comments

Comments
 (0)