-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Add import_rename lint, this adds a field on the Conf struct
- Loading branch information
Showing
4 changed files
with
37 additions
and
25 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import-renames = [ | ||
{ path = "syn::Path", rename = "SynPath" }, | ||
{ path = "serde::Deserializer", rename = "SomethingElse" }, | ||
{ path = "serde::Serializer", rename = "DarkTower" }, | ||
{ path = "std::option::Option", rename = "Maybe" }, | ||
{ path = "std::process::Child", rename = "Kid" }, | ||
{ path = "std::process::exit", rename = "goodbye" }, | ||
{ path = "std::collections::BTreeMap", rename = "Map" }, | ||
{ path = "regex::bytes", rename = "foo" }, | ||
{ path = "std::clone", rename = "foo" }, | ||
{ path = "std::thread::sleep", rename = "thread_sleep" }, | ||
{ path = "std::any::type_name", rename = "ident" } | ||
] |
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
28 changes: 17 additions & 11 deletions
28
tests/ui-toml/toml_import_rename/conf_import_rename.stderr
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 |
---|---|---|
@@ -1,28 +1,34 @@ | ||
error: this import should be renamed | ||
--> $DIR/conf_import_rename.rs:7:1 | ||
--> $DIR/conf_import_rename.rs:5:20 | ||
| | ||
LL | use std::thread::sleep; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `use std::thread::sleep; as thread_sleep;` | ||
LL | use std::process::{exit as wrong_exit, Child as Kid}; | ||
| ^^^^^^^^^^^^^^^^^^ help: try: `exit as goodbye` | ||
| | ||
= note: `-D clippy::import-rename` implied by `-D warnings` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_import_rename.rs:9:1 | ||
--> $DIR/conf_import_rename.rs:6:1 | ||
| | ||
LL | use std::thread::sleep; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `use std::thread::sleep as thread_sleep;` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_import_rename.rs:8:11 | ||
| | ||
LL | use regex::bytes as xegersetyb; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `use regex::bytes as foo;` | ||
LL | any::{type_name, Any}, | ||
| ^^^^^^^^^ help: try: `type_name as ident` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_import_rename.rs:10:13 | ||
--> $DIR/conf_import_rename.rs:9:5 | ||
| | ||
LL | use serde::{de::Deserializer as WrongRename, ser::Serializer as DarkTower}; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `de::Deserializer as as SomethingElse` | ||
LL | clone, | ||
| ^^^^^ help: try: `clone as foo` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_import_rename.rs:15:5 | ||
--> $DIR/conf_import_rename.rs:13:5 | ||
| | ||
LL | use std::collections::BTreeMap as OopsWrongRename; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `use std::collections::BTreeMap as Map;` | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 5 previous errors | ||
|