-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
36
tests/ui/errors/remap-path-prefix-sysroot.with-remap.run.stderr
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
tests/ui/errors/remap-path-prefix-sysroot.with-remap.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
36
tests/ui/errors/remap-path-prefix-sysroot.without-remap.run.stderr
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
tests/ui/errors/remap-path-prefix-sysroot.without-remap.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |