From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../constrain_inputs_unsound.rs | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs (limited to 'src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs') diff --git a/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs b/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs deleted file mode 100644 index 3bae0f173..000000000 --- a/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![feature(type_alias_impl_trait)] - -trait Static: 'static {} -impl Static for () {} - -type Gal = impl Static; -fn _defining() -> Gal {} - -trait Callable { type Output; } - -/// We can infer `>::Output: 'static`, -/// because we know `C: 'static` and `Arg: 'static`, -fn box_str(s: C::Output) -> Box + 'static> -where - Arg: Static, - C: ?Sized + Callable + 'static, - C::Output: AsRef, -{ - Box::new(s) -} - -fn extend_lifetime(s: &str) -> Box + 'static> { - type MalformedTy = dyn for<'a> Callable, Output = &'a str>; - //~^ ERROR binding for associated type `Output` references lifetime `'a` - box_str::(s) -} - -fn main() { - let extended = extend_lifetime(&String::from("hello")); - println!("{}", extended.as_ref().as_ref()); -} -- cgit v1.2.3