forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#112729 - jieyouxu:unused-qualifications-sug…
…gestion, r=b-naber Add machine-applicable suggestion for `unused_qualifications` lint ``` error: unnecessary qualification --> $DIR/unused-qualifications-suggestion.rs:17:5 | LL | foo::bar(); | ^^^^^^^^ | note: the lint level is defined here --> $DIR/unused-qualifications-suggestion.rs:3:9 | LL | #![deny(unused_qualifications)] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with the unqualified path | LL | bar(); | ~~~ ``` Closes rust-lang#92198.
- Loading branch information
Showing
7 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// run-rustfix | ||
|
||
#![deny(unused_qualifications)] | ||
|
||
mod foo { | ||
pub fn bar() {} | ||
} | ||
|
||
mod baz { | ||
pub mod qux { | ||
pub fn quux() {} | ||
} | ||
} | ||
|
||
fn main() { | ||
use foo::bar; | ||
bar(); | ||
//~^ ERROR unnecessary qualification | ||
|
||
use baz::qux::quux; | ||
quux(); | ||
//~^ ERROR unnecessary qualification | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// run-rustfix | ||
|
||
#![deny(unused_qualifications)] | ||
|
||
mod foo { | ||
pub fn bar() {} | ||
} | ||
|
||
mod baz { | ||
pub mod qux { | ||
pub fn quux() {} | ||
} | ||
} | ||
|
||
fn main() { | ||
use foo::bar; | ||
foo::bar(); | ||
//~^ ERROR unnecessary qualification | ||
|
||
use baz::qux::quux; | ||
baz::qux::quux(); | ||
//~^ ERROR unnecessary qualification | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error: unnecessary qualification | ||
--> $DIR/unused-qualifications-suggestion.rs:17:5 | ||
| | ||
LL | foo::bar(); | ||
| ^^^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/unused-qualifications-suggestion.rs:3:9 | ||
| | ||
LL | #![deny(unused_qualifications)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
help: replace it with the unqualified path | ||
| | ||
LL | bar(); | ||
| ~~~ | ||
|
||
error: unnecessary qualification | ||
--> $DIR/unused-qualifications-suggestion.rs:21:5 | ||
| | ||
LL | baz::qux::quux(); | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
help: replace it with the unqualified path | ||
| | ||
LL | quux(); | ||
| ~~~~ | ||
|
||
error: aborting due to 2 previous errors | ||
|