2019-07-27 00:54:25 +03:00
|
|
|
//@ run-pass
|
2013-02-17 15:41:47 -08:00
|
|
|
// Why one-tuples? Because macros.
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-03-27 09:58:28 -07:00
|
|
|
pub fn main() {
|
2013-02-17 15:41:47 -08:00
|
|
|
match ('c',) {
|
|
|
|
(x,) => {
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(x, 'c');
|
2013-02-17 15:41:47 -08:00
|
|
|
}
|
|
|
|
}
|
2013-02-18 17:45:56 -08:00
|
|
|
// test the 1-tuple type too
|
|
|
|
let x: (char,) = ('d',);
|
|
|
|
let (y,) = x;
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(y, 'd');
|
2013-02-17 15:41:47 -08:00
|
|
|
}
|