-
Notifications
You must be signed in to change notification settings - Fork 13.4k
skip updating when external binding is existed #128932
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 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
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
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...imports/auxiliary/issue-85992-extern-1.rs → ...i/imports/auxiliary/issue-85992-extern.rs
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[macro_export] | ||
macro_rules! m { | ||
() => { | ||
use issue_85992_extern_2::Outcome; | ||
use empty::Outcome; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
//@ edition: 2021 | ||
//@ compile-flags: --extern issue_85992_extern_1 --extern issue_85992_extern_2 | ||
//@ aux-build: issue-85992-extern-1.rs | ||
//@ aux-build: issue-85992-extern-2.rs | ||
//@ compile-flags: --extern issue_85992_extern --extern empty | ||
//@ aux-build: issue-85992-extern.rs | ||
//@ aux-build: empty.rs | ||
|
||
issue_85992_extern_1::m!(); | ||
issue_85992_extern::m!(); | ||
|
||
use crate::issue_85992_extern_2; | ||
//~^ ERROR unresolved import `crate::issue_85992_extern_2` | ||
use crate::empty; | ||
//~^ ERROR unresolved import `crate::empty` | ||
|
||
fn main() {} |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@ edition: 2021 | ||
|
||
// issue#128813 | ||
|
||
extern crate core; | ||
|
||
macro_rules! m { | ||
() => { | ||
extern crate std as core; | ||
//~^ ERROR: the name `core` is defined multiple times | ||
}; | ||
} | ||
|
||
m!(); | ||
|
||
fn main() { | ||
use ::core; | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0259]: the name `core` is defined multiple times | ||
--> $DIR/multiple-extern-by-macro-for-buitlin.rs:9:9 | ||
| | ||
LL | extern crate core; | ||
| ------------------ previous import of the extern crate `core` here | ||
... | ||
LL | extern crate std as core; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ `core` reimported here | ||
... | ||
LL | m!(); | ||
| ---- in this macro invocation | ||
| | ||
= note: `core` must be defined only once in the type namespace of this module | ||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
help: you can use `as` to change the binding name of the import | ||
| | ||
LL | extern crate std as other_core; | ||
| | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0259`. |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@ edition: 2021 | ||
//@ aux-build: empty.rs | ||
|
||
// issue#128813 | ||
|
||
extern crate empty; | ||
|
||
macro_rules! m { | ||
() => { | ||
extern crate std as empty; | ||
//~^ ERROR: the name `empty` is defined multiple times | ||
}; | ||
} | ||
|
||
m!(); | ||
|
||
fn main() { | ||
use ::empty; | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/ui/imports/multiple-extern-by-macro-for-custom.stderr
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0259]: the name `empty` is defined multiple times | ||
--> $DIR/multiple-extern-by-macro-for-custom.rs:10:9 | ||
| | ||
LL | extern crate empty; | ||
| ------------------- previous import of the extern crate `empty` here | ||
... | ||
LL | extern crate std as empty; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `empty` reimported here | ||
... | ||
LL | m!(); | ||
| ---- in this macro invocation | ||
| | ||
= note: `empty` must be defined only once in the type namespace of this module | ||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
help: you can use `as` to change the binding name of the import | ||
| | ||
LL | extern crate std as other_empty; | ||
| | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0259`. |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@ edition: 2021 | ||
|
||
// issue#128813 | ||
|
||
extern crate non_existent; | ||
//~^ ERROR: can't find crate for `non_existent` | ||
|
||
macro_rules! m { | ||
() => { | ||
extern crate std as non_existent; | ||
//~^ ERROR: the name `non_existent` is defined multiple times | ||
}; | ||
} | ||
|
||
m!(); | ||
|
||
fn main() { | ||
use ::non_existent; | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error[E0463]: can't find crate for `non_existent` | ||
--> $DIR/multiple-extern-by-macro-for-inexist.rs:5:1 | ||
| | ||
LL | extern crate non_existent; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate | ||
|
||
error[E0259]: the name `non_existent` is defined multiple times | ||
--> $DIR/multiple-extern-by-macro-for-inexist.rs:10:9 | ||
| | ||
LL | extern crate non_existent; | ||
| -------------------------- previous import of the extern crate `non_existent` here | ||
... | ||
LL | extern crate std as non_existent; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `non_existent` reimported here | ||
... | ||
LL | m!(); | ||
| ---- in this macro invocation | ||
| | ||
= note: `non_existent` must be defined only once in the type namespace of this module | ||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
help: you can use `as` to change the binding name of the import | ||
| | ||
LL | extern crate std as other_non_existent; | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0259, E0463. | ||
For more information about an error, try `rustc --explain E0259`. |
18 changes: 18 additions & 0 deletions
18
tests/ui/imports/multiple-extern-by-macro-for-underscore.rs
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@ edition: 2021 | ||
|
||
// issue#128813 | ||
|
||
extern crate core as _; | ||
|
||
macro_rules! m { | ||
() => { | ||
extern crate std as _; | ||
}; | ||
} | ||
|
||
m!(); | ||
|
||
fn main() { | ||
use ::_; | ||
//~^ ERROR: expected identifier, found reserved identifier `_` | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/ui/imports/multiple-extern-by-macro-for-underscore.stderr
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: expected identifier, found reserved identifier `_` | ||
--> $DIR/multiple-extern-by-macro-for-underscore.rs:16:11 | ||
| | ||
LL | use ::_; | ||
| ^ expected identifier, found reserved identifier | ||
|
||
error: aborting due to 1 previous error | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.