diff options
Diffstat (limited to 'tests/ui/issues/issue-22781.rs')
-rw-r--r-- | tests/ui/issues/issue-22781.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-22781.rs b/tests/ui/issues/issue-22781.rs new file mode 100644 index 000000000..d644cec4d --- /dev/null +++ b/tests/ui/issues/issue-22781.rs @@ -0,0 +1,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() {} |