rust/src/test/ui/issues/issue-22781.rs

16 lines
398 B
Rust
Raw Normal View History

// build-pass (FIXME(62277): could be check-pass?)
#![allow(unused_variables)]
use std::collections::HashMap;
use std::collections::hash_map::Entry::Vacant;
pub fn foo() {
2019-05-28 18:46:13 +00:00
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() {}