]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/mismatched_types/closure-arg-count.stderr
typeck: suggest use of match_default_bindings feature
[rust.git] / src / test / ui / mismatched_types / closure-arg-count.stderr
index 9d4ac6305465a54ba1efeeb491e2d926ca41a10d..ca06825d0ad8bdbf49ab0728cfe659445de1e8a9 100644 (file)
@@ -14,13 +14,21 @@ error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
    |               |
    |               expected closure that takes 2 arguments
 
+error: non-reference pattern used to match a reference (see issue #42640)
+  --> $DIR/closure-arg-count.rs:17:24
+   |
+17 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
+   |                        ^^^^^^^^^^^^^^^ help: consider using: `&(tuple, tuple2)`
+   |
+   = help: add #![feature(match_default_bindings)] to the crate attributes to enable
+
 error[E0308]: mismatched types
   --> $DIR/closure-arg-count.rs:17:24
    |
 17 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
-   |                        ^^^^^^^^^^^^^^^ expected &{integer}, found tuple
+   |                        ^^^^^^^^^^^^^^^ expected integral variable, found tuple
    |
-   = note: expected type `&{integer}`
+   = note: expected type `{integer}`
               found type `(_, _)`
 
 error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
@@ -65,5 +73,5 @@ error[E0593]: closure is expected to take a single 2-tuple as argument, but it t
    |                                                     |
    |                                                     expected closure that takes a single 2-tuple as argument
 
-error: aborting due to 8 previous errors
+error: aborting due to 9 previous errors