Files
rust/tests/ui/tuple/tuple-arity-mismatch.rs

20 lines
567 B
Rust
Raw Normal View History

2013-06-07 22:06:36 +02:00
// Issue #6155
//@ dont-require-annotations: NOTE
2014-12-05 18:12:25 -08:00
fn first((value, _): (isize, f64)) -> isize { value }
2013-06-07 22:06:36 +02:00
fn main() {
2014-08-06 11:59:40 +02:00
let y = first ((1,2.0,3));
2015-01-12 01:01:44 -05:00
//~^ ERROR mismatched types
//~| NOTE expected tuple `(isize, f64)`
//~| NOTE found tuple `(isize, f64, {integer})`
//~| NOTE expected a tuple with 2 elements, found one with 3 elements
let y = first ((1,));
2015-01-12 01:01:44 -05:00
//~^ ERROR mismatched types
//~| NOTE expected tuple `(isize, f64)`
//~| NOTE found tuple `(isize,)`
//~| NOTE expected a tuple with 2 elements, found one with 1 element
2013-06-07 22:06:36 +02:00
}