Skip to content

Commit 7ee8142

Browse files
authored
Rollup merge of rust-lang#120195 - bvanjoi:add-some-resolution-test-case, r=petrochenkov
add several resolution test cases r? ``@petrochenkov``
2 parents ecb8702 + 851d4c4 commit 7ee8142

24 files changed

+269
-3
lines changed

tests/ui/imports/ambiguous-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ extern crate ambiguous_1;
66

77
fn main() {
88
ambiguous_1::id();
9+
//^ FIXME: `id` should be identified as an ambiguous item.
910
}

tests/ui/imports/ambiguous-4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ extern crate ambiguous_4_extern;
55

66
fn main() {
77
ambiguous_4_extern::id();
8-
// `warning_ambiguous` had been lost at metadata.
8+
//^ FIXME: `id` should be identified as an ambiguous item.
99
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mod a {
2+
pub type C = i8;
3+
}
4+
5+
mod b {
6+
pub type C = i16;
7+
}
8+
9+
pub use a::*;
10+
pub use b::*;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
macro_rules! m {
2+
() => {
3+
pub fn max() {}
4+
pub(crate) mod max {}
5+
};
6+
}
7+
8+
mod d {
9+
m! {}
10+
}
11+
12+
mod e {
13+
pub type max = i32;
14+
}
15+
16+
pub use self::d::*;
17+
pub use self::e::*;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
mod gio {
2+
pub trait SettingsExt {
3+
fn abc(&self) {}
4+
}
5+
impl<T> SettingsExt for T {}
6+
}
7+
8+
mod gtk {
9+
pub trait SettingsExt {
10+
fn efg(&self) {}
11+
}
12+
impl<T> SettingsExt for T {}
13+
}
14+
15+
pub use gtk::*;
16+
pub use gio::*;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mod a {
2+
pub type Result<T> = std::result::Result<T, ()>;
3+
}
4+
5+
mod b {
6+
pub type Result<T> = std::result::Result<T, ()>;
7+
}
8+
9+
pub use a::*;
10+
pub use b::*;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub struct Url;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// edition: 2018
2+
// aux-build: issue-114682-5-extern-1.rs
3+
// compile-flags: --extern issue_114682_5_extern_1
4+
5+
pub mod p {
6+
pub use crate::types::*;
7+
pub use crate::*;
8+
}
9+
mod types {
10+
pub mod issue_114682_5_extern_1 {}
11+
}
12+
13+
pub use issue_114682_5_extern_1;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
mod a {
2+
pub fn log() {}
3+
}
4+
mod b {
5+
pub fn log() {}
6+
}
7+
8+
pub use self::a::*;
9+
pub use self::b::*;

tests/ui/imports/extern-with-ambiguous-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ mod s {
1212
use s::*;
1313
use extern_with_ambiguous_2_extern::*;
1414
use error::*;
15+
//^ FIXME: An ambiguity error should be thrown for `error`,
16+
// as there is ambiguity present within `extern-with-ambiguous-2-extern.rs`.
1517

1618
fn main() {}

0 commit comments

Comments
 (0)