diff options
Diffstat (limited to 'src/test/ui/tuple/tuple-index-out-of-bounds.rs')
-rw-r--r-- | src/test/ui/tuple/tuple-index-out-of-bounds.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/tuple/tuple-index-out-of-bounds.rs b/src/test/ui/tuple/tuple-index-out-of-bounds.rs new file mode 100644 index 000000000..c772c0daa --- /dev/null +++ b/src/test/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})` +} |