summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/string_slice.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/string_slice.rs')
-rw-r--r--src/tools/clippy/tests/ui/string_slice.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/string_slice.rs b/src/tools/clippy/tests/ui/string_slice.rs
index be4dfc881..440a86b10 100644
--- a/src/tools/clippy/tests/ui/string_slice.rs
+++ b/src/tools/clippy/tests/ui/string_slice.rs
@@ -3,8 +3,12 @@
fn main() {
&"Ölkanne"[1..];
+ //~^ ERROR: indexing into a string may panic if the index is within a UTF-8 character
+ //~| NOTE: `-D clippy::string-slice` implied by `-D warnings`
let m = "Mötörhead";
&m[2..5];
+ //~^ ERROR: indexing into a string may panic if the index is within a UTF-8 character
let s = String::from(m);
&s[0..2];
+ //~^ ERROR: indexing into a string may panic if the index is within a UTF-8 character
}