-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc_resolve: don't allow paths starting with
::crate
.
- Loading branch information
Showing
16 changed files
with
71 additions
and
74 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
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
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
12 changes: 9 additions & 3 deletions
12
src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
error[E0433]: failed to resolve. Could not find `crate` in `m` | ||
error[E0433]: failed to resolve. `crate` in paths can only be used in start position | ||
--> $DIR/crate-path-non-absolute.rs:17:22 | ||
| | ||
LL | let s = ::m::crate::S; //~ ERROR failed to resolve | ||
| ^^^^^ Could not find `crate` in `m` | ||
| ^^^^^ `crate` in paths can only be used in start position | ||
|
||
error: aborting due to previous error | ||
error[E0433]: failed to resolve. global paths cannot start with `crate` | ||
--> $DIR/crate-path-non-absolute.rs:18:20 | ||
| | ||
LL | let s1 = ::crate::S; //~ ERROR failed to resolve | ||
| ^^^^^ global paths cannot start with `crate` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |
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
8 changes: 4 additions & 4 deletions
8
src/test/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0433]: failed to resolve. `crate` in paths can only be used in start position | ||
error[E0532]: expected unit struct/variant or constant, found module `crate` | ||
--> $DIR/keyword-crate-as-identifier.rs:14:9 | ||
| | ||
LL | let crate = 0; //~ ERROR failed to resolve. `crate` in paths can only be used in start position | ||
| ^^^^^ `crate` in paths can only be used in start position | ||
LL | let crate = 0; | ||
| ^^^^^ not a unit struct/variant or constant | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0433`. | ||
For more information about this error, try `rustc --explain E0532`. |
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