librustc: Implement tuple struct constants. r=brson
This commit is contained in:
parent
5b5a0df7ee
commit
8fa306a0ad
3 changed files with 51 additions and 6 deletions
13
src/test/run-pass/const-tuple-struct.rs
Normal file
13
src/test/run-pass/const-tuple-struct.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
struct Bar(int, int);
|
||||
|
||||
const X: Bar = Bar(1, 2);
|
||||
|
||||
fn main() {
|
||||
match X {
|
||||
Bar(x, y) => {
|
||||
assert x == 1;
|
||||
assert y == 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue