forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow-one-hash-in-raw-strings option of needless_raw_string_hash…
…es was ignored Fixes: rust-lang/rust-clippy#11481 changelog: Fix `allow-one-hash-in-raw-strings` option of [`needless_raw_string_hashes`] was ignored
- Loading branch information
Showing
5 changed files
with
63 additions
and
2 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
1 change: 1 addition & 0 deletions
1
tests/ui-toml/needless_raw_string_hashes_one_allowed/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 |
---|---|---|
@@ -0,0 +1 @@ | ||
allow-one-hash-in-raw-strings = true |
9 changes: 9 additions & 0 deletions
9
tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.fixed
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,9 @@ | ||
#![allow(clippy::no_effect, unused)] | ||
#![warn(clippy::needless_raw_string_hashes)] | ||
|
||
fn main() { | ||
r#"\aaa"#; | ||
r#"\aaa"#; | ||
r#"Hello "world"!"#; | ||
r####" "### "## "# "####; | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![allow(clippy::no_effect, unused)] | ||
#![warn(clippy::needless_raw_string_hashes)] | ||
|
||
fn main() { | ||
r#"\aaa"#; | ||
r##"\aaa"##; | ||
r##"Hello "world"!"##; | ||
r######" "### "## "# "######; | ||
} |
40 changes: 40 additions & 0 deletions
40
tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.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: unnecessary hashes around raw string literal | ||
--> tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs:6:5 | ||
| | ||
LL | r##"\aaa"##; | ||
| ^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::needless-raw-string-hashes` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::needless_raw_string_hashes)]` | ||
help: remove one hash from both sides of the string literal | ||
| | ||
LL - r##"\aaa"##; | ||
LL + r#"\aaa"#; | ||
| | ||
|
||
error: unnecessary hashes around raw string literal | ||
--> tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs:7:5 | ||
| | ||
LL | r##"Hello "world"!"##; | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
help: remove one hash from both sides of the string literal | ||
| | ||
LL - r##"Hello "world"!"##; | ||
LL + r#"Hello "world"!"#; | ||
| | ||
|
||
error: unnecessary hashes around raw string literal | ||
--> tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs:8:5 | ||
| | ||
LL | r######" "### "## "# "######; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
help: remove 2 hashes from both sides of the string literal | ||
| | ||
LL - r######" "### "## "# "######; | ||
LL + r####" "### "## "# "####; | ||
| | ||
|
||
error: aborting due to 3 previous errors | ||
|