summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-22781.rs
blob: d644cec4d56662c8992e0b01f2263b47daf067bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// check-pass
#![allow(unused_variables)]
use std::collections::HashMap;
use std::collections::hash_map::Entry::Vacant;

pub fn foo() {
    type F = Box<dyn Fn(&()) + 'static>;
    let mut map: HashMap<(), F> = HashMap::new();
    let x: &mut F = match map.entry(()) {
        Vacant(_) => unimplemented!(),
        _ => unimplemented!()
    };
}

fn main() {}