-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add compiler error E0523 long description and test #100599
Merged
bors
merged 1 commit into
rust-lang:master
from
MatthewPeterKelly:add-E0523-description-and-test
Feb 7, 2023
+75
−15
Merged
Changes from all commits
Commits
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
Add extended error message for E0523
Adds the extended error documentation for E0523 to indicate that the error is no longer produced by the compiler. Update the E0464 documentation to include example code that produces the error. Remove the error message E0523 from the compiler and replace it with an internal compiler error.
commit 2bcd4e256ac00db9185bfbe86286e7a8b35b865f
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
The compiler found multiple library files with the requested crate name. | ||
|
||
```compile_fail | ||
// aux-build:crateresolve-1.rs | ||
// aux-build:crateresolve-2.rs | ||
// aux-build:crateresolve-3.rs | ||
extern crate crateresolve; | ||
//~^ ERROR multiple candidates for `rlib` dependency `crateresolve` found | ||
fn main() {} | ||
``` | ||
|
||
This error can occur in several different cases -- for example, when using | ||
`extern crate` or passing `--extern` options without crate paths. It can also be | ||
caused by caching issues with the build directory, in which case `cargo clean` | ||
may help. | ||
|
||
In the above example, there are three different library files, all of which | ||
define the same crate name. Without providing a full path, there is no way for | ||
the compiler to know which crate it should use. |
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,25 @@ | ||
#### Note: this error code is no longer emitted by the compiler. | ||
|
||
The compiler found multiple library files with the requested crate name. | ||
|
||
```compile_fail | ||
// aux-build:crateresolve-1.rs | ||
// aux-build:crateresolve-2.rs | ||
// aux-build:crateresolve-3.rs | ||
extern crate crateresolve; | ||
//~^ ERROR multiple candidates for `rlib` dependency `crateresolve` found | ||
fn main() {} | ||
``` | ||
|
||
This error can occur in several different cases -- for example, when using | ||
`extern crate` or passing `--extern` options without crate paths. It can also be | ||
caused by caching issues with the build directory, in which case `cargo clean` | ||
may help. | ||
|
||
In the above example, there are three different library files, all of which | ||
define the same crate name. Without providing a full path, there is no way for | ||
the compiler to know which crate it should use. | ||
|
||
*Note that E0523 has been merged into E0464.* |
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,14 @@ | ||
// aux-build:crateresolve1-1.rs | ||
// aux-build:crateresolve1-2.rs | ||
// aux-build:crateresolve1-3.rs | ||
|
||
// normalize-stderr-test: "\.nll/" -> "/" | ||
// normalize-stderr-test: "\\\?\\" -> "" | ||
// normalize-stderr-test: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib" | ||
|
||
// NOTE: This test is duplicated from `tests/ui/crate-loading/crateresolve1.rs`. | ||
|
||
extern crate crateresolve1; | ||
//~^ ERROR multiple candidates for `rlib` dependency `crateresolve1` found | ||
|
||
fn main() {} | ||
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,13 @@ | ||
error[E0464]: multiple candidates for `rlib` dependency `crateresolve1` found | ||
--> $DIR/E0523.rs:11:1 | ||
| | ||
LL | extern crate crateresolve1; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: candidate #1: $TEST_BUILD_DIR/error-codes/E0523/auxiliary/libcrateresolve1-1.somelib | ||
= note: candidate #2: $TEST_BUILD_DIR/error-codes/E0523/auxiliary/libcrateresolve1-2.somelib | ||
= note: candidate #3: $TEST_BUILD_DIR/error-codes/E0523/auxiliary/libcrateresolve1-3.somelib | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0464`. |
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.
Copied from E0464