rust/tests/ui/tuple/nested-index.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
218 B
Rust
Raw Normal View History

2020-03-26 07:17:41 +00:00
//@ run-pass
fn main () {
let n = (1, (2, 3)).1.1;
assert_eq!(n, 3);
2020-03-26 07:57:39 +00:00
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;
2020-03-26 07:17:41 +00:00
}