-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display name of crate requiring rustc_private in error messages. #62819
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bf7b981
Display name of crate requiring rustc_private
gnzlbg f3a3141
Add rustc_private feature to the test crate
gnzlbg 91f0d58
Add new tests.
gnzlbg d6a7017
Fix hash-stable-is-unstable test
gnzlbg 9822496
Fix hash-stable-is-unstable test
gnzlbg f061267
Fix unit test errors.
crlf0710 6a26b80
Address review changes.
crlf0710 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,4 @@ | ||
fn main() { | ||
extern crate libc; //~ ERROR use of unstable | ||
use libc::*; //~ ERROR unresolved import | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/ui/feature-gates/feature-gate-rustc_private-libc.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,19 @@ | ||
error[E0432]: unresolved import `libc` | ||
--> $DIR/feature-gate-rustc_private-libc.rs:3:9 | ||
| | ||
LL | use libc::*; | ||
| ^^^^ maybe a missing `extern crate libc;`? | ||
|
||
error[E0658]: use of unstable library feature 'rustc_private': crate "libc" is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? | ||
--> $DIR/feature-gate-rustc_private-libc.rs:2:5 | ||
| | ||
LL | extern crate libc; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/27812 | ||
= help: add `#![feature(rustc_private)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0432, E0658. | ||
For more information about an error, try `rustc --explain E0432`. |
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,4 @@ | ||
fn main() { | ||
extern crate test; //~ ERROR use of unstable | ||
use test::*; //~ ERROR unresolved import | ||
} |
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,19 @@ | ||
error[E0432]: unresolved import `test` | ||
--> $DIR/feature-gate-test.rs:3:9 | ||
| | ||
LL | use test::*; | ||
| ^^^^ maybe a missing `extern crate test;`? | ||
|
||
error[E0658]: use of unstable library feature 'test' | ||
--> $DIR/feature-gate-test.rs:2:5 | ||
| | ||
LL | extern crate test; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/27812 | ||
= help: add `#![feature(test)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0432, E0658. | ||
For more information about an error, try `rustc --explain E0432`. |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason for this duplicate line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those directives match the start of an error message. Both error messages start the same, but then contain a different crate being loaded from the sysroot:
crate "rustc_data_structures" is being from the sysroot, [...]
andcrate "rustc" is being from the sysroot, [...]
.