-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add filter with following segment while lookup typo for path #113331
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
bors
merged 3 commits into
rust-lang:master
from
chenyukang:yukang-fix-112590-false-positive
Jul 10, 2023
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,29 @@ | ||
// edition:2018 | ||
#![feature(decl_macro)] | ||
|
||
macro a() { | ||
extern crate core as my_core; | ||
mod v { | ||
// Early resolution. | ||
use my_core; //~ ERROR unresolved import `my_core` | ||
} | ||
mod u { | ||
// Late resolution. | ||
fn f() { my_core::mem::drop(0); } | ||
//~^ ERROR failed to resolve: use of undeclared crate or module `my_core` | ||
} | ||
} | ||
|
||
a!(); | ||
|
||
mod v { | ||
// Early resolution. | ||
use my_core; //~ ERROR unresolved import `my_core` | ||
} | ||
mod u { | ||
// Late resolution. | ||
fn f() { my_core::mem::drop(0); } | ||
//~^ ERROR failed to resolve: use of undeclared crate or module `my_core` | ||
} | ||
|
||
fn main() {} |
53 changes: 53 additions & 0 deletions
53
tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.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,53 @@ | ||
error[E0432]: unresolved import `my_core` | ||
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:21:9 | ||
| | ||
LL | use my_core; | ||
| ^^^^^^^ no external crate `my_core` | ||
|
||
error[E0432]: unresolved import `my_core` | ||
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:8:13 | ||
| | ||
LL | use my_core; | ||
| ^^^^^^^ no external crate `my_core` | ||
... | ||
LL | a!(); | ||
| ---- in this macro invocation | ||
| | ||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `my_core` | ||
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18 | ||
| | ||
LL | fn f() { my_core::mem::drop(0); } | ||
| ^^^^^^^ use of undeclared crate or module `my_core` | ||
... | ||
LL | a!(); | ||
| ---- in this macro invocation | ||
| | ||
= help: consider importing one of these items: | ||
std::mem | ||
core::mem | ||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `my_core` | ||
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14 | ||
| | ||
LL | fn f() { my_core::mem::drop(0); } | ||
| ^^^^^^^ use of undeclared crate or module `my_core` | ||
| | ||
help: consider importing one of these items | ||
| | ||
LL + use core::mem; | ||
| | ||
LL + use std::mem; | ||
| | ||
help: if you import `mem`, refer to it directly | ||
| | ||
LL - fn f() { my_core::mem::drop(0); } | ||
LL + fn f() { mem::drop(0); } | ||
| | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0432, E0433. | ||
For more information about an error, try `rustc --explain E0432`. |
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,3 +1,4 @@ | ||
// edition:2015 | ||
#![feature(decl_macro)] | ||
|
||
macro a() { | ||
|
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
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,34 @@ | ||
// run-rustfix | ||
use std::vec; | ||
|
||
use std::sync::atomic::AtomicBool; | ||
|
||
mod foo { | ||
pub mod bar { | ||
pub mod baz { | ||
pub use std::vec::Vec as MyVec; | ||
} | ||
} | ||
} | ||
|
||
mod u { | ||
use foo::bar::baz::MyVec; | ||
|
||
fn _a() { | ||
let _: Vec<i32> = MyVec::new(); //~ ERROR failed to resolve | ||
} | ||
} | ||
|
||
mod v { | ||
use foo::bar::baz::MyVec; | ||
|
||
fn _b() { | ||
let _: Vec<i32> = MyVec::new(); //~ ERROR failed to resolve | ||
} | ||
} | ||
|
||
fn main() { | ||
let _t: Vec<i32> = Vec::new(); //~ ERROR failed to resolve | ||
type _B = vec::Vec::<u8>; //~ ERROR failed to resolve | ||
let _t = AtomicBool::new(true); //~ ERROR failed to resolve | ||
} |
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.