]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dropck/dropck_fn_type.rs
Merge commit '63734fcdd718cca089f84c42f3a42c0096cfd431' into sync_cg_clif-2022-05-15
[rust.git] / src / test / ui / dropck / dropck_fn_type.rs
1 // run-pass
2 //! Regression test for #58311, regarding the usage of Fn types in drop impls
3
4 // All of this Drop impls should compile.
5
6 #[allow(dead_code)]
7 struct S<F: Fn() -> [u8; 1]>(F);
8
9 impl<F: Fn() -> [u8; 1]> Drop for S<F> {
10     fn drop(&mut self) {}
11 }
12
13 #[allow(dead_code)]
14 struct P<A, F: FnOnce() -> [A; 10]>(F);
15
16 impl<A, F: FnOnce() -> [A; 10]> Drop for P<A, F> {
17     fn drop(&mut self) {}
18 }
19
20 fn main() {}