From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/tuple/tuple-index-out-of-bounds.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/ui/tuple/tuple-index-out-of-bounds.rs (limited to 'tests/ui/tuple/tuple-index-out-of-bounds.rs') diff --git a/tests/ui/tuple/tuple-index-out-of-bounds.rs b/tests/ui/tuple/tuple-index-out-of-bounds.rs new file mode 100644 index 000000000..c772c0daa --- /dev/null +++ b/tests/ui/tuple/tuple-index-out-of-bounds.rs @@ -0,0 +1,14 @@ +struct Point(i32, i32); + +fn main() { + let origin = Point(0, 0); + origin.0; + origin.1; + origin.2; + //~^ ERROR no field `2` on type `Point` + let tuple = (0, 0); + tuple.0; + tuple.1; + tuple.2; + //~^ ERROR no field `2` on type `({integer}, {integer})` +} -- cgit v1.2.3