bless std_instead_of_core
This commit is contained in:
parent
16fcbd21e5
commit
246d4fe791
@ -45,8 +45,8 @@ fn std_instead_of_core() {
|
||||
|
||||
let _ = std::env!("PATH");
|
||||
|
||||
// do not lint until `error_in_core` is stable
|
||||
use std::error::Error;
|
||||
use core::error::Error;
|
||||
//~^ ERROR: used import from `std` instead of `core`
|
||||
|
||||
// lint items re-exported from private modules, `core::iter::traits::iterator::Iterator`
|
||||
use core::iter::Iterator;
|
||||
|
@ -45,8 +45,8 @@ fn std_instead_of_core() {
|
||||
|
||||
let _ = std::env!("PATH");
|
||||
|
||||
// do not lint until `error_in_core` is stable
|
||||
use std::error::Error;
|
||||
//~^ ERROR: used import from `std` instead of `core`
|
||||
|
||||
// lint items re-exported from private modules, `core::iter::traits::iterator::Iterator`
|
||||
use std::iter::Iterator;
|
||||
|
@ -49,6 +49,12 @@ error: used import from `std` instead of `core`
|
||||
LL | let cell_absolute = ::std::cell::Cell::new(8u32);
|
||||
| ^^^ help: consider importing the item from `core`: `core`
|
||||
|
||||
error: used import from `std` instead of `core`
|
||||
--> tests/ui/std_instead_of_core.rs:48:9
|
||||
|
|
||||
LL | use std::error::Error;
|
||||
| ^^^ help: consider importing the item from `core`: `core`
|
||||
|
||||
error: used import from `std` instead of `core`
|
||||
--> tests/ui/std_instead_of_core.rs:52:9
|
||||
|
|
||||
@ -79,5 +85,5 @@ LL | use alloc::slice::from_ref;
|
||||
= note: `-D clippy::alloc-instead-of-core` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(clippy::alloc_instead_of_core)]`
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
error: aborting due to 13 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user