diff options
| author | bors <bors@rust-lang.org> | 2023-04-07 00:14:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-07 00:14:45 +0000 |
| commit | 9408d013e3902c4d268a02e3205df6d0f8289e65 (patch) | |
| tree | 119e4887eead973296685d0202944594af900dd0 /tests | |
| parent | de5c6d6b1ed50246cf3d5c93b8d6e0b467dfbddf (diff) | |
| parent | a2165533e1b5797e1043b961b4d5aaa599e8a305 (diff) | |
| download | rust-9408d013e3902c4d268a02e3205df6d0f8289e65.tar.gz rust-9408d013e3902c4d268a02e3205df6d0f8289e65.zip | |
Auto merge of #10566 - ebobrow:iss10549, r=giraffate
fix `single_component_path_imports` FP on `self::<import>::..` fixes #10549 I noticed that a couple functions in the file I was working on took `cx` as a parameter but didn't use them, so I removed that. Can revert if desired because it isn't related to my changes. changelog: [`single_component_path_imports`] don't suggest removing import when it is used as `self::<import>::..`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/single_component_path_imports.fixed | 6 | ||||
| -rw-r--r-- | tests/ui/single_component_path_imports.rs | 6 | ||||
| -rw-r--r-- | tests/ui/single_component_path_imports.stderr | 4 |
3 files changed, 14 insertions, 2 deletions
diff --git a/tests/ui/single_component_path_imports.fixed b/tests/ui/single_component_path_imports.fixed index 4c40739d6f5..8c96c4715d3 100644 --- a/tests/ui/single_component_path_imports.fixed +++ b/tests/ui/single_component_path_imports.fixed @@ -2,9 +2,11 @@ #![warn(clippy::single_component_path_imports)] #![allow(unused_imports)] +use core; use serde as edres; pub use serde; +use std; macro_rules! m { () => { @@ -17,6 +19,10 @@ fn main() { // False positive #5154, shouldn't trigger lint. m!(); + + // False positive #10549 + let _ = self::std::io::stdout(); + let _ = 0 as self::core::ffi::c_uint; } mod hello_mod { diff --git a/tests/ui/single_component_path_imports.rs b/tests/ui/single_component_path_imports.rs index 9280bab3c71..8434bf7eaf1 100644 --- a/tests/ui/single_component_path_imports.rs +++ b/tests/ui/single_component_path_imports.rs @@ -2,9 +2,11 @@ #![warn(clippy::single_component_path_imports)] #![allow(unused_imports)] +use core; use regex; use serde as edres; pub use serde; +use std; macro_rules! m { () => { @@ -17,6 +19,10 @@ fn main() { // False positive #5154, shouldn't trigger lint. m!(); + + // False positive #10549 + let _ = self::std::io::stdout(); + let _ = 0 as self::core::ffi::c_uint; } mod hello_mod { diff --git a/tests/ui/single_component_path_imports.stderr b/tests/ui/single_component_path_imports.stderr index 71dcc25d6e5..d69a86470a5 100644 --- a/tests/ui/single_component_path_imports.stderr +++ b/tests/ui/single_component_path_imports.stderr @@ -1,5 +1,5 @@ error: this import is redundant - --> $DIR/single_component_path_imports.rs:5:1 + --> $DIR/single_component_path_imports.rs:6:1 | LL | use regex; | ^^^^^^^^^^ help: remove it entirely @@ -7,7 +7,7 @@ LL | use regex; = note: `-D clippy::single-component-path-imports` implied by `-D warnings` error: this import is redundant - --> $DIR/single_component_path_imports.rs:23:5 + --> $DIR/single_component_path_imports.rs:29:5 | LL | use regex; | ^^^^^^^^^^ help: remove it entirely |
