about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDev381 <49997896+Dev380@users.noreply.github.com>2023-09-18 16:08:02 -0400
committerDev381 <49997896+Dev380@users.noreply.github.com>2023-09-18 16:08:02 -0400
commitf2ab16eac139522ac5a9c6606c81e5967aec6d79 (patch)
treecec91586a89838480eca282485c584aeead72c3e
parent01056c5aae63c546c3d988a0b46e502a3a2a7baf (diff)
downloadrust-f2ab16eac139522ac5a9c6606c81e5967aec6d79.tar.gz
rust-f2ab16eac139522ac5a9c6606c81e5967aec6d79.zip
Add not triggering examples to redundant_as_str test
-rw-r--r--tests/ui/redundant_as_str.fixed3
-rw-r--r--tests/ui/redundant_as_str.rs3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/redundant_as_str.fixed b/tests/ui/redundant_as_str.fixed
index f339787e689..c8e44d1c39e 100644
--- a/tests/ui/redundant_as_str.fixed
+++ b/tests/ui/redundant_as_str.fixed
@@ -3,4 +3,7 @@
 fn main() {
     let _redundant = "Hello, world!".to_owned().as_bytes();
     let _redundant = "Hello, world!".to_owned().is_empty();
+
+    let _ok = "Hello, world!".to_owned().as_bytes();
+    let _ok = "Hello, world!".to_owned().is_empty();
 }
diff --git a/tests/ui/redundant_as_str.rs b/tests/ui/redundant_as_str.rs
index 66074df83a8..e9aa8441913 100644
--- a/tests/ui/redundant_as_str.rs
+++ b/tests/ui/redundant_as_str.rs
@@ -3,4 +3,7 @@
 fn main() {
     let _redundant = "Hello, world!".to_owned().as_str().as_bytes();
     let _redundant = "Hello, world!".to_owned().as_str().is_empty();
+
+    let _ok = "Hello, world!".to_owned().as_bytes();
+    let _ok = "Hello, world!".to_owned().is_empty();
 }