summaryrefslogtreecommitdiffstats
path: root/src/test/ui/tuple/tuple-arity-mismatch.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/tuple/tuple-arity-mismatch.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/tuple/tuple-arity-mismatch.rs b/src/test/ui/tuple/tuple-arity-mismatch.rs
new file mode 100644
index 000000000..f1e525c93
--- /dev/null
+++ b/src/test/ui/tuple/tuple-arity-mismatch.rs
@@ -0,0 +1,17 @@
+// Issue #6155
+
+fn first((value, _): (isize, f64)) -> isize { value }
+
+fn main() {
+ let y = first ((1,2.0,3));
+ //~^ ERROR mismatched types
+ //~| expected tuple `(isize, f64)`
+ //~| found tuple `(isize, f64, {integer})`
+ //~| expected a tuple with 2 elements, found one with 3 elements
+
+ let y = first ((1,));
+ //~^ ERROR mismatched types
+ //~| expected tuple `(isize, f64)`
+ //~| found tuple `(isize,)`
+ //~| expected a tuple with 2 elements, found one with 1 element
+}