Closed
Description
struct A {
long_field_name_1: int,
long_field_name_2: int,
}
static a: A = A {
long_field_name_1: 1,
long_field_name_2: 2,
};
// trailing-comma.rs:16:8: 16:9 error: expected ident, found `}`
// trailing-comma.rs:16 } => assert_eq!((1, 2), (x, y)),
// ^
// task 'rustc' failed at 'explicit failure', /Users/brendan/dev/rust/rust/src/libsyntax/diagnostic.rs:75
// task '<main>' failed at 'explicit failure', /Users/brendan/dev/rust/rust/src/librustc/lib.rs:400
fn test_match() {
match a {
A {
long_field_name_1: x,
long_field_name_2: y,
} => assert_eq!((1, 2), (x, y)),
}
}
// trailing-comma.rs:27:4: 27:5 error: expected ident, found `}`
// trailing-comma.rs:27 } = a;
// ^
// task 'rustc' failed at 'explicit failure', /Users/brendan/dev/rust/rust/src/libsyntax/diagnostic.rs:75
// task '<main>' failed at 'explicit failure', /Users/brendan/dev/rust/rust/src/librustc/lib.rs:400
fn test_let() {
let A {
long_field_name_1: x,
long_field_name_2: y,
} = a;
assert_eq!((1, 2), (x, y));
}