Skip to content

Commit

Permalink
Rollup merge of rust-lang#125951 - slanterns:error_in_core_stabilizat…
Browse files Browse the repository at this point in the history
…ion, r=Amanieu

Stabilize `error_in_core`

Closes: rust-lang#103765.

`@rustbot` label: +T-libs-api

r? libs-api
  • Loading branch information
fmease authored Jun 8, 2024
2 parents 127f3e1 + 246d4fe commit fe6f332
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/ui/std_instead_of_core.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/std_instead_of_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion tests/ui/std_instead_of_core.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
Expand Down Expand Up @@ -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

0 comments on commit fe6f332

Please sign in to comment.