Skip to content

Commit

Permalink
Fix failing clippy tests
Browse files Browse the repository at this point in the history
Comments out the C string literals due to #113334

Fixes rust-lang/rust-clippy#11121
  • Loading branch information
Alexendoo committed Jul 7, 2023
1 parent fd68a6d commit cedcd39
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/incorrect_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl LateLintPass<'_> for IncorrectImpls {
cx,
hir_ty_to_ty(cx.tcx, imp.self_ty),
copy_def_id,
trait_impl.substs,
&[],
)
{
if impl_item.ident.name == sym::clone {
Expand Down
7 changes: 4 additions & 3 deletions src/tools/clippy/tests/ui/needless_raw_string.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ fn main() {
b"aaa";
br#""aaa""#;
br#"\s"#;
c"aaa";
cr#""aaa""#;
cr#"\s"#;
// currently disabled: https://github.com/rust-lang/rust/issues/113333
// cr#"aaa"#;
// cr#""aaa""#;
// cr#"\s"#;
}
7 changes: 4 additions & 3 deletions src/tools/clippy/tests/ui/needless_raw_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ fn main() {
br#"aaa"#;
br#""aaa""#;
br#"\s"#;
cr#"aaa"#;
cr#""aaa""#;
cr#"\s"#;
// currently disabled: https://github.com/rust-lang/rust/issues/113333
// cr#"aaa"#;
// cr#""aaa""#;
// cr#"\s"#;
}
8 changes: 1 addition & 7 deletions src/tools/clippy/tests/ui/needless_raw_string.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,5 @@ error: unnecessary raw string literal
LL | br#"aaa"#;
| ^^^^^^^^^ help: try: `b"aaa"`

error: unnecessary raw string literal
--> $DIR/needless_raw_string.rs:13:5
|
LL | cr#"aaa"#;
| ^^^^^^^^^ help: try: `c"aaa"`

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

9 changes: 5 additions & 4 deletions src/tools/clippy/tests/ui/needless_raw_string_hashes.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ fn main() {
br#"Hello "world"!"#;
br####" "### "## "# "####;
br###" "aa" "# "## "###;
cr#"aaa"#;
cr#"Hello "world"!"#;
cr####" "### "## "# "####;
cr###" "aa" "# "## "###;
// currently disabled: https://github.com/rust-lang/rust/issues/113333
// cr#"aaa"#;
// cr##"Hello "world"!"##;
// cr######" "### "## "# "######;
// cr######" "aa" "# "## "######;
}
9 changes: 5 additions & 4 deletions src/tools/clippy/tests/ui/needless_raw_string_hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ fn main() {
br##"Hello "world"!"##;
br######" "### "## "# "######;
br######" "aa" "# "## "######;
cr#"aaa"#;
cr##"Hello "world"!"##;
cr######" "### "## "# "######;
cr######" "aa" "# "## "######;
// currently disabled: https://github.com/rust-lang/rust/issues/113333
// cr#"aaa"#;
// cr##"Hello "world"!"##;
// cr######" "### "## "# "######;
// cr######" "aa" "# "## "######;
}
20 changes: 1 addition & 19 deletions src/tools/clippy/tests/ui/needless_raw_string_hashes.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,5 @@ error: unnecessary hashes around raw string literal
LL | br######" "aa" "# "## "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `br###" "aa" "# "## "###`

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:16:5
|
LL | cr##"Hello "world"!"##;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cr#"Hello "world"!"#`

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:17:5
|
LL | cr######" "### "## "# "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cr####" "### "## "# "####`

error: unnecessary hashes around raw string literal
--> $DIR/needless_raw_string_hashes.rs:18:5
|
LL | cr######" "aa" "# "## "######;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cr###" "aa" "# "## "###`

error: aborting due to 9 previous errors
error: aborting due to 6 previous errors

0 comments on commit cedcd39

Please sign in to comment.