forked from rust-lang/rust
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#54173 - phansch:suggest_valid_crate_type, r…
…=estebank Suggest valid crate type if invalid crate type is found This adds a suggestion to the `invalid_crate_types` lint. The suggestion is based on the Levenshtein distance to existing crate types. If no suggestion is found it will show the lint without any suggestions. Closes rust-lang#53958
- Loading branch information
Showing
4 changed files
with
143 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,58 @@ | ||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:12:1 | ||
--> $DIR/invalid-crate-type.rs:12:15 | ||
| | ||
LL | #![crate_type="foo"] //~ ERROR invalid `crate_type` value | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^ | ||
| | ||
= note: #[deny(unknown_crate_types)] on by default | ||
|
||
error: aborting due to previous error | ||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:16:15 | ||
| | ||
LL | #![crate_type="statoclib"] | ||
| ^^^^^^^^^^^ help: did you mean: `"staticlib"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:21:15 | ||
| | ||
LL | #![crate_type="procmacro"] | ||
| ^^^^^^^^^^^ help: did you mean: `"proc-macro"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:26:15 | ||
| | ||
LL | #![crate_type="static-lib"] | ||
| ^^^^^^^^^^^^ help: did you mean: `"staticlib"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:31:15 | ||
| | ||
LL | #![crate_type="drylib"] | ||
| ^^^^^^^^ help: did you mean: `"dylib"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:36:15 | ||
| | ||
LL | #![crate_type="dlib"] | ||
| ^^^^^^ help: did you mean: `"rlib"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:41:15 | ||
| | ||
LL | #![crate_type="lob"] | ||
| ^^^^^ help: did you mean: `"lib"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:46:15 | ||
| | ||
LL | #![crate_type="bon"] | ||
| ^^^^^ help: did you mean: `"bin"` | ||
|
||
error: invalid `crate_type` value | ||
--> $DIR/invalid-crate-type.rs:51:15 | ||
| | ||
LL | #![crate_type="cdalib"] | ||
| ^^^^^^^^ help: did you mean: `"cdylib"` | ||
|
||
error: aborting due to 9 previous errors | ||
|