File tree 4 files changed +8
-6
lines changed
tests/ui-toml/wildcard_imports
4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ impl LateLintPass<'_> for WildcardImports {
121
121
}
122
122
123
123
let module = cx. tcx . parent_module_from_def_id ( item. owner_id . def_id ) ;
124
- if cx. tcx . visibility ( item. owner_id . def_id ) != ty:: Visibility :: Restricted ( module. to_def_id ( ) ) {
124
+ if cx. tcx . visibility ( item. owner_id . def_id ) != ty:: Visibility :: Restricted ( module. to_def_id ( ) )
125
+ && !self . warn_on_all
126
+ {
125
127
return ;
126
128
}
127
129
if let ItemKind :: Use ( use_path, UseKind :: Glob ) = & item. kind
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ mod my_crate {
15
15
}
16
16
}
17
17
18
- use utils::{BAR, print};
18
+ pub use utils::{BAR, print};
19
19
//~^ ERROR: usage of wildcard import
20
20
use my_crate::utils::my_util_fn;
21
21
//~^ ERROR: usage of wildcard import
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ mod my_crate {
15
15
}
16
16
}
17
17
18
- use utils:: * ;
18
+ pub use utils:: * ;
19
19
//~^ ERROR: usage of wildcard import
20
20
use my_crate:: utils:: * ;
21
21
//~^ ERROR: usage of wildcard import
Original file line number Diff line number Diff line change 1
1
error: usage of wildcard import
2
- --> tests/ui-toml/wildcard_imports/wildcard_imports.rs:18:5
2
+ --> tests/ui-toml/wildcard_imports/wildcard_imports.rs:18:9
3
3
|
4
- LL | use utils::*;
5
- | ^^^^^^^^ help: try: `utils::{BAR, print}`
4
+ LL | pub use utils::*;
5
+ | ^^^^^^^^ help: try: `utils::{BAR, print}`
6
6
|
7
7
= note: `-D clippy::wildcard-imports` implied by `-D warnings`
8
8
= help: to override `-D warnings` add `#[allow(clippy::wildcard_imports)]`
You can’t perform that action at this time.
0 commit comments