From cf94bdc0742c13e2a0cac864c478b8626b266e1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/function-pointer/sized-ret-with-binder.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/ui/function-pointer/sized-ret-with-binder.rs (limited to 'src/test/ui/function-pointer/sized-ret-with-binder.rs') diff --git a/src/test/ui/function-pointer/sized-ret-with-binder.rs b/src/test/ui/function-pointer/sized-ret-with-binder.rs new file mode 100644 index 000000000..104ac4d22 --- /dev/null +++ b/src/test/ui/function-pointer/sized-ret-with-binder.rs @@ -0,0 +1,15 @@ +// check-pass + +#![feature(unboxed_closures)] + +fn is_fn Fn<(&'a (),)>>() {} +fn is_fn2 Fn<(&'a &'b (),)>>() {} + +struct Outlives<'a, 'b>(std::marker::PhantomData<&'a &'b ()>); + +fn main() { + is_fn:: fn(&'a ()) -> &'a ()>(); + is_fn:: fn(&'a ()) -> &'a dyn std::fmt::Debug>(); + is_fn2:: fn(&'a &'b ()) -> Outlives<'a, 'b>>(); + is_fn2:: fn(&'a &'b ()) -> (&'a (), &'a ())>(); +} -- cgit v1.2.3