]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-57843.rs
1 // Regression test for an ICE that occurred with the universes code:
3 // The signature of the closure `|_|` was being inferred to
4 // `exists<'r> fn(&'r u8)`. This should result in a type error since
5 // the signature `for<'r> fn(&'r u8)` is required. However, due to a
6 // bug in the type variable generalization code, the placeholder for
7 // `'r` was leaking out into the writeback phase, causing an ICE.
10 fn clone(&self) -> Box
<dyn Fn(T
)>;
13 impl<T
, F
: '
static> ClonableFn
<T
> for F
17 fn clone(&self) -> Box
<dyn Fn(T
)> {
18 Box
::new(self.clone())
22 struct Foo(Box
<dyn for<'a
> ClonableFn
<&'a bool
>>);
25 Foo(Box
::new(|_
| ())); //~ ERROR implementation of `FnOnce` is not general enough