diff options
Diffstat (limited to 'tests/ui/imports')
-rw-r--r-- | tests/ui/imports/ambiguous-9.stderr | 1 | ||||
-rw-r--r-- | tests/ui/imports/issue-28134.stderr | 5 | ||||
-rw-r--r-- | tests/ui/imports/issue-55457.stderr | 2 | ||||
-rw-r--r-- | tests/ui/imports/issue-56125.stderr | 12 | ||||
-rw-r--r-- | tests/ui/imports/pub-reexport-empty.rs | 25 | ||||
-rw-r--r-- | tests/ui/imports/pub-reexport-empty.stderr | 20 | ||||
-rw-r--r-- | tests/ui/imports/reexports.rs | 5 | ||||
-rw-r--r-- | tests/ui/imports/reexports.stderr | 34 |
8 files changed, 84 insertions, 20 deletions
diff --git a/tests/ui/imports/ambiguous-9.stderr b/tests/ui/imports/ambiguous-9.stderr index 6c7d79174..2731ed2ba 100644 --- a/tests/ui/imports/ambiguous-9.stderr +++ b/tests/ui/imports/ambiguous-9.stderr @@ -60,6 +60,7 @@ note: `date_range` could also refer to the function imported here LL | use prelude::*; | ^^^^^^^^^^ = help: consider adding an explicit import of `date_range` to disambiguate + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` warning: 4 warnings emitted diff --git a/tests/ui/imports/issue-28134.stderr b/tests/ui/imports/issue-28134.stderr index 33cb53f20..5315c2e9f 100644 --- a/tests/ui/imports/issue-28134.stderr +++ b/tests/ui/imports/issue-28134.stderr @@ -14,8 +14,9 @@ LL | #![test] | help: perhaps you meant to use an outer attribute | -LL | #[test] - | ~~~~~~~ +LL - #![test] +LL + #[test] + | error: aborting due to 2 previous errors diff --git a/tests/ui/imports/issue-55457.stderr b/tests/ui/imports/issue-55457.stderr index 788fcc830..30d237365 100644 --- a/tests/ui/imports/issue-55457.stderr +++ b/tests/ui/imports/issue-55457.stderr @@ -38,6 +38,7 @@ LL | #[derive(NonExistent)] | ^^^^^^^^^^^ | = note: import resolution is stuck, try simplifying macro imports + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: cannot determine resolution for the derive macro `NonExistent` --> $DIR/issue-55457.rs:5:10 @@ -46,6 +47,7 @@ LL | #[derive(NonExistent)] | ^^^^^^^^^^^ | = note: import resolution is stuck, try simplifying macro imports + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 6 previous errors diff --git a/tests/ui/imports/issue-56125.stderr b/tests/ui/imports/issue-56125.stderr index 15477fb6f..d2a0f436c 100644 --- a/tests/ui/imports/issue-56125.stderr +++ b/tests/ui/imports/issue-56125.stderr @@ -6,14 +6,14 @@ LL | use empty::issue_56125; | help: consider importing one of these items instead | +LL | use ::issue_56125::issue_56125; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | use ::issue_56125::last_segment::issue_56125; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | use ::issue_56125::non_last_segment::non_last_segment::issue_56125; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LL | use crate::m3::last_segment::issue_56125; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | use crate::m3::non_last_segment::non_last_segment::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | use issue_56125::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~ -LL | use issue_56125::last_segment::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and 1 other candidate error[E0659]: `issue_56125` is ambiguous diff --git a/tests/ui/imports/pub-reexport-empty.rs b/tests/ui/imports/pub-reexport-empty.rs new file mode 100644 index 000000000..2a46f4c8d --- /dev/null +++ b/tests/ui/imports/pub-reexport-empty.rs @@ -0,0 +1,25 @@ +#![deny(unused_imports)] + +mod a {} + +pub use a::*; +//~^ ERROR: unused import: `a::*` + +mod b { + mod c { + #[derive(Clone)] + pub struct D; + } + pub use self::c::*; // don't show unused import lint +} + +pub use b::*; // don't show unused import lint + +mod d { + const D: i32 = 1; +} + +pub use d::*; +//~^ ERROR: unused import: `d::*` + +fn main() {} diff --git a/tests/ui/imports/pub-reexport-empty.stderr b/tests/ui/imports/pub-reexport-empty.stderr new file mode 100644 index 000000000..813b2ef71 --- /dev/null +++ b/tests/ui/imports/pub-reexport-empty.stderr @@ -0,0 +1,20 @@ +error: unused import: `a::*` + --> $DIR/pub-reexport-empty.rs:5:9 + | +LL | pub use a::*; + | ^^^^ + | +note: the lint level is defined here + --> $DIR/pub-reexport-empty.rs:1:9 + | +LL | #![deny(unused_imports)] + | ^^^^^^^^^^^^^^ + +error: unused import: `d::*` + --> $DIR/pub-reexport-empty.rs:22:9 + | +LL | pub use d::*; + | ^^^^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/imports/reexports.rs b/tests/ui/imports/reexports.rs index d76cc41be..cb1a3ebe1 100644 --- a/tests/ui/imports/reexports.rs +++ b/tests/ui/imports/reexports.rs @@ -5,9 +5,12 @@ mod a { mod foo {} mod a { - pub use super::foo; //~ ERROR cannot be re-exported + pub use super::foo; + //~^ ERROR cannot be re-exported + //~| WARNING unused import: `super::foo` pub use super::*; //~^ WARNING glob import doesn't reexport anything because no candidate is public enough + //~| WARNING unused import: `super::*` } } diff --git a/tests/ui/imports/reexports.stderr b/tests/ui/imports/reexports.stderr index 8cbff0ac7..401e422af 100644 --- a/tests/ui/imports/reexports.stderr +++ b/tests/ui/imports/reexports.stderr @@ -11,44 +11,44 @@ LL | pub use super::foo; | ^^^^^^^^^^ error[E0603]: module import `foo` is private - --> $DIR/reexports.rs:33:15 + --> $DIR/reexports.rs:36:15 | LL | use b::a::foo::S; | ^^^ private module import | note: the module import `foo` is defined here... - --> $DIR/reexports.rs:21:17 + --> $DIR/reexports.rs:24:17 | LL | pub use super::foo; // This is OK since the value `foo` is visible enough. | ^^^^^^^^^^ note: ...and refers to the module `foo` which is defined here - --> $DIR/reexports.rs:16:5 + --> $DIR/reexports.rs:19:5 | LL | mod foo { | ^^^^^^^ error[E0603]: module import `foo` is private - --> $DIR/reexports.rs:34:15 + --> $DIR/reexports.rs:37:15 | LL | use b::b::foo::S as T; | ^^^ private module import | note: the module import `foo` is defined here... - --> $DIR/reexports.rs:26:17 + --> $DIR/reexports.rs:29:17 | LL | pub use super::*; // This is also OK since the value `foo` is visible enough. | ^^^^^^^^ note: ...and refers to the module `foo` which is defined here - --> $DIR/reexports.rs:16:5 + --> $DIR/reexports.rs:19:5 | LL | mod foo { | ^^^^^^^ -warning: glob import doesn't reexport anything because no candidate is public enough - --> $DIR/reexports.rs:9:17 +warning: unused import: `super::foo` + --> $DIR/reexports.rs:8:17 | -LL | pub use super::*; - | ^^^^^^^^ +LL | pub use super::foo; + | ^^^^^^^^^^ | note: the lint level is defined here --> $DIR/reexports.rs:1:9 @@ -56,7 +56,19 @@ note: the lint level is defined here LL | #![warn(unused_imports)] | ^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors; 1 warning emitted +warning: glob import doesn't reexport anything because no candidate is public enough + --> $DIR/reexports.rs:11:17 + | +LL | pub use super::*; + | ^^^^^^^^ + +warning: unused import: `super::*` + --> $DIR/reexports.rs:11:17 + | +LL | pub use super::*; + | ^^^^^^^^ + +error: aborting due to 3 previous errors; 3 warnings emitted Some errors have detailed explanations: E0364, E0603. For more information about an error, try `rustc --explain E0364`. |