blob: 2934217df346e06057d94d5d723ae2a6f1a95ead (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// run-pass
//! Regression test for #58311, regarding the usage of Fn types in drop impls
// All of this Drop impls should compile.
#[allow(dead_code)]
struct S<F: Fn() -> [u8; 1]>(F);
impl<F: Fn() -> [u8; 1]> Drop for S<F> {
fn drop(&mut self) {}
}
#[allow(dead_code)]
struct P<A, F: FnOnce() -> [A; 10]>(F);
impl<A, F: FnOnce() -> [A; 10]> Drop for P<A, F> {
fn drop(&mut self) {}
}
fn main() {}
|