This commit is contained in:
Esteban Küber 2017-11-24 08:27:33 -08:00
parent 2461b7a264
commit 15dfd7eb61
2 changed files with 5 additions and 2 deletions

View file

@ -14,5 +14,8 @@ fn main() {
let x = vec![(String::new(), String::new())];
x.iter()
.filter(|&(ref a, _)| foo(a))
//~^ ERROR non-reference pattern used to match a reference
//~| HELP consider using a reference
//~| HELP add
.collect();
}

View file

@ -1,8 +1,8 @@
error: non-reference pattern used to match a reference (see issue #42640)
--> $DIR/dont-suggest-dereference-on-arg.rs:16:19
--> $DIR/dont-suggest-dereference-on-arg.rs:16:18
|
16 | .filter(|&(ref a, _)| foo(a))
| ^^^^^^^^^^^ help: consider using a reference: `&&(ref k, _)`
| ^^^^^^^^^^^ help: consider using a reference: `&&(ref a, _)`
|
= help: add #![feature(match_default_bindings)] to the crate attributes to enable