This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
src/tools/clippy/tests/ui Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ fn std_instead_of_core() {
4545
4646 let _ = std::env!("PATH");
4747
48- // do not lint until `error_in_core` is stable
49- use std::error::Error;
48+ use core::error::Error;
49+ //~^ ERROR: used import from `std` instead of `core`
5050
5151 // lint items re-exported from private modules, `core::iter::traits::iterator::Iterator`
5252 use core::iter::Iterator;
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ fn std_instead_of_core() {
4545
4646 let _ = std:: env!( "PATH" ) ;
4747
48- // do not lint until `error_in_core` is stable
4948 use std:: error:: Error ;
49+ //~^ ERROR: used import from `std` instead of `core`
5050
5151 // lint items re-exported from private modules, `core::iter::traits::iterator::Iterator`
5252 use std:: iter:: Iterator ;
Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ error: used import from `std` instead of `core`
4949LL | let cell_absolute = ::std::cell::Cell::new(8u32);
5050 | ^^^ help: consider importing the item from `core`: `core`
5151
52+ error: used import from `std` instead of `core`
53+ --> tests/ui/std_instead_of_core.rs:48:9
54+ |
55+ LL | use std::error::Error;
56+ | ^^^ help: consider importing the item from `core`: `core`
57+
5258error: used import from `std` instead of `core`
5359 --> tests/ui/std_instead_of_core.rs:52:9
5460 |
@@ -79,5 +85,5 @@ LL | use alloc::slice::from_ref;
7985 = note: `-D clippy::alloc-instead-of-core` implied by `-D warnings`
8086 = help: to override `-D warnings` add `#[allow(clippy::alloc_instead_of_core)]`
8187
82- error: aborting due to 12 previous errors
88+ error: aborting due to 13 previous errors
8389
You can’t perform that action at this time.
0 commit comments