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/traits/alias/bounds.rs | 57 -------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/test/ui/traits/alias/bounds.rs (limited to 'src/test/ui/traits/alias/bounds.rs') diff --git a/src/test/ui/traits/alias/bounds.rs b/src/test/ui/traits/alias/bounds.rs deleted file mode 100644 index b97eb38c5..000000000 --- a/src/test/ui/traits/alias/bounds.rs +++ /dev/null @@ -1,57 +0,0 @@ -// run-pass - -#![feature(trait_alias)] - -use std::marker::PhantomData; - -trait Empty {} -trait EmptyAlias = Empty; -trait CloneDefault = Clone + Default; -trait SendSyncAlias = Send + Sync; -trait WhereSendAlias = where Self: Send; -trait SendEqAlias = Send where T: PartialEq; -trait I32Iterator = Iterator; - -#[allow(dead_code)] -struct Foo(PhantomData); -#[allow(dead_code)] -struct Bar(PhantomData) where T: SendSyncAlias; - -impl dyn EmptyAlias {} - -impl Empty for T {} - -fn a() -> (T, T) { - let one = T::default(); - let two = one.clone(); - (one, two) -} - -fn b(x: &impl SendEqAlias) -> bool { - 22_i32 == *x -} - -fn c(x: &mut T) -> Option { - x.next() -} - -fn d() { - is_send_and_sync::(); -} - -fn is_send_and_sync() {} - -fn main() { - let both = a::(); - assert_eq!(both.0, 0); - assert_eq!(both.1, 0); - let both: (i32, i32) = a(); - assert_eq!(both.0, 0); - assert_eq!(both.1, 0); - - assert!(b(&22)); - - assert_eq!(c(&mut vec![22].into_iter()), Some(22)); - - d::(); -} -- cgit v1.2.3