]>
Commit | Line | Data |
---|---|---|
3dfed10e XL |
1 | // check-pass |
2 | // compile-flags:-Zpolymorphize=on | |
3 | ||
4 | pub struct OnDrop<F: Fn()>(pub F); | |
5 | ||
6 | impl<F: Fn()> Drop for OnDrop<F> { | |
7 | fn drop(&mut self) { } | |
8 | } | |
9 | ||
10 | fn foo<R, S: FnOnce()>( | |
11 | _: R, | |
12 | _: S, | |
13 | ) { | |
14 | let bar = || { | |
15 | let _ = OnDrop(|| ()); | |
16 | }; | |
17 | let _ = bar(); | |
18 | } | |
19 | ||
20 | fn main() { | |
21 | foo(3u32, || {}); | |
22 | } |