File tree Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -510,4 +510,4 @@ lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its ass
510510lint_opaque_hidden_inferred_bound_sugg = add this bound
511511
512512lint_useless_anonymous_reexport = useless anonymous re-export
513- .note = only anonymous re-exports of traits are useful, this is {$article} `${ desc} `
513+ .note = only anonymous re-exports of traits are useful, this is { $article } `{ $ desc} `
Original file line number Diff line number Diff line change @@ -1533,6 +1533,7 @@ pub struct UnusedAllocationMutDiag;
15331533
15341534#[ derive( LintDiagnostic ) ]
15351535#[ diag( lint_useless_anonymous_reexport) ]
1536+ #[ note]
15361537pub struct UselessAnonymousReexportDiag {
15371538 pub article : & ' static str ,
15381539 pub desc : & ' static str ,
Original file line number Diff line number Diff line change 1+ #![ deny( useless_anonymous_reexport) ]
2+ #![ crate_type = "rlib" ]
3+
4+ mod my_mod {
5+ pub trait Foo { }
6+ pub type TyFoo = dyn Foo ;
7+ pub struct Bar ;
8+ pub type TyBar = Bar ;
9+ }
10+
11+ pub use self :: my_mod:: Foo as _;
12+ pub use self :: my_mod:: TyFoo as _;
13+ pub use self :: my_mod:: Bar as _; //~ ERROR
14+ pub use self :: my_mod:: TyBar as _; //~ ERROR
15+ #[ allow( unused_imports) ]
16+ use self :: my_mod:: TyBar as _;
Original file line number Diff line number Diff line change 1+ error: useless anonymous re-export
2+ --> $DIR/anonymous-reexport.rs:13:1
3+ |
4+ LL | pub use self::my_mod::Bar as _;
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+ |
7+ note: the lint level is defined here
8+ --> $DIR/anonymous-reexport.rs:1:9
9+ |
10+ LL | #![deny(useless_anonymous_reexport)]
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+ error: useless anonymous re-export
14+ --> $DIR/anonymous-reexport.rs:14:1
15+ |
16+ LL | pub use self::my_mod::TyBar as _;
17+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+ error: aborting due to 2 previous errors
20+
You can’t perform that action at this time.
0 commit comments