Skip to content

Commit 3735bf9

Browse files
committed
Working but not with mixed imports
1 parent a2e4ef2 commit 3735bf9

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

tests/ui/std_instead_of_core.fixed

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ fn std_instead_of_core() {
3131
ptr::read_unaligned,
3232
};
3333

34-
// Multiline mixed imports
35-
use core::{io::Write, fmt::Display};
36-
//~^ ERROR: used import from `std` instead of `core`
37-
3834
// Function calls
3935
let ptr = core::ptr::null::<u32>();
4036
//~^ ERROR: used import from `std` instead of `core`

tests/ui/std_instead_of_core.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ fn std_instead_of_core() {
3131
ptr::read_unaligned,
3232
};
3333

34-
// Multiline mixed imports
35-
use std::{io::Write, fmt::Display};
36-
//~^ ERROR: used import from `std` instead of `core`
37-
3834
// Function calls
3935
let ptr = std::ptr::null::<u32>();
4036
//~^ ERROR: used import from `std` instead of `core`

tests/ui/std_instead_of_core.stderr

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,37 @@ LL | use std::{
3232
| ^^^ help: consider importing the item from `core`: `core`
3333

3434
error: used import from `std` instead of `core`
35-
--> tests/ui/std_instead_of_core.rs:35:9
36-
|
37-
LL | use std::{io::Write, fmt::Display};
38-
| ^^^ help: consider importing the item from `core`: `core`
39-
40-
error: used import from `std` instead of `core`
41-
--> tests/ui/std_instead_of_core.rs:39:15
35+
--> tests/ui/std_instead_of_core.rs:35:15
4236
|
4337
LL | let ptr = std::ptr::null::<u32>();
4438
| ^^^ help: consider importing the item from `core`: `core`
4539

4640
error: used import from `std` instead of `core`
47-
--> tests/ui/std_instead_of_core.rs:41:21
41+
--> tests/ui/std_instead_of_core.rs:37:21
4842
|
4943
LL | let ptr_mut = ::std::ptr::null_mut::<usize>();
5044
| ^^^ help: consider importing the item from `core`: `core`
5145

5246
error: used import from `std` instead of `core`
53-
--> tests/ui/std_instead_of_core.rs:45:16
47+
--> tests/ui/std_instead_of_core.rs:41:16
5448
|
5549
LL | let cell = std::cell::Cell::new(8u32);
5650
| ^^^ help: consider importing the item from `core`: `core`
5751

5852
error: used import from `std` instead of `core`
59-
--> tests/ui/std_instead_of_core.rs:47:27
53+
--> tests/ui/std_instead_of_core.rs:43:27
6054
|
6155
LL | let cell_absolute = ::std::cell::Cell::new(8u32);
6256
| ^^^ help: consider importing the item from `core`: `core`
6357

6458
error: used import from `std` instead of `core`
65-
--> tests/ui/std_instead_of_core.rs:56:9
59+
--> tests/ui/std_instead_of_core.rs:52:9
6660
|
6761
LL | use std::iter::Iterator;
6862
| ^^^ help: consider importing the item from `core`: `core`
6963

7064
error: used import from `std` instead of `alloc`
71-
--> tests/ui/std_instead_of_core.rs:63:9
65+
--> tests/ui/std_instead_of_core.rs:59:9
7266
|
7367
LL | use std::vec;
7468
| ^^^ help: consider importing the item from `alloc`: `alloc`
@@ -77,19 +71,19 @@ LL | use std::vec;
7771
= help: to override `-D warnings` add `#[allow(clippy::std_instead_of_alloc)]`
7872

7973
error: used import from `std` instead of `alloc`
80-
--> tests/ui/std_instead_of_core.rs:65:9
74+
--> tests/ui/std_instead_of_core.rs:61:9
8175
|
8276
LL | use std::vec::Vec;
8377
| ^^^ help: consider importing the item from `alloc`: `alloc`
8478

8579
error: used import from `alloc` instead of `core`
86-
--> tests/ui/std_instead_of_core.rs:71:9
80+
--> tests/ui/std_instead_of_core.rs:67:9
8781
|
8882
LL | use alloc::slice::from_ref;
8983
| ^^^^^ help: consider importing the item from `core`: `core`
9084
|
9185
= note: `-D clippy::alloc-instead-of-core` implied by `-D warnings`
9286
= help: to override `-D warnings` add `#[allow(clippy::alloc_instead_of_core)]`
9387

94-
error: aborting due to 14 previous errors
88+
error: aborting due to 13 previous errors
9589

0 commit comments

Comments
 (0)