Skip to content

Commit

Permalink
Auto merge of rust-lang#10067 - chansuke:issue-7943, r=giraffate
Browse files Browse the repository at this point in the history
Add 2018/2021 edition tests for wildcard_imports

Fixes rust-lang#7943

---

changelog: none
<!-- changelog_checked -->
  • Loading branch information
bors committed Dec 20, 2022
2 parents 09cfcaf + 033f1ec commit 1e68973
Show file tree
Hide file tree
Showing 9 changed files with 1,138 additions and 23 deletions.
1 change: 0 additions & 1 deletion tests/ui/wildcard_imports.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// the 2015 edition here is needed because edition 2018 changed the module system
// (see https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html) which means the lint
// no longer detects some of the cases starting with Rust 2018.
// FIXME: We should likely add another edition 2021 test case for this lint

#![warn(clippy::wildcard_imports)]
#![allow(unused, clippy::unnecessary_wraps, clippy::let_unit_value)]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/wildcard_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// the 2015 edition here is needed because edition 2018 changed the module system
// (see https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html) which means the lint
// no longer detects some of the cases starting with Rust 2018.
// FIXME: We should likely add another edition 2021 test case for this lint

#![warn(clippy::wildcard_imports)]
#![allow(unused, clippy::unnecessary_wraps, clippy::let_unit_value)]
Expand Down
42 changes: 21 additions & 21 deletions tests/ui/wildcard_imports.stderr
Original file line number Diff line number Diff line change
@@ -1,129 +1,129 @@
error: usage of wildcard import
--> $DIR/wildcard_imports.rs:16:5
--> $DIR/wildcard_imports.rs:15:5
|
LL | use crate::fn_mod::*;
| ^^^^^^^^^^^^^^^^ help: try: `crate::fn_mod::foo`
|
= note: `-D clippy::wildcard-imports` implied by `-D warnings`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:17:5
--> $DIR/wildcard_imports.rs:16:5
|
LL | use crate::mod_mod::*;
| ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:18:5
--> $DIR/wildcard_imports.rs:17:5
|
LL | use crate::multi_fn_mod::*;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:20:5
--> $DIR/wildcard_imports.rs:19:5
|
LL | use crate::struct_mod::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:24:5
--> $DIR/wildcard_imports.rs:23:5
|
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:25:5
--> $DIR/wildcard_imports.rs:24:5
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:96:13
--> $DIR/wildcard_imports.rs:95:13
|
LL | use crate::fn_mod::*;
| ^^^^^^^^^^^^^^^^ help: try: `crate::fn_mod::foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:102:75
--> $DIR/wildcard_imports.rs:101:75
|
LL | use wildcard_imports_helper::inner::inner_for_self_import::{self, *};
| ^ help: try: `inner_extern_foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:103:13
--> $DIR/wildcard_imports.rs:102:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:114:20
--> $DIR/wildcard_imports.rs:113:20
|
LL | use self::{inner::*, inner2::*};
| ^^^^^^^^ help: try: `inner::inner_foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:114:30
--> $DIR/wildcard_imports.rs:113:30
|
LL | use self::{inner::*, inner2::*};
| ^^^^^^^^^ help: try: `inner2::inner_bar`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:121:13
--> $DIR/wildcard_imports.rs:120:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:150:9
--> $DIR/wildcard_imports.rs:149:9
|
LL | use crate::in_fn_test::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:159:9
--> $DIR/wildcard_imports.rs:158:9
|
LL | use crate:: in_fn_test:: * ;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:160:9
--> $DIR/wildcard_imports.rs:159:9
|
LL | use crate:: fn_mod::
| _________^
LL | | *;
| |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:171:13
--> $DIR/wildcard_imports.rs:170:13
|
LL | use super::*;
| ^^^^^^^^ help: try: `super::foofoo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:206:17
--> $DIR/wildcard_imports.rs:205:17
|
LL | use super::*;
| ^^^^^^^^ help: try: `super::insidefoo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:214:13
--> $DIR/wildcard_imports.rs:213:13
|
LL | use super_imports::*;
| ^^^^^^^^^^^^^^^^ help: try: `super_imports::foofoo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:223:17
--> $DIR/wildcard_imports.rs:222:17
|
LL | use super::super::*;
| ^^^^^^^^^^^^^^^ help: try: `super::super::foofoo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:232:13
--> $DIR/wildcard_imports.rs:231:13
|
LL | use super::super::super_imports::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `super::super::super_imports::foofoo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:240:13
--> $DIR/wildcard_imports.rs:239:13
|
LL | use super::*;
| ^^^^^^^^ help: try: `super::foofoo`
Expand Down

0 comments on commit 1e68973

Please sign in to comment.