rust/tests/ui/parser/issues/issue-59418.rs

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

19 lines
490 B
Rust
Raw Normal View History

struct X(i32,i32,i32);
fn main() {
let a = X(1, 2, 3);
let b = a.1suffix;
2019-03-26 14:09:13 -05:00
//~^ ERROR suffixes on a tuple index are invalid
println!("{}", b);
2019-03-25 23:38:23 -05:00
let c = (1, 2, 3);
let d = c.1suffix;
2019-03-26 14:09:13 -05:00
//~^ ERROR suffixes on a tuple index are invalid
2019-03-25 23:38:23 -05:00
println!("{}", d);
let s = X { 0suffix: 0, 1: 1, 2: 2 };
//~^ ERROR suffixes on a tuple index are invalid
match s {
X { 0suffix: _, .. } => {}
//~^ ERROR suffixes on a tuple index are invalid
}
}