Skip to content
Merged
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 @@ -4465,7 +4465,7 @@ declare_lint! {
///
/// [future-incompatible]: ../index.md#future-incompatible-lints
pub AMBIGUOUS_GLOB_IMPORTS,
Deny,
Warn,
"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) {}
//~^ ERROR `Token` is ambiguous
//~^ WARN `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 @@
error: `Token` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

Future incompatibility report: Future breakage diagnostic:
error: `Token` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(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();
//~^ ERROR `b` is ambiguous
//~^ WARN `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 @@
error: `b` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

Future incompatibility report: Future breakage diagnostic:
error: `b` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(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) {}
//~^ ERROR `Rect` is ambiguous
//~^ WARN `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 @@
error: `Rect` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

Future incompatibility report: Future breakage diagnostic:
error: `Rect` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(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();
//~^ ERROR `foo` is ambiguous
//~^ WARN `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 @@
error: `foo` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

Future incompatibility report: Future breakage diagnostic:
error: `foo` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(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) {}
//~^ ERROR `Error` is ambiguous
//~^ WARN `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 @@
error: `Error` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

Future incompatibility report: Future breakage diagnostic:
error: `Error` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(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;
//~^ ERROR `ConfirmedTranscriptHashInput` is ambiguous
//~^ WARN `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 @@
error: `ConfirmedTranscriptHashInput` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

Future incompatibility report: Future breakage diagnostic:
error: `ConfirmedTranscriptHashInput` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(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();
//~^ ERROR `id` is ambiguous
//~^ WARN `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

error: `id` is ambiguous
warning: `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: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
= note: `#[warn(ambiguous_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default

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

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

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

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