diff options
| author | Slanterns <slanterns.w@gmail.com> | 2024-06-07 08:37:05 +0800 |
|---|---|---|
| committer | Slanterns <slanterns.w@gmail.com> | 2024-06-07 08:37:05 +0800 |
| commit | 246d4fe79120976d484a4a57359ee951aedb4ce9 (patch) | |
| tree | 35eaee27855862c07c8a81890f304707740b7b09 | |
| parent | 16fcbd21e5a7a08deb7a8181de9894c5d620ac64 (diff) | |
| download | rust-246d4fe79120976d484a4a57359ee951aedb4ce9.tar.gz rust-246d4fe79120976d484a4a57359ee951aedb4ce9.zip | |
bless `std_instead_of_core`
| -rw-r--r-- | tests/ui/std_instead_of_core.fixed | 4 | ||||
| -rw-r--r-- | tests/ui/std_instead_of_core.rs | 2 | ||||
| -rw-r--r-- | tests/ui/std_instead_of_core.stderr | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/tests/ui/std_instead_of_core.fixed b/tests/ui/std_instead_of_core.fixed index ec4ae2ea13c..6ede7bfcd9f 100644 --- a/tests/ui/std_instead_of_core.fixed +++ b/tests/ui/std_instead_of_core.fixed @@ -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; diff --git a/tests/ui/std_instead_of_core.rs b/tests/ui/std_instead_of_core.rs index c12c459c7eb..e22b4f61f3e 100644 --- a/tests/ui/std_instead_of_core.rs +++ b/tests/ui/std_instead_of_core.rs @@ -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; diff --git a/tests/ui/std_instead_of_core.stderr b/tests/ui/std_instead_of_core.stderr index 8f920511cc5..22cb9db7050 100644 --- a/tests/ui/std_instead_of_core.stderr +++ b/tests/ui/std_instead_of_core.stderr @@ -50,6 +50,12 @@ 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 | LL | use std::iter::Iterator; @@ -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 |
