forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement RFC3137 trim-paths sysroot changes
- Loading branch information
Showing
6 changed files
with
132 additions
and
52 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
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
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
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,23 @@ | ||
//@ 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 | ||
|
||
// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically | ||
// as the remapped revision will not begin with $SRC_DIR_REAL, | ||
// so we have to do it ourselves. | ||
//@ normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:COL" | ||
|
||
use std::thread; | ||
struct Worker { | ||
thread: thread::JoinHandle<()>, | ||
} | ||
|
||
impl Drop for Worker { | ||
fn drop(&mut self) { | ||
self.thread.join().unwrap(); | ||
} | ||
} | ||
|
||
pub fn main(){} |
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:LL:COL | ||
| | ||
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`. |
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:LL:COL | ||
| | ||
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`. |