Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Dec 11, 2023
1 parent 5ddb924 commit a306c76
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 78 deletions.
18 changes: 12 additions & 6 deletions tests/ui/errors/remap-path-prefix-sysroot.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// run-fail
// check-run-results

// exec-env:RUST_BACKTRACE=full
// revisions: with-remap without-remap
// compile-flags: -g -Ztranslate-remapped-path-to-local-path=yes
// [with-remap]compile-flags: --remap-path-prefix={{rust-src-base}}=remapped
// [without-remap]compile-flags:
// error-pattern: E0507

use std::thread;
struct Worker {
thread: thread::JoinHandle<()>,
}

fn main() {
Vec::<String>::with_capacity(!0);
impl Drop for Worker {
fn drop(&mut self) {
self.thread.join().unwrap();
}
}

pub fn main(){}
36 changes: 0 additions & 36 deletions tests/ui/errors/remap-path-prefix-sysroot.with-remap.run.stderr

This file was deleted.

17 changes: 17 additions & 0 deletions tests/ui/errors/remap-path-prefix-sysroot.with-remap.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0507]: cannot move out of `self.thread` which is behind a mutable reference
--> remapped/tests/ui/errors/remap-path-prefix-sysroot.rs:14:9
|
LL | self.thread.join().unwrap();
| ^^^^^^^^^^^ ------ `self.thread` moved due to this method call
| |
| move occurs because `self.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait
|
note: `JoinHandle::<T>::join` takes ownership of the receiver `self`, which moves `self.thread`
--> remapped/library/std/src/thread/mod.rs:LL:COL
|
LL | pub fn join(self) -> Result<T> {
| ^^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0507`.
36 changes: 0 additions & 36 deletions tests/ui/errors/remap-path-prefix-sysroot.without-remap.run.stderr

This file was deleted.

17 changes: 17 additions & 0 deletions tests/ui/errors/remap-path-prefix-sysroot.without-remap.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0507]: cannot move out of `self.thread` which is behind a mutable reference
--> $DIR/remap-path-prefix-sysroot.rs:14:9
|
LL | self.thread.join().unwrap();
| ^^^^^^^^^^^ ------ `self.thread` moved due to this method call
| |
| move occurs because `self.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait
|
note: `JoinHandle::<T>::join` takes ownership of the receiver `self`, which moves `self.thread`
--> $SRC_DIR_REAL/std/src/thread/mod.rs:LL:COL
|
LL | pub fn join(self) -> Result<T> {
| ^^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0507`.

0 comments on commit a306c76

Please sign in to comment.