summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-27842.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-27842.rs')
-rw-r--r--tests/ui/issues/issue-27842.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-27842.rs b/tests/ui/issues/issue-27842.rs
new file mode 100644
index 000000000..3bcfa1330
--- /dev/null
+++ b/tests/ui/issues/issue-27842.rs
@@ -0,0 +1,11 @@
+fn main() {
+ let tup = (0, 1, 2);
+ // the case where we show a suggestion
+ let _ = tup[0];
+ //~^ ERROR cannot index into a value of type
+
+ // the case where we show just a general hint
+ let i = 0_usize;
+ let _ = tup[i];
+ //~^ ERROR cannot index into a value of type
+}