Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4566,7 +4566,7 @@ declare_lint! {
///
/// [future-incompatible]: ../index.md#future-incompatible-lints
pub AMBIGUOUS_GLOB_IMPORTS,
Warn,
Deny,
"detects certain glob imports that require reporting an ambiguity error",
@future_incompatible = FutureIncompatibleInfo {
reason: fcw!(FutureReleaseError #114095),
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-10.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
//@ check-pass

mod a {
pub enum Token {}
}
Expand All @@ -13,6 +13,6 @@ mod b {
use crate::a::*;
use crate::b::*;
fn c(_: Token) {}
//~^ WARN `Token` is ambiguous
//~^ ERROR `Token` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
fn main() { }
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-10.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `Token` is ambiguous
error: `Token` is ambiguous
--> $DIR/ambiguous-10.rs:15:9
|
LL | fn c(_: Token) {}
Expand All @@ -19,12 +19,12 @@ note: `Token` could also refer to the enum imported here
LL | use crate::b::*;
| ^^^^^^^^^^^
= help: consider adding an explicit import of `Token` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

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

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-12.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
//@ check-pass

macro_rules! m {
() => {
pub fn b() {}
Expand All @@ -19,6 +19,6 @@ use crate::public::*;

fn main() {
b();
//~^ WARN `b` is ambiguous
//~^ ERROR `b` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
}
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-12.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `b` is ambiguous
error: `b` is ambiguous
--> $DIR/ambiguous-12.rs:21:5
|
LL | b();
Expand All @@ -19,12 +19,12 @@ note: `b` could also refer to the function imported here
LL | use crate::public::*;
| ^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `b` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

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

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-13.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
//@ check-pass

pub mod object {
#[derive(Debug)]
pub struct Rect;
Expand All @@ -16,6 +16,6 @@ use crate::object::*;
use crate::content::*;

fn a(_: Rect) {}
//~^ WARN `Rect` is ambiguous
//~^ ERROR `Rect` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
fn main() { }
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-13.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `Rect` is ambiguous
error: `Rect` is ambiguous
--> $DIR/ambiguous-13.rs:18:9
|
LL | fn a(_: Rect) {}
Expand All @@ -19,12 +19,12 @@ note: `Rect` could also refer to the struct imported here
LL | use crate::content::*;
| ^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `Rect` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

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

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-14.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ edition:2015
// https://github.com/rust-lang/rust/issues/98467
//@ check-pass

mod a {
pub fn foo() {}
}
Expand All @@ -21,6 +21,6 @@ mod g {

fn main() {
g::foo();
//~^ WARN `foo` is ambiguous
//~^ ERROR `foo` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
}
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-14.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `foo` is ambiguous
error: `foo` is ambiguous
--> $DIR/ambiguous-14.rs:23:8
|
LL | g::foo();
Expand All @@ -19,12 +19,12 @@ note: `foo` could also refer to the function imported here
LL | pub use f::*;
| ^^^^
= help: consider adding an explicit import of `foo` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

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

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-15.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
//@ check-pass

mod t2 {
#[derive(Debug)]
pub enum Error {}
Expand All @@ -20,7 +20,7 @@ mod t3 {

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

fn main() {}
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-15.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `Error` is ambiguous
error: `Error` is ambiguous
--> $DIR/ambiguous-15.rs:22:9
|
LL | fn a<E: Error>(_: E) {}
Expand All @@ -19,12 +19,12 @@ note: `Error` could also refer to the enum imported here
LL | pub use t2::*;
| ^^^^^
= help: consider adding an explicit import of `Error` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

Future incompatibility report: Future breakage diagnostic:
warning: `Error` is ambiguous
error: `Error` is ambiguous
--> $DIR/ambiguous-15.rs:22:9
|
LL | fn a<E: Error>(_: E) {}
Expand All @@ -45,5 +45,5 @@ note: `Error` could also refer to the enum imported here
LL | pub use t2::*;
| ^^^^^
= help: consider adding an explicit import of `Error` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-16.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://github.com/rust-lang/rust/pull/113099
//@ check-pass

mod framing {
mod public_message {
use super::*;
Expand All @@ -20,7 +20,7 @@ mod framing {
}

use crate::framing::ConfirmedTranscriptHashInput;
//~^ WARN `ConfirmedTranscriptHashInput` is ambiguous
//~^ ERROR `ConfirmedTranscriptHashInput` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

fn main() { }
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-16.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `ConfirmedTranscriptHashInput` is ambiguous
error: `ConfirmedTranscriptHashInput` is ambiguous
--> $DIR/ambiguous-16.rs:22:21
|
LL | use crate::framing::ConfirmedTranscriptHashInput;
Expand All @@ -19,12 +19,12 @@ note: `ConfirmedTranscriptHashInput` could also refer to the struct imported her
LL | pub use self::public_message_in::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

Future incompatibility report: Future breakage diagnostic:
warning: `ConfirmedTranscriptHashInput` is ambiguous
error: `ConfirmedTranscriptHashInput` is ambiguous
--> $DIR/ambiguous-16.rs:22:21
|
LL | use crate::framing::ConfirmedTranscriptHashInput;
Expand All @@ -45,5 +45,5 @@ note: `ConfirmedTranscriptHashInput` could also refer to the struct imported her
LL | pub use self::public_message_in::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-17.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ edition:2015
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
//@ check-pass

pub use evp::*; //~ WARNING ambiguous glob re-exports
pub use handwritten::*;

Expand All @@ -24,6 +24,6 @@ mod handwritten {

fn main() {
id();
//~^ WARN `id` is ambiguous
//~^ ERROR `id` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
}
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-17.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | pub use handwritten::*;
|
= note: `#[warn(ambiguous_glob_reexports)]` on by default

warning: `id` is ambiguous
error: `id` is ambiguous
--> $DIR/ambiguous-17.rs:26:5
|
LL | id();
Expand All @@ -29,12 +29,12 @@ note: `id` could also refer to the function imported here
LL | pub use handwritten::*;
| ^^^^^^^^^^^^^^
= help: consider adding an explicit import of `id` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 2 warnings emitted
error: aborting due to 1 previous error; 1 warning emitted

Future incompatibility report: Future breakage diagnostic:
warning: `id` is ambiguous
error: `id` is ambiguous
--> $DIR/ambiguous-17.rs:26:5
|
LL | id();
Expand All @@ -55,5 +55,5 @@ note: `id` could also refer to the function imported here
LL | pub use handwritten::*;
| ^^^^^^^^^^^^^^
= help: consider adding an explicit import of `id` to disambiguate
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-2.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//@ aux-build: ../ambiguous-1.rs
// https://github.com/rust-lang/rust/pull/113099#issuecomment-1633574396
//@ check-pass

extern crate ambiguous_1;

fn main() {
ambiguous_1::id(); //~ WARN `id` is ambiguous
ambiguous_1::id(); //~ ERROR `id` is ambiguous
//~| WARN this was previously accepted
}
10 changes: 5 additions & 5 deletions tests/ui/imports/ambiguous-2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: `id` is ambiguous
error: `id` is ambiguous
--> $DIR/ambiguous-2.rs:7:18
|
LL | ambiguous_1::id();
Expand All @@ -19,12 +19,12 @@ note: `id` could also refer to the function defined here
|
LL | pub use self::handwritten::*;
| ^^^^^^^^^^^^^^^^^
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

warning: 1 warning emitted
error: aborting due to 1 previous error

Future incompatibility report: Future breakage diagnostic:
warning: `id` is ambiguous
error: `id` is ambiguous
--> $DIR/ambiguous-2.rs:7:18
|
LL | ambiguous_1::id();
Expand All @@ -45,5 +45,5 @@ note: `id` could also refer to the function defined here
|
LL | pub use self::handwritten::*;
| ^^^^^^^^^^^^^^^^^
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default
= note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default

4 changes: 2 additions & 2 deletions tests/ui/imports/ambiguous-3.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// https://github.com/rust-lang/rust/issues/47525
//@ check-pass

fn main() {
use a::*;
x();
//~^ WARN `x` is ambiguous
//~^ ERROR `x` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
}

Expand Down
Loading
Loading