From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/nll/local-outlives-static-via-hrtb.rs | 26 ----------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/test/ui/nll/local-outlives-static-via-hrtb.rs (limited to 'src/test/ui/nll/local-outlives-static-via-hrtb.rs') diff --git a/src/test/ui/nll/local-outlives-static-via-hrtb.rs b/src/test/ui/nll/local-outlives-static-via-hrtb.rs deleted file mode 100644 index 5f1f9b3a7..000000000 --- a/src/test/ui/nll/local-outlives-static-via-hrtb.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Test that we handle the case when a local variable is borrowed for `'static` -// due to an outlives constraint involving a region in an incompatible universe - -pub trait Outlives<'this> {} - -impl<'this, T> Outlives<'this> for T where T: 'this {} -trait Reference { - type AssociatedType; -} - -impl<'a, T: 'a> Reference for &'a T { - type AssociatedType = &'a (); -} - -fn assert_static_via_hrtb(_: G) where for<'a> G: Outlives<'a> {} - -fn assert_static_via_hrtb_with_assoc_type(_: &'_ T) -where - for<'a> &'a T: Reference, -{} - -fn main() { - let local = 0; - assert_static_via_hrtb(&local); //~ ERROR `local` does not live long enough - assert_static_via_hrtb_with_assoc_type(&&local); //~ ERROR `local` does not live long enough -} -- cgit v1.2.3