rust/tests/ui/tuple/one-tuple.rs

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

16 lines
257 B
Rust
Raw Normal View History

//@ run-pass
// Why one-tuples? Because macros.
2013-03-27 16:58:28 +00:00
pub fn main() {
match ('c',) {
(x,) => {
assert_eq!(x, 'c');
}
}
// test the 1-tuple type too
let x: (char,) = ('d',);
let (y,) = x;
assert_eq!(y, 'd');
}