skip updating when external binding is existed#128932
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 21, 2024
Merged
Conversation
bvanjoi
commented
Aug 10, 2024
Contributor
|
Could you also add a test case for a crate that is not originally in the extern prelude due to command line options or built-ins, like extern crate foo;
macro_rules! second_foo {
() => {
extern crate std as foo;
};
}
second_foo!();
fn main() {
use ::foo;
}@rustbot author |
Contributor
Author
|
In the latest patch:
|
bvanjoi
commented
Aug 16, 2024
bvanjoi
commented
Aug 16, 2024
Contributor
Author
|
@rustbot ready |
extern crate x as y under macro as an error when y is module
Contributor
|
Thanks! |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 20, 2024
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#128662 (Lint on tail expr drop order change in Edition 2024) - rust-lang#128932 (skip updating when external binding is existed) - rust-lang#129270 (Don't consider locals to shadow inner items' generics) - rust-lang#129277 (Update annotate-snippets to 0.11) - rust-lang#129294 (Stabilize `iter::repeat_n`) - rust-lang#129308 (fix: simple typo in compiler directory) - rust-lang#129309 (ctfe: make CompileTimeInterpCx type alias public) - rust-lang#129314 (fix a broken link in `mir/mod.rs`) - rust-lang#129318 (Remove unneeded conversion to `DefId` for `ExtraInfo`) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 21, 2024
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#128662 (Lint on tail expr drop order change in Edition 2024) - rust-lang#128932 (skip updating when external binding is existed) - rust-lang#129270 (Don't consider locals to shadow inner items' generics) - rust-lang#129277 (Update annotate-snippets to 0.11) - rust-lang#129294 (Stabilize `iter::repeat_n`) - rust-lang#129308 (fix: simple typo in compiler directory) - rust-lang#129309 (ctfe: make CompileTimeInterpCx type alias public) - rust-lang#129314 (fix a broken link in `mir/mod.rs`) - rust-lang#129318 (Remove unneeded conversion to `DefId` for `ExtraInfo`) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 21, 2024
Rollup merge of rust-lang#128932 - bvanjoi:issue-128813, r=petrochenkov skip updating when external binding is existed Fixes rust-lang#128813 For following code: ```rs extern crate core; fn f() { use ::core; } macro_rules! m { () => { extern crate std as core; }; } m!(); fn main() {} ``` - In the first loop, we define `extern crate core` and `use ::core` will be referred to `core` (yes, it does not consider if there are some macros that are not expanded. Ideally, this should be delayed if there are some unexpanded macros in the root, but I didn't change it like that because it seems like a huge change). - Then `m` is expanded, which makes `extern_prelude('core')` return `std` rather than `core`, causing the inconsistency. r? `@petrochenkov`
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #128813
For following code:
extern crate coreanduse ::corewill be referred tocore(yes, it does not consider if there are some macros that are not expanded. Ideally, this should be delayed if there are some unexpanded macros in the root, but I didn't change it like that because it seems like a huge change).mis expanded, which makesextern_prelude('core')returnstdrather thancore, causing the inconsistency.r? @petrochenkov