diff options
Diffstat (limited to '')
8 files changed, 30 insertions, 12 deletions
diff --git a/src/test/ui/associated-type-bounds/binder-on-bound.rs b/src/test/ui/associated-type-bounds/binder-on-bound.rs index 0b4b24b98..6cba45129 100644 --- a/src/test/ui/associated-type-bounds/binder-on-bound.rs +++ b/src/test/ui/associated-type-bounds/binder-on-bound.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Trait { type Bound<'a>; } diff --git a/src/test/ui/associated-type-bounds/binder-on-bound.stderr b/src/test/ui/associated-type-bounds/binder-on-bound.stderr index 3432672e0..f71f72bfb 100644 --- a/src/test/ui/associated-type-bounds/binder-on-bound.stderr +++ b/src/test/ui/associated-type-bounds/binder-on-bound.stderr @@ -1,5 +1,5 @@ error: `for<...>` is not allowed on associated type bounds - --> $DIR/binder-on-bound.rs:7:22 + --> $DIR/binder-on-bound.rs:5:22 | LL | fn foo() where Trait<for<'a> Bound<'a> = &'a ()> { | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/associated-type-bounds/elision.rs b/src/test/ui/associated-type-bounds/elision.rs index 4a5339399..d00def571 100644 --- a/src/test/ui/associated-type-bounds/elision.rs +++ b/src/test/ui/associated-type-bounds/elision.rs @@ -1,7 +1,7 @@ #![feature(associated_type_bounds)] #![feature(anonymous_lifetime_in_impl_trait)] -// The same thing should happen for constaints in dyn trait. +// The same thing should happen for constraints in dyn trait. fn f(x: &mut dyn Iterator<Item: Iterator<Item = &'_ ()>>) -> Option<&'_ ()> { x.next() } //~^ ERROR missing lifetime specifier //~| ERROR mismatched types diff --git a/src/test/ui/associated-type-bounds/inside-adt.rs b/src/test/ui/associated-type-bounds/inside-adt.rs index f26037f07..8eb8c44bb 100644 --- a/src/test/ui/associated-type-bounds/inside-adt.rs +++ b/src/test/ui/associated-type-bounds/inside-adt.rs @@ -16,7 +16,7 @@ enum E2 { V(Box<dyn Iterator<Item: Copy>>) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions enum E3 { V(dyn Iterator<Item: 'static>) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` +//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions @@ -25,6 +25,6 @@ union U2 { f: ManuallyDrop<Box<dyn Iterator<Item: Copy>>> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions -//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` +//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` fn main() {} diff --git a/src/test/ui/associated-type-bounds/inside-adt.stderr b/src/test/ui/associated-type-bounds/inside-adt.stderr index 978390fa7..dbfcfa580 100644 --- a/src/test/ui/associated-type-bounds/inside-adt.stderr +++ b/src/test/ui/associated-type-bounds/inside-adt.stderr @@ -70,13 +70,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) } | ++++ + -error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time --> $DIR/inside-adt.rs:17:13 | LL | enum E3 { V(dyn Iterator<Item: 'static>) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)` + = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -107,14 +107,14 @@ help: the `Box` type always has a statically known size and allocates its conten LL | union U1 { f: Box<ManuallyDrop<dyn Iterator<Item: Copy>>> } | ++++ + -error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time --> $DIR/inside-adt.rs:26:15 | LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)` - = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized> + 'static)>` + = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)` + = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>` = note: no field of a union may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size diff --git a/src/test/ui/associated-type-bounds/issue-102335-ty.rs b/src/test/ui/associated-type-bounds/issue-102335-ty.rs new file mode 100644 index 000000000..363df73c1 --- /dev/null +++ b/src/test/ui/associated-type-bounds/issue-102335-ty.rs @@ -0,0 +1,12 @@ +trait T { + type A: S<C<i32 = u32> = ()>; + //~^ ERROR associated type bindings are not allowed here +} + +trait Q {} + +trait S { + type C: Q; +} + +fn main() {} diff --git a/src/test/ui/associated-type-bounds/issue-102335-ty.stderr b/src/test/ui/associated-type-bounds/issue-102335-ty.stderr new file mode 100644 index 000000000..8777b2965 --- /dev/null +++ b/src/test/ui/associated-type-bounds/issue-102335-ty.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-102335-ty.rs:2:17 + | +LL | type A: S<C<i32 = u32> = ()>; + | ^^^^^^^^^ associated type not allowed here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0229`. diff --git a/src/test/ui/associated-type-bounds/issue-79949.rs b/src/test/ui/associated-type-bounds/issue-79949.rs index 9f924f1fd..9dd37f981 100644 --- a/src/test/ui/associated-type-bounds/issue-79949.rs +++ b/src/test/ui/associated-type-bounds/issue-79949.rs @@ -2,7 +2,6 @@ #![allow(incomplete_features)] #![feature(associated_type_bounds)] -#![feature(generic_associated_types)] trait MP { type T<'a>; |