Skip to content

Commit 1e68973

Browse files
committed
Auto merge of rust-lang#10067 - chansuke:issue-7943, r=giraffate
Add 2018/2021 edition tests for wildcard_imports Fixes rust-lang#7943 --- changelog: none <!-- changelog_checked -->
2 parents 09cfcaf + 033f1ec commit 1e68973

9 files changed

+1138
-23
lines changed

tests/ui/wildcard_imports.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// the 2015 edition here is needed because edition 2018 changed the module system
66
// (see https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html) which means the lint
77
// no longer detects some of the cases starting with Rust 2018.
8-
// FIXME: We should likely add another edition 2021 test case for this lint
98

109
#![warn(clippy::wildcard_imports)]
1110
#![allow(unused, clippy::unnecessary_wraps, clippy::let_unit_value)]

tests/ui/wildcard_imports.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// the 2015 edition here is needed because edition 2018 changed the module system
66
// (see https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html) which means the lint
77
// no longer detects some of the cases starting with Rust 2018.
8-
// FIXME: We should likely add another edition 2021 test case for this lint
98

109
#![warn(clippy::wildcard_imports)]
1110
#![allow(unused, clippy::unnecessary_wraps, clippy::let_unit_value)]

tests/ui/wildcard_imports.stderr

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,129 @@
11
error: usage of wildcard import
2-
--> $DIR/wildcard_imports.rs:16:5
2+
--> $DIR/wildcard_imports.rs:15:5
33
|
44
LL | use crate::fn_mod::*;
55
| ^^^^^^^^^^^^^^^^ help: try: `crate::fn_mod::foo`
66
|
77
= note: `-D clippy::wildcard-imports` implied by `-D warnings`
88

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

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

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

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

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

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

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

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

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

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

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

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

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

8787
error: usage of wildcard import
88-
--> $DIR/wildcard_imports.rs:160:9
88+
--> $DIR/wildcard_imports.rs:159:9
8989
|
9090
LL | use crate:: fn_mod::
9191
| _________^
9292
LL | | *;
9393
| |_________^ help: try: `crate:: fn_mod::foo`
9494

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

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

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

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

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

125125
error: usage of wildcard import
126-
--> $DIR/wildcard_imports.rs:240:13
126+
--> $DIR/wildcard_imports.rs:239:13
127127
|
128128
LL | use super::*;
129129
| ^^^^^^^^ help: try: `super::foofoo`

0 commit comments

Comments
 (0)