Skip to content

Commit

Permalink
Stabilize C string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillikin committed Nov 1, 2023
1 parent f2a0776 commit e3a1555
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
1 change: 0 additions & 1 deletion tests/ui/needless_raw_string.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(clippy::needless_raw_string_hashes, clippy::no_effect, unused)]
#![warn(clippy::needless_raw_strings)]
#![feature(c_str_literals)]

fn main() {
"aaa";
Expand Down
1 change: 0 additions & 1 deletion tests/ui/needless_raw_string.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(clippy::needless_raw_string_hashes, clippy::no_effect, unused)]
#![warn(clippy::needless_raw_strings)]
#![feature(c_str_literals)]

fn main() {
r#"aaa"#;
Expand Down
14 changes: 7 additions & 7 deletions tests/ui/needless_raw_string.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:6:5
--> $DIR/needless_raw_string.rs:5:5
|
LL | r#"aaa"#;
| ^^^^^^^^
Expand All @@ -13,7 +13,7 @@ LL + "aaa";
|

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:9:5
--> $DIR/needless_raw_string.rs:8:5
|
LL | br#"aaa"#;
| ^^^^^^^^^
Expand All @@ -25,7 +25,7 @@ LL + b"aaa";
|

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:12:5
--> $DIR/needless_raw_string.rs:11:5
|
LL | cr#"aaa"#;
| ^^^^^^^^^
Expand All @@ -37,7 +37,7 @@ LL + c"aaa";
|

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:16:5
--> $DIR/needless_raw_string.rs:15:5
|
LL | / r#"
LL | | a
Expand All @@ -56,7 +56,7 @@ LL ~ ";
|

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:22:5
--> $DIR/needless_raw_string.rs:21:5
|
LL | r"no hashes";
| ^^^^^^^^^^^^
Expand All @@ -68,7 +68,7 @@ LL + "no hashes";
|

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:23:5
--> $DIR/needless_raw_string.rs:22:5
|
LL | br"no hashes";
| ^^^^^^^^^^^^^
Expand All @@ -80,7 +80,7 @@ LL + b"no hashes";
|

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:24:5
--> $DIR/needless_raw_string.rs:23:5
|
LL | cr"no hashes";
| ^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion tests/ui/needless_raw_string_hashes.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(clippy::no_effect, unused)]
#![warn(clippy::needless_raw_string_hashes)]
#![feature(c_str_literals)]

fn main() {
r"\aaa";
Expand Down
1 change: 0 additions & 1 deletion tests/ui/needless_raw_string_hashes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(clippy::no_effect, unused)]
#![warn(clippy::needless_raw_string_hashes)]
#![feature(c_str_literals)]

fn main() {
r#"\aaa"#;
Expand Down
30 changes: 15 additions & 15 deletions tests/ui/needless_raw_string_hashes.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:6:5
--> $DIR/needless_raw_string_hashes.rs:5:5
|
LL | r#"\aaa"#;
| ^^^^^^^^^
Expand All @@ -13,7 +13,7 @@ LL + r"\aaa";
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:7:5
--> $DIR/needless_raw_string_hashes.rs:6:5
|
LL | r##"Hello "world"!"##;
| ^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -25,7 +25,7 @@ LL + r#"Hello "world"!"#;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:8:5
--> $DIR/needless_raw_string_hashes.rs:7:5
|
LL | r######" "### "## "# "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -37,7 +37,7 @@ LL + r####" "### "## "# "####;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:9:5
--> $DIR/needless_raw_string_hashes.rs:8:5
|
LL | r######" "aa" "# "## "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -49,7 +49,7 @@ LL + r###" "aa" "# "## "###;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:10:5
--> $DIR/needless_raw_string_hashes.rs:9:5
|
LL | br#"\aaa"#;
| ^^^^^^^^^^
Expand All @@ -61,7 +61,7 @@ LL + br"\aaa";
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:11:5
--> $DIR/needless_raw_string_hashes.rs:10:5
|
LL | br##"Hello "world"!"##;
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -73,7 +73,7 @@ LL + br#"Hello "world"!"#;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:12:5
--> $DIR/needless_raw_string_hashes.rs:11:5
|
LL | br######" "### "## "# "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -85,7 +85,7 @@ LL + br####" "### "## "# "####;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:13:5
--> $DIR/needless_raw_string_hashes.rs:12:5
|
LL | br######" "aa" "# "## "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -97,7 +97,7 @@ LL + br###" "aa" "# "## "###;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:14:5
--> $DIR/needless_raw_string_hashes.rs:13:5
|
LL | cr#"\aaa"#;
| ^^^^^^^^^^
Expand All @@ -109,7 +109,7 @@ LL + cr"\aaa";
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:15:5
--> $DIR/needless_raw_string_hashes.rs:14:5
|
LL | cr##"Hello "world"!"##;
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -121,7 +121,7 @@ LL + cr#"Hello "world"!"#;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:16:5
--> $DIR/needless_raw_string_hashes.rs:15:5
|
LL | cr######" "### "## "# "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -133,7 +133,7 @@ LL + cr####" "### "## "# "####;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:17:5
--> $DIR/needless_raw_string_hashes.rs:16:5
|
LL | cr######" "aa" "# "## "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -145,7 +145,7 @@ LL + cr###" "aa" "# "## "###;
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:19:5
--> $DIR/needless_raw_string_hashes.rs:18:5
|
LL | / r#"
LL | | \a
Expand All @@ -164,7 +164,7 @@ LL ~ ";
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:25:5
--> $DIR/needless_raw_string_hashes.rs:24:5
|
LL | r###"rust"###;
| ^^^^^^^^^^^^^
Expand All @@ -176,7 +176,7 @@ LL + r"rust";
|

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:26:5
--> $DIR/needless_raw_string_hashes.rs:25:5
|
LL | r#"hello world"#;
| ^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit e3a1555

Please sign in to comment.