Skip to content

Commit 7984c30

Browse files
committed
Add test for prelude import
1 parent e75b098 commit 7984c30

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

tests/ui/wildcard_imports.fixed

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ use wildcard_imports_helper::inner::inner_for_self_import;
1818
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
1919
use wildcard_imports_helper::{ExternA, extern_foo};
2020

21+
use std::io::prelude::*;
22+
23+
struct ReadFoo;
24+
25+
impl Read for ReadFoo {
26+
fn read(&mut self, _buf: &mut [u8]) -> std::io::Result<usize> {
27+
Ok(0)
28+
}
29+
}
30+
2131
mod fn_mod {
2232
pub fn foo() {}
2333
}

tests/ui/wildcard_imports.rs

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ use wildcard_imports_helper::inner::inner_for_self_import;
1818
use wildcard_imports_helper::inner::inner_for_self_import::*;
1919
use wildcard_imports_helper::*;
2020

21+
use std::io::prelude::*;
22+
23+
struct ReadFoo;
24+
25+
impl Read for ReadFoo {
26+
fn read(&mut self, _buf: &mut [u8]) -> std::io::Result<usize> {
27+
Ok(0)
28+
}
29+
}
30+
2131
mod fn_mod {
2232
pub fn foo() {}
2333
}

tests/ui/wildcard_imports.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,43 +37,43 @@ 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:78:13
40+
--> $DIR/wildcard_imports.rs:88: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:84:75
46+
--> $DIR/wildcard_imports.rs:94: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:85:13
52+
--> $DIR/wildcard_imports.rs:95: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:96:20
58+
--> $DIR/wildcard_imports.rs:106: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:96:30
64+
--> $DIR/wildcard_imports.rs:106: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:103:13
70+
--> $DIR/wildcard_imports.rs:113: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:132:9
76+
--> $DIR/wildcard_imports.rs:142:9
7777
|
7878
LL | use crate::in_fn_test::*;
7979
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`

0 commit comments

Comments
 (0)