-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
81 additions
and
68 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
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
5 changes: 3 additions & 2 deletions
5
tests/ui-toml/toml_import_rename/clippy.toml → ...issing_enforced_import_rename/clippy.toml
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,9 +1,10 @@ | ||
import-renames = [ | ||
enforced-import-renames = [ | ||
{ 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 = "std::clone", rename = "foo" }, | ||
{ path = "std::thread::sleep", rename = "thread_sleep" }, | ||
{ path = "std::any::type_name", rename = "ident" } | ||
{ path = "std::any::type_name", rename = "ident" }, | ||
{ path = "std::sync::Mutex", rename = "StdMutie" } | ||
] |
4 changes: 3 additions & 1 deletion
4
.../toml_import_rename/conf_import_rename.rs → ...me/conf_missing_enforced_import_rename.rs
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
40 changes: 40 additions & 0 deletions
40
tests/ui-toml/missing_enforced_import_rename/conf_missing_enforced_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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
error: this import should be renamed | ||
--> $DIR/conf_missing_enforced_import_rename.rs:5:20 | ||
| | ||
LL | use std::process::{exit as wrong_exit, Child as Kid}; | ||
| ^^^^^^^^^^^^^^^^^^ help: try: `exit as goodbye` | ||
| | ||
= note: `-D clippy::missing-enforced-import-renames` implied by `-D warnings` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_missing_enforced_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_missing_enforced_import_rename.rs:9:11 | ||
| | ||
LL | any::{type_name, Any}, | ||
| ^^^^^^^^^ help: try: `type_name as ident` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_missing_enforced_import_rename.rs:10:5 | ||
| | ||
LL | clone, | ||
| ^^^^^ help: try: `clone as foo` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_missing_enforced_import_rename.rs:11:5 | ||
| | ||
LL | sync :: Mutex, | ||
| ^^^^^^^^^^^^^ help: try: `sync :: Mutex as StdMutie` | ||
|
||
error: this import should be renamed | ||
--> $DIR/conf_missing_enforced_import_rename.rs:15:5 | ||
| | ||
LL | use std::collections::BTreeMap as OopsWrongRename; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `use std::collections::BTreeMap as Map` | ||
|
||
error: aborting due to 6 previous errors | ||
|
34 changes: 0 additions & 34 deletions
34
tests/ui-toml/toml_import_rename/conf_import_rename.stderr
This file was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `avoid-breaking-exported-api`, `msrv`, `blacklisted-names`, `cognitive-complexity-threshold`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `trivial-copy-size-limit`, `pass-by-value-size-limit`, `too-many-lines-threshold`, `array-size-threshold`, `vec-box-size-threshold`, `max-trait-bounds`, `max-struct-bools`, `max-fn-params-bools`, `warn-on-all-wildcard-imports`, `disallowed-methods`, `disallowed-types`, `unreadable-literal-lint-fractions`, `upper-case-acronyms-aggressive`, `cargo-ignore-publish`, `standard-macro-braces`, `import-renames`, `third-party` at line 5 column 1 | ||
error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `avoid-breaking-exported-api`, `msrv`, `blacklisted-names`, `cognitive-complexity-threshold`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `trivial-copy-size-limit`, `pass-by-value-size-limit`, `too-many-lines-threshold`, `array-size-threshold`, `vec-box-size-threshold`, `max-trait-bounds`, `max-struct-bools`, `max-fn-params-bools`, `warn-on-all-wildcard-imports`, `disallowed-methods`, `disallowed-types`, `unreadable-literal-lint-fractions`, `upper-case-acronyms-aggressive`, `cargo-ignore-publish`, `standard-macro-braces`, `enforced-import-renames`, `third-party` at line 5 column 1 | ||
|
||
error: aborting due to previous error | ||
|