]> git.proxmox.com Git - rustc.git/blob - tests/ui/polymorphization/drop_shims/simple.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / polymorphization / drop_shims / simple.rs
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 }