-
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.
- Loading branch information
Showing
19 changed files
with
233 additions
and
2 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
tests/ui/imports/auxiliary/glob-conflict-cross-crate-2-extern.rs
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
mod a { | ||
pub type C = i8; | ||
} | ||
|
||
mod b { | ||
pub type C = i16; | ||
} | ||
|
||
pub use a::*; | ||
pub use b::*; |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
macro_rules! m { | ||
() => { | ||
pub fn max() {} | ||
pub(crate) mod max {} | ||
}; | ||
} | ||
|
||
mod d { | ||
m! {} | ||
} | ||
|
||
mod e { | ||
pub type max = i32; | ||
} | ||
|
||
pub use self::d::*; | ||
pub use self::e::*; |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
mod gio { | ||
pub trait SettingsExt { | ||
fn abc(&self) {} | ||
} | ||
impl<T> SettingsExt for T {} | ||
} | ||
|
||
mod gtk { | ||
pub trait SettingsExt { | ||
fn efg(&self) {} | ||
} | ||
impl<T> SettingsExt for T {} | ||
} | ||
|
||
pub use gtk::*; | ||
pub use gio::*; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
mod a { | ||
pub type Result<T> = std::result::Result<T, ()>; | ||
} | ||
|
||
mod b { | ||
pub type Result<T> = std::result::Result<T, ()>; | ||
} | ||
|
||
pub use a::*; | ||
pub use b::*; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub struct Url; |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// edition: 2018 | ||
// aux-build: issue-114682-5-extern-1.rs | ||
// compile-flags: --extern issue_114682_5_extern_1 | ||
|
||
pub mod p { | ||
pub use crate::types::*; | ||
pub use crate::*; | ||
} | ||
mod types { | ||
pub mod issue_114682_5_extern_1 {} | ||
} | ||
|
||
pub use issue_114682_5_extern_1; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
mod a { | ||
pub fn log() {} | ||
} | ||
mod b { | ||
pub fn log() {} | ||
} | ||
|
||
pub use self::a::*; | ||
pub use self::b::*; |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
.../imports/glob-conflict-cross-crate.stderr → ...mports/glob-conflict-cross-crate-1.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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// aux-build:glob-conflict-cross-crate-2-extern.rs | ||
|
||
extern crate glob_conflict_cross_crate_2_extern; | ||
|
||
use glob_conflict_cross_crate_2_extern::*; | ||
|
||
fn main() { | ||
let _a: C = 1; //~ ERROR cannot find type `C` in this scope | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0412]: cannot find type `C` in this scope | ||
--> $DIR/glob-conflict-cross-crate-2.rs:8:13 | ||
| | ||
LL | let _a: C = 1; | ||
| ^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// check-pass | ||
// aux-build:glob-conflict-cross-crate-2-extern.rs | ||
|
||
extern crate glob_conflict_cross_crate_2_extern; | ||
|
||
mod a { | ||
pub type C = i32; | ||
} | ||
|
||
use glob_conflict_cross_crate_2_extern::*; | ||
use a::*; | ||
|
||
fn main() { | ||
let _a: C = 1; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// https://github.com/rust-lang/rust/pull/114682#discussion_r1420534109 | ||
|
||
#![feature(decl_macro)] | ||
|
||
macro_rules! mac { | ||
() => { | ||
pub macro A() { | ||
println!("non import") | ||
} | ||
} | ||
} | ||
|
||
mod m { | ||
pub macro A() { | ||
println!("import") | ||
} | ||
} | ||
|
||
pub use m::*; | ||
mac!(); | ||
|
||
fn main() { | ||
A!(); | ||
//~^ ERROR `A` is ambiguous | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
error[E0659]: `A` is ambiguous | ||
--> $DIR/issue-114682-1.rs:23:5 | ||
| | ||
LL | A!(); | ||
| ^ ambiguous name | ||
| | ||
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution | ||
note: `A` could refer to the macro defined here | ||
--> $DIR/issue-114682-1.rs:7:9 | ||
| | ||
LL | / pub macro A() { | ||
LL | | println!("non import") | ||
LL | | } | ||
| |_________^ | ||
... | ||
LL | mac!(); | ||
| ------ in this macro invocation | ||
note: `A` could also refer to the macro imported here | ||
--> $DIR/issue-114682-1.rs:19:9 | ||
| | ||
LL | pub use m::*; | ||
| ^^^^ | ||
= help: consider adding an explicit import of `A` to disambiguate | ||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0659`. |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// check-pass | ||
// aux-build: issue-114682-2-extern.rs | ||
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1879998900 | ||
|
||
extern crate issue_114682_2_extern; | ||
|
||
use issue_114682_2_extern::max; | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// check-pass | ||
// aux-build: issue-114682-3-extern.rs | ||
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880625909 | ||
|
||
extern crate issue_114682_3_extern; | ||
|
||
use issue_114682_3_extern::*; | ||
|
||
mod auto { | ||
pub trait SettingsExt { | ||
fn ext(&self) {} | ||
} | ||
|
||
impl<T> SettingsExt for T {} | ||
} | ||
|
||
pub use self::auto::*; | ||
|
||
fn main() { | ||
let a: u8 = 1; | ||
a.ext(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// check-pass | ||
// aux-build: issue-114682-4-extern.rs | ||
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880755441 | ||
|
||
extern crate issue_114682_4_extern; | ||
|
||
use issue_114682_4_extern::*; | ||
|
||
fn a() -> Result<i32, ()> { | ||
Ok(1) | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// check-pass | ||
// edition: 2018 | ||
// aux-build: issue-114682-5-extern-1.rs | ||
// aux-build: issue-114682-5-extern-2.rs | ||
// compile-flags: --extern issue_114682_5_extern_1 | ||
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880755441 | ||
|
||
extern crate issue_114682_5_extern_2; | ||
|
||
use issue_114682_5_extern_2::p::*; | ||
use issue_114682_5_extern_1::Url; | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// check-pass | ||
// aux-build: issue-114682-6-extern.rs | ||
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880755441 | ||
|
||
extern crate issue_114682_6_extern; | ||
|
||
use issue_114682_6_extern::*; | ||
|
||
fn main() { | ||
let log = 2; | ||
let _ = log; | ||
} |