about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2024-08-25 11:20:42 +0100
committerKornel <kornel@geekhood.net>2024-09-19 16:25:56 +0100
commit3dcb5a39622fe705647ea0764a355a10b6913832 (patch)
tree25eade9fd25534578ef23216f99198f7f8f05fc4 /tests
parentb0af276da341bcd3fbfe71871aeacc8650f344ed (diff)
downloadrust-3dcb5a39622fe705647ea0764a355a10b6913832.tar.gz
rust-3dcb5a39622fe705647ea0764a355a10b6913832.zip
Add str.as_str() for easy dereferencing of Box<str>
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/suggestions/remove-as_str.rs21
-rw-r--r--tests/ui/suggestions/remove-as_str.stderr27
2 files changed, 0 insertions, 48 deletions
diff --git a/tests/ui/suggestions/remove-as_str.rs b/tests/ui/suggestions/remove-as_str.rs
deleted file mode 100644
index 289a784ba6a..00000000000
--- a/tests/ui/suggestions/remove-as_str.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-fn foo1(s: &str) {
-    s.as_str();
-    //~^ ERROR no method named `as_str` found
-}
-
-fn foo2<'a>(s: &'a str) {
-    s.as_str();
-    //~^ ERROR no method named `as_str` found
-}
-
-fn foo3(s: &mut str) {
-    s.as_str();
-    //~^ ERROR no method named `as_str` found
-}
-
-fn foo4(s: &&str) {
-    s.as_str();
-    //~^ ERROR no method named `as_str` found
-}
-
-fn main() {}
diff --git a/tests/ui/suggestions/remove-as_str.stderr b/tests/ui/suggestions/remove-as_str.stderr
deleted file mode 100644
index 534c497780a..00000000000
--- a/tests/ui/suggestions/remove-as_str.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0599]: no method named `as_str` found for reference `&str` in the current scope
-  --> $DIR/remove-as_str.rs:2:7
-   |
-LL |     s.as_str();
-   |      -^^^^^^-- help: remove this method call
-
-error[E0599]: no method named `as_str` found for reference `&'a str` in the current scope
-  --> $DIR/remove-as_str.rs:7:7
-   |
-LL |     s.as_str();
-   |      -^^^^^^-- help: remove this method call
-
-error[E0599]: no method named `as_str` found for mutable reference `&mut str` in the current scope
-  --> $DIR/remove-as_str.rs:12:7
-   |
-LL |     s.as_str();
-   |      -^^^^^^-- help: remove this method call
-
-error[E0599]: no method named `as_str` found for reference `&&str` in the current scope
-  --> $DIR/remove-as_str.rs:17:7
-   |
-LL |     s.as_str();
-   |      -^^^^^^-- help: remove this method call
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0599`.