Skip to content

Commit e388d62

Browse files
committed
report everything as a lint for crater
1 parent d040c8a commit e388d62

15 files changed

+290
-35
lines changed

compiler/rustc_resolve/src/build_reduced_graph.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
8383
span: Span,
8484
expansion: LocalExpnId,
8585
ambiguity: Option<(NameBinding<'ra>, AmbiguityKind)>,
86-
warn_ambiguity: bool,
86+
_warn_ambiguity: bool,
8787
) {
8888
let binding = self.arenas.alloc_name_binding(NameBindingData {
8989
kind: NameBindingKind::Res(res),
9090
ambiguity,
91-
warn_ambiguity,
91+
// FIXME: report everything as a lint for crater
92+
warn_ambiguity: true,
9293
vis,
9394
span,
9495
expansion,

tests/ui/imports/glob-conflict-cross-crate-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ extern crate glob_conflict;
44

55
fn main() {
66
glob_conflict::f(); //~ ERROR `f` is ambiguous
7+
//~| WARN this was previously accepted
78
glob_conflict::glob::f(); //~ ERROR `f` is ambiguous
9+
//~| WARN this was previously accepted
810
}

tests/ui/imports/glob-conflict-cross-crate-1.stderr

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
error[E0659]: `f` is ambiguous
1+
error: `f` is ambiguous
22
--> $DIR/glob-conflict-cross-crate-1.rs:6:20
33
|
44
LL | glob_conflict::f();
55
| ^ ambiguous name
66
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
79
= note: ambiguous because of multiple glob imports of a name in the same module
810
note: `f` could refer to the function defined here
911
--> $DIR/auxiliary/glob-conflict.rs:10:9
@@ -15,13 +17,16 @@ note: `f` could also refer to the function defined here
1517
|
1618
LL | pub use m2::*;
1719
| ^^
20+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
1821

19-
error[E0659]: `f` is ambiguous
20-
--> $DIR/glob-conflict-cross-crate-1.rs:7:26
22+
error: `f` is ambiguous
23+
--> $DIR/glob-conflict-cross-crate-1.rs:8:26
2124
|
2225
LL | glob_conflict::glob::f();
2326
| ^ ambiguous name
2427
|
28+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
29+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
2530
= note: ambiguous because of multiple glob imports of a name in the same module
2631
note: `f` could refer to the function defined here
2732
--> $DIR/auxiliary/glob-conflict.rs:10:9
@@ -36,4 +41,47 @@ LL | pub use m2::*;
3641

3742
error: aborting due to 2 previous errors
3843

39-
For more information about this error, try `rustc --explain E0659`.
44+
Future incompatibility report: Future breakage diagnostic:
45+
error: `f` is ambiguous
46+
--> $DIR/glob-conflict-cross-crate-1.rs:6:20
47+
|
48+
LL | glob_conflict::f();
49+
| ^ ambiguous name
50+
|
51+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
52+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
53+
= note: ambiguous because of multiple glob imports of a name in the same module
54+
note: `f` could refer to the function defined here
55+
--> $DIR/auxiliary/glob-conflict.rs:10:9
56+
|
57+
LL | pub use m1::*;
58+
| ^^
59+
note: `f` could also refer to the function defined here
60+
--> $DIR/auxiliary/glob-conflict.rs:11:9
61+
|
62+
LL | pub use m2::*;
63+
| ^^
64+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
65+
66+
Future breakage diagnostic:
67+
error: `f` is ambiguous
68+
--> $DIR/glob-conflict-cross-crate-1.rs:8:26
69+
|
70+
LL | glob_conflict::glob::f();
71+
| ^ ambiguous name
72+
|
73+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
74+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
75+
= note: ambiguous because of multiple glob imports of a name in the same module
76+
note: `f` could refer to the function defined here
77+
--> $DIR/auxiliary/glob-conflict.rs:10:9
78+
|
79+
LL | pub use m1::*;
80+
| ^^
81+
note: `f` could also refer to the function defined here
82+
--> $DIR/auxiliary/glob-conflict.rs:11:9
83+
|
84+
LL | pub use m2::*;
85+
| ^^
86+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
87+

tests/ui/imports/glob-conflict-cross-crate-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ use glob_conflict_cross_crate_2_extern::*;
66

77
fn main() {
88
let _a: C = 1; //~ ERROR `C` is ambiguous
9+
//~| WARN this was previously accepted
910
}

tests/ui/imports/glob-conflict-cross-crate-2.stderr

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
error[E0659]: `C` is ambiguous
1+
error: `C` is ambiguous
22
--> $DIR/glob-conflict-cross-crate-2.rs:8:13
33
|
44
LL | let _a: C = 1;
55
| ^ ambiguous name
66
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
79
= note: ambiguous because of multiple glob imports of a name in the same module
810
note: `C` could refer to the type alias defined here
911
--> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:9:9
@@ -15,7 +17,29 @@ note: `C` could also refer to the type alias defined here
1517
|
1618
LL | pub use b::*;
1719
| ^
20+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
1821

1922
error: aborting due to 1 previous error
2023

21-
For more information about this error, try `rustc --explain E0659`.
24+
Future incompatibility report: Future breakage diagnostic:
25+
error: `C` is ambiguous
26+
--> $DIR/glob-conflict-cross-crate-2.rs:8:13
27+
|
28+
LL | let _a: C = 1;
29+
| ^ ambiguous name
30+
|
31+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
32+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
33+
= note: ambiguous because of multiple glob imports of a name in the same module
34+
note: `C` could refer to the type alias defined here
35+
--> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:9:9
36+
|
37+
LL | pub use a::*;
38+
| ^
39+
note: `C` could also refer to the type alias defined here
40+
--> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:10:9
41+
|
42+
LL | pub use b::*;
43+
| ^
44+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
45+

tests/ui/imports/glob-conflict-cross-crate-3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ fn main() {
1313
let _a: C = 1;
1414
//~^ ERROR `C` is ambiguous
1515
//~| ERROR `C` is ambiguous
16+
//~| WARN this was previously accepted
17+
//~| WARN this was previously accepted
1618
}

tests/ui/imports/glob-conflict-cross-crate-3.stderr

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
error[E0659]: `C` is ambiguous
1+
error: `C` is ambiguous
22
--> $DIR/glob-conflict-cross-crate-3.rs:13:13
33
|
44
LL | let _a: C = 1;
55
| ^ ambiguous name
66
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
9+
= note: ambiguous because of multiple glob imports of a name in the same module
10+
note: `C` could refer to the type alias defined here
11+
--> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:9:9
12+
|
13+
LL | pub use a::*;
14+
| ^
15+
note: `C` could also refer to the type alias defined here
16+
--> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:10:9
17+
|
18+
LL | pub use b::*;
19+
| ^
20+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
21+
22+
error: `C` is ambiguous
23+
--> $DIR/glob-conflict-cross-crate-3.rs:13:13
24+
|
25+
LL | let _a: C = 1;
26+
| ^ ambiguous name
27+
|
28+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
29+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
730
= note: ambiguous because of multiple glob imports of a name in the same module
831
note: `C` could refer to the type alias imported here
932
--> $DIR/glob-conflict-cross-crate-3.rs:9:5
@@ -18,12 +41,17 @@ LL | use a::*;
1841
| ^^^^
1942
= help: consider adding an explicit import of `C` to disambiguate
2043

21-
error[E0659]: `C` is ambiguous
44+
error: aborting due to 2 previous errors
45+
46+
Future incompatibility report: Future breakage diagnostic:
47+
error: `C` is ambiguous
2248
--> $DIR/glob-conflict-cross-crate-3.rs:13:13
2349
|
2450
LL | let _a: C = 1;
2551
| ^ ambiguous name
2652
|
53+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
54+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
2755
= note: ambiguous because of multiple glob imports of a name in the same module
2856
note: `C` could refer to the type alias defined here
2957
--> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:9:9
@@ -35,7 +63,29 @@ note: `C` could also refer to the type alias defined here
3563
|
3664
LL | pub use b::*;
3765
| ^
66+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
3867

39-
error: aborting due to 2 previous errors
68+
Future breakage diagnostic:
69+
error: `C` is ambiguous
70+
--> $DIR/glob-conflict-cross-crate-3.rs:13:13
71+
|
72+
LL | let _a: C = 1;
73+
| ^ ambiguous name
74+
|
75+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
76+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
77+
= note: ambiguous because of multiple glob imports of a name in the same module
78+
note: `C` could refer to the type alias imported here
79+
--> $DIR/glob-conflict-cross-crate-3.rs:9:5
80+
|
81+
LL | use glob_conflict_cross_crate_2_extern::*;
82+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83+
= help: consider adding an explicit import of `C` to disambiguate
84+
note: `C` could also refer to the type alias imported here
85+
--> $DIR/glob-conflict-cross-crate-3.rs:10:5
86+
|
87+
LL | use a::*;
88+
| ^^^^
89+
= help: consider adding an explicit import of `C` to disambiguate
90+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
4091

41-
For more information about this error, try `rustc --explain E0659`.

tests/ui/imports/issue-114682-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
extern crate issue_114682_2_extern;
55

66
use issue_114682_2_extern::max; //~ ERROR `max` is ambiguous
7+
//~| WARN this was previously accepted
78

89
type A = issue_114682_2_extern::max; //~ ERROR `max` is ambiguous
10+
//~| WARN this was previously accepted
911

1012
fn main() {}

tests/ui/imports/issue-114682-2.stderr

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
error[E0659]: `max` is ambiguous
1+
error: `max` is ambiguous
22
--> $DIR/issue-114682-2.rs:6:28
33
|
44
LL | use issue_114682_2_extern::max;
55
| ^^^ ambiguous name
66
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
79
= note: ambiguous because of multiple glob imports of a name in the same module
810
note: `max` could refer to the type alias defined here
911
--> $DIR/auxiliary/issue-114682-2-extern.rs:17:9
@@ -15,13 +17,16 @@ note: `max` could also refer to the module defined here
1517
|
1618
LL | pub use self::d::*;
1719
| ^^^^^^^
20+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
1821

19-
error[E0659]: `max` is ambiguous
20-
--> $DIR/issue-114682-2.rs:8:33
22+
error: `max` is ambiguous
23+
--> $DIR/issue-114682-2.rs:9:33
2124
|
2225
LL | type A = issue_114682_2_extern::max;
2326
| ^^^ ambiguous name
2427
|
28+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
29+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
2530
= note: ambiguous because of multiple glob imports of a name in the same module
2631
note: `max` could refer to the type alias defined here
2732
--> $DIR/auxiliary/issue-114682-2-extern.rs:17:9
@@ -36,4 +41,47 @@ LL | pub use self::d::*;
3641

3742
error: aborting due to 2 previous errors
3843

39-
For more information about this error, try `rustc --explain E0659`.
44+
Future incompatibility report: Future breakage diagnostic:
45+
error: `max` is ambiguous
46+
--> $DIR/issue-114682-2.rs:6:28
47+
|
48+
LL | use issue_114682_2_extern::max;
49+
| ^^^ ambiguous name
50+
|
51+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
52+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
53+
= note: ambiguous because of multiple glob imports of a name in the same module
54+
note: `max` could refer to the type alias defined here
55+
--> $DIR/auxiliary/issue-114682-2-extern.rs:17:9
56+
|
57+
LL | pub use self::e::*;
58+
| ^^^^^^^
59+
note: `max` could also refer to the module defined here
60+
--> $DIR/auxiliary/issue-114682-2-extern.rs:16:9
61+
|
62+
LL | pub use self::d::*;
63+
| ^^^^^^^
64+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
65+
66+
Future breakage diagnostic:
67+
error: `max` is ambiguous
68+
--> $DIR/issue-114682-2.rs:9:33
69+
|
70+
LL | type A = issue_114682_2_extern::max;
71+
| ^^^ ambiguous name
72+
|
73+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
74+
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
75+
= note: ambiguous because of multiple glob imports of a name in the same module
76+
note: `max` could refer to the type alias defined here
77+
--> $DIR/auxiliary/issue-114682-2-extern.rs:17:9
78+
|
79+
LL | pub use self::e::*;
80+
| ^^^^^^^
81+
note: `max` could also refer to the module defined here
82+
--> $DIR/auxiliary/issue-114682-2-extern.rs:16:9
83+
|
84+
LL | pub use self::d::*;
85+
| ^^^^^^^
86+
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
87+

tests/ui/imports/issue-114682-4.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use issue_114682_4_extern::*;
77

88
//~v ERROR type alias takes 1 generic argument but 2 generic arguments were supplied
99
fn a() -> Result<i32, ()> { //~ ERROR `Result` is ambiguous
10+
//~| WARN this was previously accepted
1011
Ok(1)
1112
}
1213

0 commit comments

Comments
 (0)