about summary refs log tree commit diff
path: root/tests/ui/moves/do-not-suggest-removing-wrong-ref-pattern-issue-132806.fixed
blob: 46b05e4c0a3c2252e815414b8f0d21723d7ac697 (plain)
1
2
3
4
5
6
7
8
9
10
//@ run-rustfix
//! diagnostic test for #132806: make sure the suggestion to bind by-reference in patterns doesn't
//! erroneously remove the wrong `&`

use std::collections::HashMap;

fn main() {
    let _ = HashMap::<String, i32>::new().iter().filter(|&(_k, &_v)| { true });
    //~^ ERROR cannot move out of a shared reference
}