Skip to content

Commit ff3bf0f

Browse files
committed
resolve: Downgrade ambiguous_glob_imports to warn-by-default
But still keep it report-in-deps. To revert after ~February 27 2026, when Rust 1.95 branches out from the main branch.
1 parent 8c52f73 commit ff3bf0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+174
-174
lines changed

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4465,7 +4465,7 @@ declare_lint! {
44654465
///
44664466
/// [future-incompatible]: ../index.md#future-incompatible-lints
44674467
pub AMBIGUOUS_GLOB_IMPORTS,
4468-
Deny,
4468+
Warn,
44694469
"detects certain glob imports that require reporting an ambiguity error",
44704470
@future_incompatible = FutureIncompatibleInfo {
44714471
reason: fcw!(FutureReleaseError #114095),

tests/ui/imports/ambiguous-10.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
2-
2+
//@ check-pass
33
mod a {
44
pub enum Token {}
55
}
@@ -13,6 +13,6 @@ mod b {
1313
use crate::a::*;
1414
use crate::b::*;
1515
fn c(_: Token) {}
16-
//~^ ERROR `Token` is ambiguous
16+
//~^ WARN `Token` is ambiguous
1717
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1818
fn main() { }

tests/ui/imports/ambiguous-10.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `Token` is ambiguous
1+
warning: `Token` is ambiguous
22
--> $DIR/ambiguous-10.rs:15:9
33
|
44
LL | fn c(_: Token) {}
@@ -19,12 +19,12 @@ note: `Token` could also refer to the enum imported here
1919
LL | use crate::b::*;
2020
| ^^^^^^^^^^^
2121
= help: consider adding an explicit import of `Token` to disambiguate
22-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
22+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
2323

24-
error: aborting due to 1 previous error
24+
warning: 1 warning emitted
2525

2626
Future incompatibility report: Future breakage diagnostic:
27-
error: `Token` is ambiguous
27+
warning: `Token` is ambiguous
2828
--> $DIR/ambiguous-10.rs:15:9
2929
|
3030
LL | fn c(_: Token) {}
@@ -45,5 +45,5 @@ note: `Token` could also refer to the enum imported here
4545
LL | use crate::b::*;
4646
| ^^^^^^^^^^^
4747
= help: consider adding an explicit import of `Token` to disambiguate
48-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
48+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
4949

tests/ui/imports/ambiguous-12.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
2-
2+
//@ check-pass
33
macro_rules! m {
44
() => {
55
pub fn b() {}
@@ -19,6 +19,6 @@ use crate::public::*;
1919

2020
fn main() {
2121
b();
22-
//~^ ERROR `b` is ambiguous
22+
//~^ WARN `b` is ambiguous
2323
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2424
}

tests/ui/imports/ambiguous-12.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `b` is ambiguous
1+
warning: `b` is ambiguous
22
--> $DIR/ambiguous-12.rs:21:5
33
|
44
LL | b();
@@ -19,12 +19,12 @@ note: `b` could also refer to the function imported here
1919
LL | use crate::public::*;
2020
| ^^^^^^^^^^^^^^^^
2121
= help: consider adding an explicit import of `b` to disambiguate
22-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
22+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
2323

24-
error: aborting due to 1 previous error
24+
warning: 1 warning emitted
2525

2626
Future incompatibility report: Future breakage diagnostic:
27-
error: `b` is ambiguous
27+
warning: `b` is ambiguous
2828
--> $DIR/ambiguous-12.rs:21:5
2929
|
3030
LL | b();
@@ -45,5 +45,5 @@ note: `b` could also refer to the function imported here
4545
LL | use crate::public::*;
4646
| ^^^^^^^^^^^^^^^^
4747
= help: consider adding an explicit import of `b` to disambiguate
48-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
48+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
4949

tests/ui/imports/ambiguous-13.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
2-
2+
//@ check-pass
33
pub mod object {
44
#[derive(Debug)]
55
pub struct Rect;
@@ -16,6 +16,6 @@ use crate::object::*;
1616
use crate::content::*;
1717

1818
fn a(_: Rect) {}
19-
//~^ ERROR `Rect` is ambiguous
19+
//~^ WARN `Rect` is ambiguous
2020
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2121
fn main() { }

tests/ui/imports/ambiguous-13.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `Rect` is ambiguous
1+
warning: `Rect` is ambiguous
22
--> $DIR/ambiguous-13.rs:18:9
33
|
44
LL | fn a(_: Rect) {}
@@ -19,12 +19,12 @@ note: `Rect` could also refer to the struct imported here
1919
LL | use crate::content::*;
2020
| ^^^^^^^^^^^^^^^^^
2121
= help: consider adding an explicit import of `Rect` to disambiguate
22-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
22+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
2323

24-
error: aborting due to 1 previous error
24+
warning: 1 warning emitted
2525

2626
Future incompatibility report: Future breakage diagnostic:
27-
error: `Rect` is ambiguous
27+
warning: `Rect` is ambiguous
2828
--> $DIR/ambiguous-13.rs:18:9
2929
|
3030
LL | fn a(_: Rect) {}
@@ -45,5 +45,5 @@ note: `Rect` could also refer to the struct imported here
4545
LL | use crate::content::*;
4646
| ^^^^^^^^^^^^^^^^^
4747
= help: consider adding an explicit import of `Rect` to disambiguate
48-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
48+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
4949

tests/ui/imports/ambiguous-14.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ edition:2015
22
// https://github.com/rust-lang/rust/issues/98467
3-
3+
//@ check-pass
44
mod a {
55
pub fn foo() {}
66
}
@@ -21,6 +21,6 @@ mod g {
2121

2222
fn main() {
2323
g::foo();
24-
//~^ ERROR `foo` is ambiguous
24+
//~^ WARN `foo` is ambiguous
2525
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2626
}

tests/ui/imports/ambiguous-14.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `foo` is ambiguous
1+
warning: `foo` is ambiguous
22
--> $DIR/ambiguous-14.rs:23:8
33
|
44
LL | g::foo();
@@ -19,12 +19,12 @@ note: `foo` could also refer to the function imported here
1919
LL | pub use f::*;
2020
| ^^^^
2121
= help: consider adding an explicit import of `foo` to disambiguate
22-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
22+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
2323

24-
error: aborting due to 1 previous error
24+
warning: 1 warning emitted
2525

2626
Future incompatibility report: Future breakage diagnostic:
27-
error: `foo` is ambiguous
27+
warning: `foo` is ambiguous
2828
--> $DIR/ambiguous-14.rs:23:8
2929
|
3030
LL | g::foo();
@@ -45,5 +45,5 @@ note: `foo` could also refer to the function imported here
4545
LL | pub use f::*;
4646
| ^^^^
4747
= help: consider adding an explicit import of `foo` to disambiguate
48-
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
48+
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
4949

tests/ui/imports/ambiguous-15.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
2-
2+
//@ check-pass
33
mod t2 {
44
#[derive(Debug)]
55
pub enum Error {}
@@ -20,7 +20,7 @@ mod t3 {
2020

2121
use self::t3::*;
2222
fn a<E: Error>(_: E) {}
23-
//~^ ERROR `Error` is ambiguous
23+
//~^ WARN `Error` is ambiguous
2424
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2525

2626
fn main() {}

0 commit comments

Comments
 (0)