about summary refs log tree commit diff
path: root/tests/ui/borrowck/index-mut-help-with-impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/index-mut-help-with-impl.rs')
-rw-r--r--tests/ui/borrowck/index-mut-help-with-impl.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/borrowck/index-mut-help-with-impl.rs b/tests/ui/borrowck/index-mut-help-with-impl.rs
new file mode 100644
index 00000000000..44b57c4a038
--- /dev/null
+++ b/tests/ui/borrowck/index-mut-help-with-impl.rs
@@ -0,0 +1,10 @@
+// When mutably indexing a type that implements `Index` and `IndexMut` but
+// `Index::index` is being used specifically, the normal special help message
+// should not mention a missing `IndexMut` impl.
+
+fn main() {
+    use std::ops::Index;
+
+    let v = String::from("dinosaur");
+    Index::index(&v, 1..2).make_ascii_uppercase(); //~ ERROR
+}