File tree 4 files changed +38
-1
lines changed
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
510
510
lint_opaque_hidden_inferred_bound_sugg = add this bound
511
511
512
512
lint_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;
1533
1533
1534
1534
#[ derive( LintDiagnostic ) ]
1535
1535
#[ diag( lint_useless_anonymous_reexport) ]
1536
+ #[ note]
1536
1537
pub struct UselessAnonymousReexportDiag {
1537
1538
pub article : & ' static str ,
1538
1539
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