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