about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlapla-cogito <me@lapla.dev>2025-02-04 12:19:04 +0900
committerlapla-cogito <me@lapla.dev>2025-02-04 12:19:04 +0900
commit4220dbd4b34f0c4cf1c9de1628c6d8b5d20bfd99 (patch)
treece360b12643fc6118b31b2a0edbe82f99a7cf0e3
parent2c51951dba9ccd716f3cfd1a629db40d4c2beb35 (diff)
downloadrust-4220dbd4b34f0c4cf1c9de1628c6d8b5d20bfd99.tar.gz
rust-4220dbd4b34f0c4cf1c9de1628c6d8b5d20bfd99.zip
allow `assign_op_pattern` in the test of `string_add`
-rw-r--r--tests/ui/string_add.rs2
-rw-r--r--tests/ui/string_add.stderr17
2 files changed, 2 insertions, 17 deletions
diff --git a/tests/ui/string_add.rs b/tests/ui/string_add.rs
index c535f2ebbfc..61c812f16c8 100644
--- a/tests/ui/string_add.rs
+++ b/tests/ui/string_add.rs
@@ -4,7 +4,7 @@ extern crate proc_macros;
 use proc_macros::external;
 
 #[warn(clippy::string_add)]
-#[allow(clippy::string_add_assign, unused)]
+#[allow(clippy::assign_op_pattern, clippy::string_add_assign, unused)]
 fn main() {
     // ignores assignment distinction
     let mut x = String::new();
diff --git a/tests/ui/string_add.stderr b/tests/ui/string_add.stderr
index fe6849b894b..74ff7372e21 100644
--- a/tests/ui/string_add.stderr
+++ b/tests/ui/string_add.stderr
@@ -1,12 +1,3 @@
-error: manual implementation of an assign operation
-  --> tests/ui/string_add.rs:13:9
-   |
-LL |         x = x + ".";
-   |         ^^^^^^^^^^^ help: replace it with: `x += "."`
-   |
-   = note: `-D clippy::assign-op-pattern` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::assign_op_pattern)]`
-
 error: you added something to a string. Consider using `String::push_str()` instead
   --> tests/ui/string_add.rs:13:13
    |
@@ -22,11 +13,5 @@ error: you added something to a string. Consider using `String::push_str()` inst
 LL |     let z = y + "...";
    |             ^^^^^^^^^
 
-error: manual implementation of an assign operation
-  --> tests/ui/string_add.rs:22:5
-   |
-LL |     x = x + 1;
-   |     ^^^^^^^^^ help: replace it with: `x += 1`
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors