diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/tuple/nested-index.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/tuple/nested-index.rs b/src/test/ui/tuple/nested-index.rs new file mode 100644 index 000000000..a3232d6fc --- /dev/null +++ b/src/test/ui/tuple/nested-index.rs @@ -0,0 +1,12 @@ +// run-pass + +fn main () { + let n = (1, (2, 3)).1.1; + assert_eq!(n, 3); + + let n = (1, (2, (3, 4))).1.1.1; + assert_eq!(n, 4); + + // This is a range expression, not nested indexing. + let _ = 0.0..1.1; +} |