mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
15 lines
361 B
Rust
15 lines
361 B
Rust
// 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() {}
|