Skip to content

Commit

Permalink
Add regression test for rust-lang#58311
Browse files Browse the repository at this point in the history
  • Loading branch information
TommasoBianchi committed Nov 24, 2019
1 parent a0e81ec commit 75a1d1b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/ui/dropck/dropck_fn_type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// run-pass
//! Regression test for #58311, regarding the usage of Fn types in drop impls

#[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() {}

0 comments on commit 75a1d1b

Please sign in to comment.