From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/generic-associated-types/impl_bounds.rs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/test/ui/generic-associated-types/impl_bounds.rs (limited to 'src/test/ui/generic-associated-types/impl_bounds.rs') diff --git a/src/test/ui/generic-associated-types/impl_bounds.rs b/src/test/ui/generic-associated-types/impl_bounds.rs new file mode 100644 index 000000000..ec1d171c0 --- /dev/null +++ b/src/test/ui/generic-associated-types/impl_bounds.rs @@ -0,0 +1,26 @@ +#![feature(generic_associated_types)] +#![feature(associated_type_defaults)] + +trait Foo { + type A<'a> where Self: 'a; + type B<'a, 'b> where 'a: 'b; + type C where Self: Clone; + fn d() where Self: Clone; +} + +#[derive(Copy, Clone)] +struct Fooy(T); + +impl Foo for Fooy { + type A<'a> = (&'a ()) where Self: 'static; + //~^ ERROR impl has stricter requirements than trait + type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; + //~^ ERROR impl has stricter requirements than trait + //~| ERROR lifetime bound not satisfied + type C = String where Self: Copy; + //~^ ERROR the trait bound `T: Copy` is not satisfied + fn d() where Self: Copy {} + //~^ ERROR the trait bound `T: Copy` is not satisfied +} + +fn main() {} -- cgit v1.2.3