-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Add error explanation for E0317, E0154, E0259, E0260. #25267
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7d9e605
Add error explanation for E0317.
meqif c0412bc
Fix documentation URL in diagnostic message.
meqif f3a3684
Add error explanation for E0154.
meqif e7fa00a
Add error explanation for E0259.
meqif 60ec4ab
Add error explanation for E0260.
meqif ef03055
Improve wording in error explanation.
meqif aa529ef
Add missing keyword in `extern crate` declarations.
meqif 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 error explanation for E0260.
- Loading branch information
commit 60ec4ab220385be1ad2aef237733d7f38c2196b3
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -67,6 +67,40 @@ extern crate_a as other_name; | |
| ``` | ||
| "##, | ||
|
|
||
| E0260: r##" | ||
| The name for an item declaration conflicts with an external crate's name. | ||
|
|
||
| For instance, | ||
| ``` | ||
| extern abc; | ||
|
|
||
| struct abc; | ||
| ``` | ||
|
|
||
| There are two possible solutions: | ||
|
|
||
| Solution #1: Rename the item. | ||
|
|
||
| ``` | ||
| extern abc; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need |
||
|
|
||
| struct xyz; | ||
| ``` | ||
|
|
||
| Solution #2: Import the crate with a different name. | ||
|
|
||
| ``` | ||
| extern abc as xyz; | ||
|
|
||
| struct abc; | ||
| ``` | ||
|
|
||
| See the Declaration Statements section of the reference for more information | ||
| about what constitutes an Item declaration and what does not: | ||
|
|
||
| http://doc.rust-lang.org/reference.html#statements | ||
| "##, | ||
|
|
||
| E0317: r##" | ||
| User-defined types or type parameters cannot shadow the primitive types. | ||
| This error indicates you tried to define a type, struct or enum with the same | ||
|
|
@@ -91,7 +125,6 @@ register_diagnostics! { | |
| E0256, // import conflicts with type in this module | ||
| E0257, // inherent implementations are only allowed on types defined in the current module | ||
| E0258, // import conflicts with existing submodule | ||
| E0260, // name conflicts with an external crate that has been imported into this module | ||
| E0364, // item is private | ||
| E0365 // item is private | ||
| } | ||
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.
Need an
extern cratehere.