From 75a1d1bd1f55e928bd208ca28cee46645a64298a Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 24 Nov 2019 15:47:11 -0500 Subject: [PATCH] Add regression test for #58311 --- src/test/ui/dropck/dropck_fn_type.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/ui/dropck/dropck_fn_type.rs diff --git a/src/test/ui/dropck/dropck_fn_type.rs b/src/test/ui/dropck/dropck_fn_type.rs new file mode 100644 index 0000000000000..04c888a63bbdd --- /dev/null +++ b/src/test/ui/dropck/dropck_fn_type.rs @@ -0,0 +1,18 @@ +// run-pass +//! Regression test for #58311, regarding the usage of Fn types in drop impls + +#[allow(dead_code)] +struct S [u8; 1]>(F); + +impl [u8; 1]> Drop for S { + fn drop(&mut self) {} +} + +#[allow(dead_code)] +struct P [A; 10]>(F); + +impl [A; 10]> Drop for P { + fn drop(&mut self) {} +} + +fn main() {}