diff options
| author | MarcusGrass <marcus.grass@protonmail.com> | 2024-03-03 17:23:11 +0100 |
|---|---|---|
| committer | MarcusGrass <marcus.grass@protonmail.com> | 2024-03-03 17:23:11 +0100 |
| commit | 3735bf93ff62eee7818852a1b31b7d75939c90db (patch) | |
| tree | a8c4add185cbae484442114c04b02ef32f5b736b | |
| parent | a2e4ef294cdf48e07eb4e159534907fba7cb951a (diff) | |
| download | rust-3735bf93ff62eee7818852a1b31b7d75939c90db.tar.gz rust-3735bf93ff62eee7818852a1b31b7d75939c90db.zip | |
Working but not with mixed imports
| -rw-r--r-- | tests/ui/std_instead_of_core.fixed | 4 | ||||
| -rw-r--r-- | tests/ui/std_instead_of_core.rs | 4 | ||||
| -rw-r--r-- | tests/ui/std_instead_of_core.stderr | 24 |
3 files changed, 9 insertions, 23 deletions
diff --git a/tests/ui/std_instead_of_core.fixed b/tests/ui/std_instead_of_core.fixed index db92f22c203..0a734a65d29 100644 --- a/tests/ui/std_instead_of_core.fixed +++ b/tests/ui/std_instead_of_core.fixed @@ -31,10 +31,6 @@ fn std_instead_of_core() { ptr::read_unaligned, }; - // Multiline mixed imports - use core::{io::Write, fmt::Display}; - //~^ ERROR: used import from `std` instead of `core` - // Function calls let ptr = core::ptr::null::<u32>(); //~^ ERROR: used import from `std` instead of `core` diff --git a/tests/ui/std_instead_of_core.rs b/tests/ui/std_instead_of_core.rs index d1281ee0758..c12c459c7eb 100644 --- a/tests/ui/std_instead_of_core.rs +++ b/tests/ui/std_instead_of_core.rs @@ -31,10 +31,6 @@ fn std_instead_of_core() { ptr::read_unaligned, }; - // Multiline mixed imports - use std::{io::Write, fmt::Display}; - //~^ ERROR: used import from `std` instead of `core` - // Function calls let ptr = std::ptr::null::<u32>(); //~^ ERROR: used import from `std` instead of `core` diff --git a/tests/ui/std_instead_of_core.stderr b/tests/ui/std_instead_of_core.stderr index 35bc6993b01..ee42b474a32 100644 --- a/tests/ui/std_instead_of_core.stderr +++ b/tests/ui/std_instead_of_core.stderr @@ -32,43 +32,37 @@ LL | use std::{ | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:35:9 - | -LL | use std::{io::Write, fmt::Display}; - | ^^^ help: consider importing the item from `core`: `core` - -error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:39:15 + --> tests/ui/std_instead_of_core.rs:35:15 | LL | let ptr = std::ptr::null::<u32>(); | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:41:21 + --> tests/ui/std_instead_of_core.rs:37:21 | LL | let ptr_mut = ::std::ptr::null_mut::<usize>(); | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `core` - --> tests/ui/std_instead_of_core.rs:45:16 + --> tests/ui/std_instead_of_core.rs:41:16 | LL | let cell = 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:47:27 + --> tests/ui/std_instead_of_core.rs:43:27 | 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:56:9 + --> tests/ui/std_instead_of_core.rs:52:9 | LL | use std::iter::Iterator; | ^^^ help: consider importing the item from `core`: `core` error: used import from `std` instead of `alloc` - --> tests/ui/std_instead_of_core.rs:63:9 + --> tests/ui/std_instead_of_core.rs:59:9 | LL | use std::vec; | ^^^ help: consider importing the item from `alloc`: `alloc` @@ -77,13 +71,13 @@ LL | use std::vec; = help: to override `-D warnings` add `#[allow(clippy::std_instead_of_alloc)]` error: used import from `std` instead of `alloc` - --> tests/ui/std_instead_of_core.rs:65:9 + --> tests/ui/std_instead_of_core.rs:61:9 | LL | use std::vec::Vec; | ^^^ help: consider importing the item from `alloc`: `alloc` error: used import from `alloc` instead of `core` - --> tests/ui/std_instead_of_core.rs:71:9 + --> tests/ui/std_instead_of_core.rs:67:9 | LL | use alloc::slice::from_ref; | ^^^^^ help: consider importing the item from `core`: `core` @@ -91,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 14 previous errors +error: aborting due to 13 previous errors |
