diff options
Diffstat (limited to 'src/test/ui/generic-associated-types')
250 files changed, 709 insertions, 701 deletions
diff --git a/src/test/ui/generic-associated-types/anonymize-bound-vars.rs b/src/test/ui/generic-associated-types/anonymize-bound-vars.rs index 1ec9c6998..eb7a12412 100644 --- a/src/test/ui/generic-associated-types/anonymize-bound-vars.rs +++ b/src/test/ui/generic-associated-types/anonymize-bound-vars.rs @@ -1,7 +1,6 @@ // check-pass // // regression test for #98702 -#![feature(generic_associated_types)] trait Foo { type Assoc<T>; diff --git a/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs b/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs index 0e8e14852..21a9b3b89 100644 --- a/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs +++ b/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - use std::{future::Future, pin::Pin}; pub trait Foo { diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs new file mode 100644 index 000000000..719d1bd5a --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs @@ -0,0 +1,35 @@ +// check-fail +// known-bug + +// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for +// all 'a where I::Item<'a> is WF", but really means "for all 'a possible" + +use std::fmt::Debug; + +pub trait LendingIterator { + type Item<'this> + where + Self: 'this; +} + +pub struct WindowsMut<'x> { + slice: &'x (), +} + +impl<'y> LendingIterator for WindowsMut<'y> { + type Item<'this> = &'this mut () where 'y: 'this; +} + +fn print_items<I>(_iter: I) +where + I: LendingIterator, + for<'a> I::Item<'a>: Debug, +{ +} + +fn main() { + let slice = &mut (); + //~^ temporary value dropped while borrowed + let windows = WindowsMut { slice }; + print_items::<WindowsMut<'_>>(windows); +} diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr new file mode 100644 index 000000000..414999881 --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr @@ -0,0 +1,20 @@ +error[E0716]: temporary value dropped while borrowed + --> $DIR/hrtb-implied-1.rs:31:22 + | +LL | let slice = &mut (); + | ^^ creates a temporary which is freed while still in use +... +LL | print_items::<WindowsMut<'_>>(windows); + | -------------------------------------- argument requires that borrow lasts for `'static` +LL | } + | - temporary value is freed at the end of this statement + | +note: due to current limitations in the borrow checker, this implies a `'static` lifetime + --> $DIR/hrtb-implied-1.rs:26:26 + | +LL | for<'a> I::Item<'a>: Debug, + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0716`. diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs new file mode 100644 index 000000000..8e6c5348e --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs @@ -0,0 +1,40 @@ +// check-fail +// known-bug + +// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for +// all 'a where I::Item<'a> is WF", but really means "for all 'a possible" + +trait LendingIterator: Sized { + type Item<'a> + where + Self: 'a; + fn next(&mut self) -> Self::Item<'_>; +} +fn fails<I: LendingIterator, F>(iter: &mut I, f: F) -> bool +where + F: FnMut(I::Item<'_>), +{ + let mut iter2 = Eat(iter, f); + let _next = iter2.next(); + //~^ borrowed data escapes + true +} +impl<I: LendingIterator> LendingIterator for &mut I { + type Item<'a> = I::Item<'a> where Self:'a; + fn next(&mut self) -> Self::Item<'_> { + (**self).next() + } +} + +struct Eat<I, F>(I, F); +impl<I: LendingIterator, F> Iterator for Eat<I, F> +where + F: FnMut(I::Item<'_>), +{ + type Item = (); + fn next(&mut self) -> Option<Self::Item> { + None + } +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr new file mode 100644 index 000000000..1ee270398 --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr @@ -0,0 +1,22 @@ +error[E0521]: borrowed data escapes outside of function + --> $DIR/hrtb-implied-2.rs:18:17 + | +LL | fn fails<I: LendingIterator, F>(iter: &mut I, f: F) -> bool + | ---- - let's call the lifetime of this reference `'1` + | | + | `iter` is a reference that is only valid in the function body +... +LL | let _next = iter2.next(); + | ^^^^^^^^^^^^ + | | + | `iter` escapes the function body here + | argument requires that `'1` must outlive `'static` + | + = note: requirement occurs because of a mutable reference to `Eat<&mut I, F>` + = note: mutable references are invariant over their type parameter + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance + = note: due to current limitations in the borrow checker, this implies a `'static` lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0521`. diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs new file mode 100644 index 000000000..bc9e6c8ae --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs @@ -0,0 +1,23 @@ +trait LendingIterator { + type Item<'a> + where + Self: 'a; +} + +impl LendingIterator for &str { + type Item<'a> = () where Self:'a; +} + +fn trivial_bound<I>(_: I) +where + I: LendingIterator, + for<'a> I::Item<'a>: Sized, +{ +} + +fn fails(iter: &str) { + trivial_bound(iter); + //~^ borrowed data escapes +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr new file mode 100644 index 000000000..c67e02437 --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr @@ -0,0 +1,22 @@ +error[E0521]: borrowed data escapes outside of function + --> $DIR/hrtb-implied-3.rs:19:5 + | +LL | fn fails(iter: &str) { + | ---- - let's call the lifetime of this reference `'1` + | | + | `iter` is a reference that is only valid in the function body +LL | trivial_bound(iter); + | ^^^^^^^^^^^^^^^^^^^ + | | + | `iter` escapes the function body here + | argument requires that `'1` must outlive `'static` + | +note: due to current limitations in the borrow checker, this implies a `'static` lifetime + --> $DIR/hrtb-implied-3.rs:14:26 + | +LL | for<'a> I::Item<'a>: Sized, + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0521`. diff --git a/src/test/ui/generic-associated-types/bugs/issue-80626.rs b/src/test/ui/generic-associated-types/bugs/issue-80626.rs index 14f27aff1..f6aa6b36e 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-80626.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-80626.rs @@ -3,8 +3,6 @@ // This should pass, but it requires `Sized` to be coinductive. -#![feature(generic_associated_types)] - trait Allocator { type Allocated<T>; } diff --git a/src/test/ui/generic-associated-types/bugs/issue-80626.stderr b/src/test/ui/generic-associated-types/bugs/issue-80626.stderr index 487b83dfa..9a0f332ed 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-80626.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-80626.stderr @@ -1,11 +1,11 @@ error[E0275]: overflow evaluating the requirement `LinkedList<A>: Sized` - --> $DIR/issue-80626.rs:14:10 + --> $DIR/issue-80626.rs:12:10 | LL | Next(A::Allocated<Self>) | ^^^^^^^^^^^^^^^^^^ | note: required by a bound in `Allocator::Allocated` - --> $DIR/issue-80626.rs:9:20 + --> $DIR/issue-80626.rs:7:20 | LL | type Allocated<T>; | ^ required by this bound in `Allocator::Allocated` diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr b/src/test/ui/generic-associated-types/bugs/issue-86218.stderr deleted file mode 100644 index fbf1c8f95..000000000 --- a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0477]: the type `<() as Yay<&'a ()>>::InnerStream<'s>` does not fulfill the required lifetime - --> $DIR/issue-86218.rs:23:28 - | -LL | type InnerStream<'s> = impl Stream<Item = i32> + 's; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: type must outlive the lifetime `'s` as defined here as required by this binding - --> $DIR/issue-86218.rs:23:22 - | -LL | type InnerStream<'s> = impl Stream<Item = i32> + 's; - | ^^ - -error: unconstrained opaque type - --> $DIR/issue-86218.rs:23:28 - | -LL | type InnerStream<'s> = impl Stream<Item = i32> + 's; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `InnerStream` must be used in combination with a concrete type within the same module - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/generic-associated-types/bugs/issue-87735.rs b/src/test/ui/generic-associated-types/bugs/issue-87735.rs index 0844d84c3..80737a798 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-87735.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-87735.rs @@ -3,8 +3,6 @@ // This should pass, but we need an extension of implied bounds (probably). -#![feature(generic_associated_types)] - pub trait AsRef2 { type Output<'a> where Self: 'a; diff --git a/src/test/ui/generic-associated-types/bugs/issue-87735.stderr b/src/test/ui/generic-associated-types/bugs/issue-87735.stderr index 0a18b5f0c..ebe2054ce 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-87735.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-87735.stderr @@ -1,5 +1,5 @@ error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-87735.rs:27:13 + --> $DIR/issue-87735.rs:25:13 | LL | impl<'b, T, U> AsRef2 for Foo<T> | ^ unconstrained type parameter diff --git a/src/test/ui/generic-associated-types/bugs/issue-87748.rs b/src/test/ui/generic-associated-types/bugs/issue-87748.rs deleted file mode 100644 index a3d00ee03..000000000 --- a/src/test/ui/generic-associated-types/bugs/issue-87748.rs +++ /dev/null @@ -1,23 +0,0 @@ -// check-fail -// known-bug: #87748 - -// This should pass, but unnormalized input args aren't treated as implied. - -#![feature(generic_associated_types)] - -trait MyTrait { - type Assoc<'a, 'b> where 'b: 'a; - fn do_sth(arg: Self::Assoc<'_, '_>); -} - -struct Foo; - -impl MyTrait for Foo { - type Assoc<'a, 'b> = u32 where 'b: 'a; - - fn do_sth(_: u32) {} - // fn do_sth(_: Self::Assoc<'static, 'static>) {} - // fn do_sth(_: Self::Assoc<'_, '_>) {} -} - -fn main() {} diff --git a/src/test/ui/generic-associated-types/bugs/issue-87748.stderr b/src/test/ui/generic-associated-types/bugs/issue-87748.stderr deleted file mode 100644 index ac197dfe6..000000000 --- a/src/test/ui/generic-associated-types/bugs/issue-87748.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0478]: lifetime bound not satisfied - --> $DIR/issue-87748.rs:18:5 - | -LL | fn do_sth(_: u32) {} - | ^^^^^^^^^^^^^^^^^ - | -note: lifetime parameter instantiated with the anonymous lifetime as defined here - --> $DIR/issue-87748.rs:18:5 - | -LL | fn do_sth(_: u32) {} - | ^^^^^^^^^^^^^^^^^ -note: but lifetime parameter must outlive the anonymous lifetime as defined here - --> $DIR/issue-87748.rs:18:5 - | -LL | fn do_sth(_: u32) {} - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0478`. diff --git a/src/test/ui/generic-associated-types/bugs/issue-87755.rs b/src/test/ui/generic-associated-types/bugs/issue-87755.rs index efa487d62..cda722d2f 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-87755.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-87755.rs @@ -3,8 +3,6 @@ // This should pass. -#![feature(generic_associated_types)] - use std::fmt::Debug; trait Foo { diff --git a/src/test/ui/generic-associated-types/bugs/issue-87755.stderr b/src/test/ui/generic-associated-types/bugs/issue-87755.stderr index 5d1aff011..5e94db9b0 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-87755.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-87755.stderr @@ -1,5 +1,5 @@ error[E0275]: overflow evaluating the requirement `<Bar as Foo>::Ass == _` - --> $DIR/issue-87755.rs:18:16 + --> $DIR/issue-87755.rs:16:16 | LL | type Ass = Bar; | ^^^ diff --git a/src/test/ui/generic-associated-types/bugs/issue-87803.rs b/src/test/ui/generic-associated-types/bugs/issue-87803.rs index a8a111c99..56237e387 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-87803.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-87803.rs @@ -4,8 +4,6 @@ // This should pass, but using a type alias vs a reference directly // changes late-bound -> early-bound. -#![feature(generic_associated_types)] - trait Scanner { type Input<'a>; type Token<'a>; diff --git a/src/test/ui/generic-associated-types/bugs/issue-87803.stderr b/src/test/ui/generic-associated-types/bugs/issue-87803.stderr index c81c051d3..fe2abdedb 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-87803.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-87803.stderr @@ -1,5 +1,5 @@ error[E0195]: lifetime parameters or bounds on method `scan` do not match the trait declaration - --> $DIR/issue-87803.rs:22:12 + --> $DIR/issue-87803.rs:20:12 | LL | fn scan<'a>(&mut self, i : Self::Input<'a>) -> Self::Token<'a>; | ---- lifetimes in impl do not match this method in trait diff --git a/src/test/ui/generic-associated-types/bugs/issue-88382.rs b/src/test/ui/generic-associated-types/bugs/issue-88382.rs index 5493b9b93..8f8cc4523 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88382.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-88382.rs @@ -3,8 +3,6 @@ // This should pass, but has a missed normalization due to HRTB. -#![feature(generic_associated_types)] - trait Iterable { type Iterator<'a> where Self: 'a; fn iter(&self) -> Self::Iterator<'_>; diff --git a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr index 7210895b7..a9a70bb71 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr @@ -1,5 +1,5 @@ error[E0631]: type mismatch in function arguments - --> $DIR/issue-88382.rs:28:40 + --> $DIR/issue-88382.rs:26:40 | LL | do_something(SomeImplementation(), test); | ------------ ^^^^ expected due to this @@ -9,10 +9,10 @@ LL | do_something(SomeImplementation(), test); LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {} | ------------------------------------------------- found signature defined here | - = note: expected function signature `for<'r> fn(&'r mut std::iter::Empty<usize>) -> _` - found function signature `for<'a, 'r> fn(&'r mut <_ as Iterable>::Iterator<'a>) -> _` + = note: expected function signature `for<'a> fn(&'a mut std::iter::Empty<usize>) -> _` + found function signature `for<'a, 'b> fn(&'b mut <_ as Iterable>::Iterator<'a>) -> _` note: required by a bound in `do_something` - --> $DIR/issue-88382.rs:22:48 + --> $DIR/issue-88382.rs:20:48 | LL | fn do_something<I: Iterable>(i: I, mut f: impl for<'a> Fn(&mut I::Iterator<'a>)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `do_something` diff --git a/src/test/ui/generic-associated-types/bugs/issue-88460.rs b/src/test/ui/generic-associated-types/bugs/issue-88460.rs index f1c3b2269..224e696ad 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88460.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-88460.rs @@ -3,8 +3,6 @@ // This should pass, but has a missed normalization due to HRTB. -#![feature(generic_associated_types)] - pub trait Marker {} pub trait Trait { diff --git a/src/test/ui/generic-associated-types/bugs/issue-88460.stderr b/src/test/ui/generic-associated-types/bugs/issue-88460.stderr index 98c304cc9..6612c4b49 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88460.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-88460.stderr @@ -1,12 +1,14 @@ error[E0277]: the trait bound `for<'a> <_ as Trait>::Assoc<'a>: Marker` is not satisfied - --> $DIR/issue-88460.rs:30:5 + --> $DIR/issue-88460.rs:28:10 | LL | test(Foo); - | ^^^^ the trait `for<'a> Marker` is not implemented for `<_ as Trait>::Assoc<'a>` + | ---- ^^^ the trait `for<'a> Marker` is not implemented for `<_ as Trait>::Assoc<'a>` + | | + | required by a bound introduced by this call | = help: the trait `Marker` is implemented for `()` note: required by a bound in `test` - --> $DIR/issue-88460.rs:17:27 + --> $DIR/issue-88460.rs:15:27 | LL | fn test<T>(value: T) | ---- required by a bound in this diff --git a/src/test/ui/generic-associated-types/bugs/issue-88526.rs b/src/test/ui/generic-associated-types/bugs/issue-88526.rs index 15363ad04..99397744f 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88526.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-88526.rs @@ -3,8 +3,6 @@ // This should pass, but requires more logic. -#![feature(generic_associated_types)] - trait A { type I<'a>; } diff --git a/src/test/ui/generic-associated-types/bugs/issue-88526.stderr b/src/test/ui/generic-associated-types/bugs/issue-88526.stderr index 127c889bf..56857c655 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-88526.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-88526.stderr @@ -1,5 +1,5 @@ error[E0207]: the type parameter `I` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-88526.rs:27:13 + --> $DIR/issue-88526.rs:25:13 | LL | impl<'q, Q, I, F> A for TestB<Q, F> | ^ unconstrained type parameter diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr b/src/test/ui/generic-associated-types/bugs/issue-89008.stderr deleted file mode 100644 index 50844fdc1..000000000 --- a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0271]: type mismatch resolving `<Empty<_> as Stream>::Item == Repr` - --> $DIR/issue-89008.rs:39:43 - | -LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { - | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Empty<_> as Stream>::Item == Repr` - | | - | this type parameter - | -note: expected this to be `()` - --> $DIR/issue-89008.rs:18:17 - | -LL | type Item = (); - | ^^ - = note: expected unit type `()` - found type parameter `Repr` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/generic-associated-types/issue-91762.rs b/src/test/ui/generic-associated-types/bugs/issue-91762.rs index b259a3c6e..dec668bec 100644 --- a/src/test/ui/generic-associated-types/issue-91762.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-91762.rs @@ -1,13 +1,12 @@ // check-fail +// known-bug -// FIXME(generic_associated_types): We almost certaintly want this to pass, but +// We almost certainly want this to pass, but // it's particularly difficult currently, because we need a way of specifying // that `<Self::Base as Functor>::With<T> = Self` without using that when we have // a `U`. See `https://github.com/rust-lang/rust/pull/92728` for a (hacky) // solution. This might be better to just wait for Chalk. -#![feature(generic_associated_types)] - pub trait Functor { type With<T>; diff --git a/src/test/ui/generic-associated-types/issue-91762.stderr b/src/test/ui/generic-associated-types/bugs/issue-91762.stderr index c2785fee3..1272c8b8a 100644 --- a/src/test/ui/generic-associated-types/issue-91762.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-91762.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/issue-91762.rs:25:15 + --> $DIR/issue-91762.rs:24:15 | LL | ret = <Self::Base as Functor>::fmap(arg); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `fmap` diff --git a/src/test/ui/generic-associated-types/collections-project-default.rs b/src/test/ui/generic-associated-types/collections-project-default.rs index 157e1b1d2..e08aa18cf 100644 --- a/src/test/ui/generic-associated-types/collections-project-default.rs +++ b/src/test/ui/generic-associated-types/collections-project-default.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] // A Collection trait and collection families. Based on diff --git a/src/test/ui/generic-associated-types/collections-project-default.stderr b/src/test/ui/generic-associated-types/collections-project-default.stderr index 22fbc0271..5701017dc 100644 --- a/src/test/ui/generic-associated-types/collections-project-default.stderr +++ b/src/test/ui/generic-associated-types/collections-project-default.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/collections-project-default.rs:59:5 + --> $DIR/collections-project-default.rs:58:5 | LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32> | ------------------------------------ expected `<C as Collection<i32>>::Sibling<f32>` because of return type diff --git a/src/test/ui/generic-associated-types/collections.rs b/src/test/ui/generic-associated-types/collections.rs index 1c00aa73f..15f429afb 100644 --- a/src/test/ui/generic-associated-types/collections.rs +++ b/src/test/ui/generic-associated-types/collections.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] // A Collection trait and collection families. Based on diff --git a/src/test/ui/generic-associated-types/collectivity-regression.rs b/src/test/ui/generic-associated-types/collectivity-regression.rs index fb7368439..54154f9d1 100644 --- a/src/test/ui/generic-associated-types/collectivity-regression.rs +++ b/src/test/ui/generic-associated-types/collectivity-regression.rs @@ -1,7 +1,5 @@ // Regression test from https://github.com/rust-lang/rust/pull/98109 -#![feature(generic_associated_types)] - pub trait Get { type Value<'a> where diff --git a/src/test/ui/generic-associated-types/collectivity-regression.stderr b/src/test/ui/generic-associated-types/collectivity-regression.stderr index a858dd7fd..1dbe1e2cb 100644 --- a/src/test/ui/generic-associated-types/collectivity-regression.stderr +++ b/src/test/ui/generic-associated-types/collectivity-regression.stderr @@ -1,5 +1,5 @@ error: `T` does not live long enough - --> $DIR/collectivity-regression.rs:15:5 + --> $DIR/collectivity-regression.rs:13:5 | LL | / || { LL | | diff --git a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs index afde5f376..c5f9a25a6 100644 --- a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs +++ b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(generic_associated_types)] // This test unsures that with_opt_const_param returns the // def_id of the N param in the Foo::Assoc GAT. diff --git a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs index 51046be79..cd7941ed9 100644 --- a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs +++ b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(generic_associated_types)] // This test unsures that with_opt_const_param returns the // def_id of the N param in the Foo::Assoc GAT. diff --git a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs index 457fe27b3..db61fc080 100644 --- a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs +++ b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(generic_associated_types)] // This test unsures that with_opt_const_param returns the // def_id of the N param in the Bar::Assoc GAT. diff --git a/src/test/ui/generic-associated-types/const_params_have_right_type.rs b/src/test/ui/generic-associated-types/const_params_have_right_type.rs index 6bed8e3af..d2cb12697 100644 --- a/src/test/ui/generic-associated-types/const_params_have_right_type.rs +++ b/src/test/ui/generic-associated-types/const_params_have_right_type.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Trait { type Foo<const N: u8>; } diff --git a/src/test/ui/generic-associated-types/const_params_have_right_type.stderr b/src/test/ui/generic-associated-types/const_params_have_right_type.stderr index 89c993dee..fdedd3bf5 100644 --- a/src/test/ui/generic-associated-types/const_params_have_right_type.stderr +++ b/src/test/ui/generic-associated-types/const_params_have_right_type.stderr @@ -1,5 +1,5 @@ error[E0053]: type `Foo` has an incompatible generic parameter for trait `Trait` - --> $DIR/const_params_have_right_type.rs:8:14 + --> $DIR/const_params_have_right_type.rs:6:14 | LL | trait Trait { | ----- diff --git a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs index e315ee842..c78a54997 100644 --- a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs +++ b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs @@ -1,7 +1,5 @@ // Test that correct syntax is used in suggestion to constrain associated type -#![feature(generic_associated_types)] - trait X { type Y<T>; } diff --git a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr index 957ae5d29..96c4330fe 100644 --- a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr +++ b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/constraint-assoc-type-suggestion.rs:12:23 + --> $DIR/constraint-assoc-type-suggestion.rs:10:23 | LL | let b: Vec<i32> = a; | -------- ^ expected struct `Vec`, found associated type diff --git a/src/test/ui/generic-associated-types/construct_with_other_type.rs b/src/test/ui/generic-associated-types/construct_with_other_type.rs index 060804269..5cb07f558 100644 --- a/src/test/ui/generic-associated-types/construct_with_other_type.rs +++ b/src/test/ui/generic-associated-types/construct_with_other_type.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // check-pass use std::ops::Deref; diff --git a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr index c4009dd96..c81cd7e77 100644 --- a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr +++ b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr @@ -5,7 +5,7 @@ LL | type Bar = (); | ^^ the trait `AsRef<()>` is not implemented for `()` | note: required by a bound in `foo_defn::Foo::Bar` - --> $DIR/auxiliary/foo_defn.rs:6:15 + --> $DIR/auxiliary/foo_defn.rs:4:15 | LL | type Bar: AsRef<()>; | ^^^^^^^^^ required by this bound in `foo_defn::Foo::Bar` diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.rs b/src/test/ui/generic-associated-types/elided-in-expr-position.rs index 482d0d5c0..e40093305 100644 --- a/src/test/ui/generic-associated-types/elided-in-expr-position.rs +++ b/src/test/ui/generic-associated-types/elided-in-expr-position.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![allow(unused)] pub trait Trait { diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr index b395a1cfd..20f35c3c1 100644 --- a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr +++ b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `Trait::Assoc` - --> $DIR/elided-in-expr-position.rs:10:26 + --> $DIR/elided-in-expr-position.rs:9:26 | LL | fn g(&self) -> Self::Assoc; | ^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/elided-in-expr-position.rs:5:10 + --> $DIR/elided-in-expr-position.rs:4:10 | LL | type Assoc<'a> where Self: 'a; | ^^^^^ -- @@ -15,13 +15,13 @@ LL | fn g(&self) -> Self::Assoc<'a>; | ~~~~~~~~~ error[E0107]: missing generics for associated type `Trait::Assoc` - --> $DIR/elided-in-expr-position.rs:32:26 + --> $DIR/elided-in-expr-position.rs:31:26 | LL | fn g(&self) -> Self::Assoc { | ^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/elided-in-expr-position.rs:5:10 + --> $DIR/elided-in-expr-position.rs:4:10 | LL | type Assoc<'a> where Self: 'a; | ^^^^^ -- diff --git a/src/test/ui/generic-associated-types/empty_generics.rs b/src/test/ui/generic-associated-types/empty_generics.rs index 772b7f2b4..964c2972d 100644 --- a/src/test/ui/generic-associated-types/empty_generics.rs +++ b/src/test/ui/generic-associated-types/empty_generics.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Foo { type Bar<,>; //~^ ERROR expected one of `#`, `>`, `const`, identifier, or lifetime, found `,` diff --git a/src/test/ui/generic-associated-types/empty_generics.stderr b/src/test/ui/generic-associated-types/empty_generics.stderr index ac22bfc08..b753181cf 100644 --- a/src/test/ui/generic-associated-types/empty_generics.stderr +++ b/src/test/ui/generic-associated-types/empty_generics.stderr @@ -1,5 +1,5 @@ error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `,` - --> $DIR/empty_generics.rs:4:14 + --> $DIR/empty_generics.rs:2:14 | LL | trait Foo { | - while parsing this item list starting here diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr index 3da7794b3..614c4a34c 100644 --- a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr +++ b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/lending_iterator.rs:14:45 + --> $DIR/lending_iterator.rs:13:45 | LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self; | ------------------------------------------------------------------------ definition of `from_iter` from trait diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.rs b/src/test/ui/generic-associated-types/extended/lending_iterator.rs index ede164766..247761dd0 100644 --- a/src/test/ui/generic-associated-types/extended/lending_iterator.rs +++ b/src/test/ui/generic-associated-types/extended/lending_iterator.rs @@ -2,7 +2,6 @@ //[base] check-fail //[extended] check-pass -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr index 6c2a624ca..f6b0b644e 100644 --- a/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr +++ b/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/lending_iterator_2.rs:14:45 + --> $DIR/lending_iterator_2.rs:13:45 | LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self; | ------------------------------------------------------------------------ definition of `from_iter` from trait diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs b/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs index 3c4a2184d..eb9c0456a 100644 --- a/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs +++ b/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs @@ -2,7 +2,6 @@ //[base] check-fail //[extended] check-pass -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs deleted file mode 100644 index c1d68812e..000000000 --- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is -// missing the feature gate. - -struct Foo; - -trait MyTrait { - type Item<T>; - //~^ ERROR generic associated types are unstable [E0658] -} - -impl MyTrait for Foo { - type Item<T> = T; - //~^ ERROR generic associated types are unstable [E0658] -} - -fn main() { } diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr deleted file mode 100644 index 34f536dbe..000000000 --- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0658]: generic associated types are unstable - --> $DIR/gat-dont-ice-on-absent-feature-2.rs:7:5 - | -LL | type Item<T>; - | ^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0658]: generic associated types are unstable - --> $DIR/gat-dont-ice-on-absent-feature-2.rs:12:5 - | -LL | type Item<T> = T; - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs deleted file mode 100644 index e8fc47d2a..000000000 --- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs +++ /dev/null @@ -1,16 +0,0 @@ -// rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is -// missing the feature gate. - -struct Foo; - -impl Iterator for Foo { - type Item<'b> = &'b Foo; - //~^ ERROR generic associated types are unstable [E0658] - //~| ERROR lifetime parameters or bounds on type `Item` do not match the trait declaration - - fn next(&mut self) -> Option<Self::Item> { - None - } -} - -fn main() { } diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr deleted file mode 100644 index ec36886f7..000000000 --- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0658]: generic associated types are unstable - --> $DIR/gat-dont-ice-on-absent-feature.rs:7:5 - | -LL | type Item<'b> = &'b Foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error[E0195]: lifetime parameters or bounds on type `Item` do not match the trait declaration - --> $DIR/gat-dont-ice-on-absent-feature.rs:7:14 - | -LL | type Item<'b> = &'b Foo; - | ^^^^ lifetimes do not match type in trait - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0195, E0658. -For more information about an error, try `rustc --explain E0195`. diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs index f542a7f54..86b164ba7 100644 --- a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs +++ b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'x>; } diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr index 1792d8db2..b77f10084 100644 --- a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr +++ b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr @@ -1,5 +1,5 @@ error[E0261]: use of undeclared lifetime name `'x` - --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:8:35 + --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:6:35 | LL | fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {} | ^^ undeclared lifetime @@ -15,7 +15,7 @@ LL | fn _f<'x>(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {} | ++++ error[E0582]: binding for associated type `Y` references lifetime `'a`, which does not appear in the trait input types - --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:8:33 + --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:6:33 | LL | fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {} | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr b/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr index c2054f64e..fd54faaf3 100644 --- a/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr +++ b/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr @@ -1,11 +1,11 @@ error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/gat-in-trait-path.rs:27:17 + --> $DIR/gat-in-trait-path.rs:26:17 | LL | fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/gat-in-trait-path.rs:11:10 + --> $DIR/gat-in-trait-path.rs:10:10 | LL | trait Foo { | --- this trait cannot be made into an object... diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path.rs b/src/test/ui/generic-associated-types/gat-in-trait-path.rs index c82450ccf..c55f5a726 100644 --- a/src/test/ui/generic-associated-types/gat-in-trait-path.rs +++ b/src/test/ui/generic-associated-types/gat-in-trait-path.rs @@ -2,7 +2,6 @@ //[base] check-fail //[extended] check-pass -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/gat-incomplete-warning.rs b/src/test/ui/generic-associated-types/gat-incomplete-warning.rs deleted file mode 100644 index 607ea1759..000000000 --- a/src/test/ui/generic-associated-types/gat-incomplete-warning.rs +++ /dev/null @@ -1,5 +0,0 @@ -// run-pass - -#![feature(generic_associated_types)] - -fn main() {} diff --git a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs index dbf7e02ae..d00c036fb 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs +++ b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Foo { type F<'a>; diff --git a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr index dad0dae6a..cb2b9f32b 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr +++ b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr @@ -1,5 +1,5 @@ error[E0403]: the name `T1` is already used for a generic parameter in this item's generic parameters - --> $DIR/gat-trait-path-generic-type-arg.rs:11:12 + --> $DIR/gat-trait-path-generic-type-arg.rs:9:12 | LL | impl <T, T1> Foo for T { | -- first use of `T1` @@ -8,13 +8,13 @@ LL | type F<T1> = &[u8]; | ^^ already used error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/gat-trait-path-generic-type-arg.rs:11:18 + --> $DIR/gat-trait-path-generic-type-arg.rs:9:18 | LL | type F<T1> = &[u8]; | ^ explicit lifetime name needed here error[E0207]: the type parameter `T1` is not constrained by the impl trait, self type, or predicates - --> $DIR/gat-trait-path-generic-type-arg.rs:9:10 + --> $DIR/gat-trait-path-generic-type-arg.rs:7:10 | LL | impl <T, T1> Foo for T { | ^^ unconstrained type parameter diff --git a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs index 9864787f0..83b86f04a 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs +++ b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; diff --git a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr index aeb9238de..452dfefd1 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr +++ b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `X::Y` - --> $DIR/gat-trait-path-missing-lifetime.rs:10:20 + --> $DIR/gat-trait-path-missing-lifetime.rs:8:20 | LL | fn foo<'a, T1: X<Y = T1>>(t : T1) -> T1::Y<'a> { | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-missing-lifetime.rs:4:8 + --> $DIR/gat-trait-path-missing-lifetime.rs:2:8 | LL | type Y<'a>; | ^ -- @@ -15,13 +15,13 @@ LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> { | ~~~~~ error[E0107]: missing generics for associated type `X::Y` - --> $DIR/gat-trait-path-missing-lifetime.rs:10:20 + --> $DIR/gat-trait-path-missing-lifetime.rs:8:20 | LL | fn foo<'a, T1: X<Y = T1>>(t : T1) -> T1::Y<'a> { | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-missing-lifetime.rs:4:8 + --> $DIR/gat-trait-path-missing-lifetime.rs:2:8 | LL | type Y<'a>; | ^ -- diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs index c55b0530c..9eb069637 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs +++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; } diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index 162214063..e55a21e19 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr +++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr @@ -1,11 +1,11 @@ error: lifetime in trait object type must be followed by `+` - --> $DIR/gat-trait-path-parenthesised-args.rs:7:29 + --> $DIR/gat-trait-path-parenthesised-args.rs:5:29 | LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} | ^^ error: parenthesized generic arguments cannot be used in associated type constraints - --> $DIR/gat-trait-path-parenthesised-args.rs:7:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} | ^^^^^ @@ -16,7 +16,7 @@ LL | fn foo<'a>(arg: Box<dyn X<Y<'a> = &'a ()>>) {} | ~ ~ error: parenthesized generic arguments cannot be used in associated type constraints - --> $DIR/gat-trait-path-parenthesised-args.rs:14:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:12:27 | LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {} | ^-- @@ -24,13 +24,13 @@ LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {} | help: remove these parentheses error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:7:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:4:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 | LL | type Y<'a>; | ^ -- @@ -40,7 +40,7 @@ LL | fn foo<'a>(arg: Box<dyn X<Y('a, 'a) = &'a ()>>) {} | +++ error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:7:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} | ^---- help: remove these generics @@ -48,19 +48,19 @@ LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {} | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters - --> $DIR/gat-trait-path-parenthesised-args.rs:4:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 | LL | type Y<'a>; | ^ error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/gat-trait-path-parenthesised-args.rs:14:27 + --> $DIR/gat-trait-path-parenthesised-args.rs:12:27 | LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/gat-trait-path-parenthesised-args.rs:4:8 + --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 | LL | type Y<'a>; | ^ -- diff --git a/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs b/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs index d7c4dbda2..fdc5a7267 100644 --- a/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs +++ b/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(generic_associated_types)] - pub trait X { type Y<'a> where Self: 'a; fn m(&self) -> Self::Y<'_>; diff --git a/src/test/ui/generic-associated-types/generic-associated-types-where.rs b/src/test/ui/generic-associated-types/generic-associated-types-where.rs index 2ecbc8c59..bbdfffafe 100644 --- a/src/test/ui/generic-associated-types/generic-associated-types-where.rs +++ b/src/test/ui/generic-associated-types/generic-associated-types-where.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // Checking the interaction with this other feature #![feature(associated_type_defaults)] diff --git a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr index e866b3bab..9a745c099 100644 --- a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr +++ b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr @@ -1,5 +1,5 @@ error[E0277]: `T` doesn't implement `std::fmt::Display` - --> $DIR/generic-associated-types-where.rs:20:22 + --> $DIR/generic-associated-types-where.rs:18:22 | LL | type Assoc2<T> = Vec<T>; | ^^^^^^ `T` cannot be formatted with the default formatter @@ -11,7 +11,7 @@ LL | type Assoc2<T: std::fmt::Display> = Vec<T>; | +++++++++++++++++++ error[E0276]: impl has stricter requirements than trait - --> $DIR/generic-associated-types-where.rs:22:38 + --> $DIR/generic-associated-types-where.rs:20:38 | LL | type Assoc3<T>; | -------------- definition of `Assoc3` from trait diff --git a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs index 43058f7eb..2cb218bf8 100644 --- a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs +++ b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - use std::ops::Deref; trait Iterable { diff --git a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr index a4bb36190..396ff15ab 100644 --- a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr +++ b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr @@ -1,5 +1,5 @@ error[E0261]: use of undeclared lifetime name `'b` - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:8:37 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:6:37 | LL | + Deref<Target = Self::Item<'b>>; | ^^ undeclared lifetime @@ -19,7 +19,7 @@ LL | trait Iterable<'b> { | ++++ error[E0261]: use of undeclared lifetime name `'undeclared` - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:41 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:9:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; | ^^^^^^^^^^^ undeclared lifetime diff --git a/src/test/ui/generic-associated-types/impl_bounds.rs b/src/test/ui/generic-associated-types/impl_bounds.rs index ec1d171c0..01165fceb 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.rs +++ b/src/test/ui/generic-associated-types/impl_bounds.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] trait Foo { diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr index ce79c635a..442d4f336 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.stderr +++ b/src/test/ui/generic-associated-types/impl_bounds.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/impl_bounds.rs:15:39 + --> $DIR/impl_bounds.rs:14:39 | LL | type A<'a> where Self: 'a; | ---------- definition of `A` from trait @@ -8,7 +8,7 @@ LL | type A<'a> = (&'a ()) where Self: 'static; | ^^^^^^^ impl has extra requirement `T: 'static` error[E0276]: impl has stricter requirements than trait - --> $DIR/impl_bounds.rs:17:48 + --> $DIR/impl_bounds.rs:16:48 | LL | type B<'a, 'b> where 'a: 'b; | -------------- definition of `B` from trait @@ -17,7 +17,7 @@ LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; | ^^ impl has extra requirement `'b: 'a` error[E0478]: lifetime bound not satisfied - --> $DIR/impl_bounds.rs:17:22 + --> $DIR/impl_bounds.rs:16:22 | LL | type B<'a, 'b> where 'a: 'b; | -------------- definition of `B` from trait @@ -26,29 +26,29 @@ LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; | ^^^^^^^^^^^^^^^ - help: try copying this clause from the trait: `, 'a: 'b` | note: lifetime parameter instantiated with the lifetime `'a` as defined here - --> $DIR/impl_bounds.rs:17:12 + --> $DIR/impl_bounds.rs:16:12 | LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; | ^^ note: but lifetime parameter must outlive the lifetime `'b` as defined here - --> $DIR/impl_bounds.rs:17:16 + --> $DIR/impl_bounds.rs:16:16 | LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; | ^^ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/impl_bounds.rs:20:33 + --> $DIR/impl_bounds.rs:19:33 | LL | type C = String where Self: Copy; | ^^^^ the trait `Copy` is not implemented for `T` | -note: required because of the requirements on the impl of `Copy` for `Fooy<T>` - --> $DIR/impl_bounds.rs:11:10 +note: required for `Fooy<T>` to implement `Copy` + --> $DIR/impl_bounds.rs:10:10 | LL | #[derive(Copy, Clone)] | ^^^^ note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type - --> $DIR/impl_bounds.rs:7:10 + --> $DIR/impl_bounds.rs:6:10 | LL | trait Foo { | --- in this trait @@ -62,18 +62,18 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/impl_bounds.rs:22:24 + --> $DIR/impl_bounds.rs:21:24 | LL | fn d() where Self: Copy {} | ^^^^ the trait `Copy` is not implemented for `T` | -note: required because of the requirements on the impl of `Copy` for `Fooy<T>` - --> $DIR/impl_bounds.rs:11:10 +note: required for `Fooy<T>` to implement `Copy` + --> $DIR/impl_bounds.rs:10:10 | LL | #[derive(Copy, Clone)] | ^^^^ note: the requirement `Fooy<T>: Copy` appears on the `impl`'s method `d` but not on the corresponding trait's method - --> $DIR/impl_bounds.rs:8:8 + --> $DIR/impl_bounds.rs:7:8 | LL | trait Foo { | --- in this trait diff --git a/src/test/ui/generic-associated-types/impl_bounds_ok.rs b/src/test/ui/generic-associated-types/impl_bounds_ok.rs index 4df8235d9..88f829ea2 100644 --- a/src/test/ui/generic-associated-types/impl_bounds_ok.rs +++ b/src/test/ui/generic-associated-types/impl_bounds_ok.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] trait Foo { diff --git a/src/test/ui/generic-associated-types/issue-101020.rs b/src/test/ui/generic-associated-types/issue-101020.rs new file mode 100644 index 000000000..80d0fa5ad --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-101020.rs @@ -0,0 +1,35 @@ +pub trait LendingIterator { + type Item<'a> + where + Self: 'a; + + fn consume<F>(self, _f: F) + where + Self: Sized, + for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>, + { + } +} + +impl<I: LendingIterator + ?Sized> LendingIterator for &mut I { + type Item<'a> = I::Item<'a> where Self: 'a; +} +struct EmptyIter; +impl LendingIterator for EmptyIter { + type Item<'a> = &'a mut () where Self:'a; +} +pub trait FuncInput<'a, F> +where + F: Foo<Self>, + Self: Sized, +{ +} +impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {} +trait Foo<T> {} + +fn map_test() { + (&mut EmptyIter).consume(()); + //~^ ERROR the trait bound `for<'a> &'a mut (): Foo<&'a mut ()>` is not satisfied +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-101020.stderr b/src/test/ui/generic-associated-types/issue-101020.stderr new file mode 100644 index 000000000..b4e94cb83 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-101020.stderr @@ -0,0 +1,25 @@ +error[E0277]: the trait bound `for<'a> &'a mut (): Foo<&'a mut ()>` is not satisfied + --> $DIR/issue-101020.rs:31:5 + | +LL | (&mut EmptyIter).consume(()); + | ^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call + | | + | the trait `for<'a> Foo<&'a mut ()>` is not implemented for `&'a mut ()` + | +note: required for `&'a mut ()` to implement `for<'a> FuncInput<'a, &'a mut ()>` + --> $DIR/issue-101020.rs:27:20 + | +LL | impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {} + | ^^^^^^^^^^^^^^^^ ^ +note: required by a bound in `LendingIterator::consume` + --> $DIR/issue-101020.rs:9:33 + | +LL | fn consume<F>(self, _f: F) + | ------- required by a bound in this +... +LL | for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `LendingIterator::consume` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/generic-associated-types/issue-102114.rs b/src/test/ui/generic-associated-types/issue-102114.rs new file mode 100644 index 000000000..de31737ef --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-102114.rs @@ -0,0 +1,16 @@ +trait A { + type B<'b>; + fn a() -> Self::B<'static>; +} + +struct C; + +struct Wrapper<T>(T); + +impl A for C { + type B<T> = Wrapper<T>; + //~^ ERROR type `B` has 1 type parameter but its trait declaration has 0 type parameters + fn a() -> Self::B<'static> {} +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-102114.stderr b/src/test/ui/generic-associated-types/issue-102114.stderr new file mode 100644 index 000000000..8e41dee54 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-102114.stderr @@ -0,0 +1,12 @@ +error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters + --> $DIR/issue-102114.rs:11:12 + | +LL | type B<'b>; + | -- expected 0 type parameters +... +LL | type B<T> = Wrapper<T>; + | ^ found 1 type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0049`. diff --git a/src/test/ui/generic-associated-types/issue-102333.rs b/src/test/ui/generic-associated-types/issue-102333.rs new file mode 100644 index 000000000..6c7256332 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-102333.rs @@ -0,0 +1,15 @@ +// check-pass + +trait A { + type T: B<U<1i32> = ()>; +} + +trait B { + type U<const C: i32>; +} + +fn f<T: A>() { + let _: <<T as A>::T as B>::U<1i32> = (); +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-102335-gat.rs b/src/test/ui/generic-associated-types/issue-102335-gat.rs new file mode 100644 index 000000000..a7255fdcb --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-102335-gat.rs @@ -0,0 +1,12 @@ +trait T { + type A: S<C<(), i32 = ()> = ()>; + //~^ ERROR associated type bindings are not allowed here +} + +trait Q {} + +trait S { + type C<T>: Q; +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-102335-gat.stderr b/src/test/ui/generic-associated-types/issue-102335-gat.stderr new file mode 100644 index 000000000..7a7900a1e --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-102335-gat.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-102335-gat.rs:2:21 + | +LL | type A: S<C<(), i32 = ()> = ()>; + | ^^^^^^^^ 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/generic-associated-types/issue-47206-where-clause.rs b/src/test/ui/generic-associated-types/issue-47206-where-clause.rs index d352c1948..3d1b88ddf 100644 --- a/src/test/ui/generic-associated-types/issue-47206-where-clause.rs +++ b/src/test/ui/generic-associated-types/issue-47206-where-clause.rs @@ -1,7 +1,5 @@ // Check that this program doesn't cause the compiler to error without output. -#![feature(generic_associated_types)] - trait Foo { type Assoc3<T>; } diff --git a/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr b/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr index 31948a878..7006744df 100644 --- a/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr +++ b/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/issue-47206-where-clause.rs:12:38 + --> $DIR/issue-47206-where-clause.rs:10:38 | LL | type Assoc3<T>; | -------------- definition of `Assoc3` from trait diff --git a/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs b/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs index e87a76825..625ccfe89 100644 --- a/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs +++ b/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Cert { type PublicKey<'a>: From<&'a [u8]>; } diff --git a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs index d74d6d056..c1140bff8 100644 --- a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs +++ b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // check-pass trait Iterator { diff --git a/src/test/ui/generic-associated-types/issue-67424.rs b/src/test/ui/generic-associated-types/issue-67424.rs index fa35a3e8b..b6c7c70cd 100644 --- a/src/test/ui/generic-associated-types/issue-67424.rs +++ b/src/test/ui/generic-associated-types/issue-67424.rs @@ -1,3 +1,4 @@ +// check-pass // Fixed by #67160 trait Trait1 { @@ -6,7 +7,6 @@ trait Trait1 { trait Trait2 { type Type1<B>: Trait1<A=B>; - //~^ ERROR: generic associated types are unstable } fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-67424.stderr b/src/test/ui/generic-associated-types/issue-67424.stderr deleted file mode 100644 index bbb7d56f5..000000000 --- a/src/test/ui/generic-associated-types/issue-67424.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: generic associated types are unstable - --> $DIR/issue-67424.rs:8:5 - | -LL | type Type1<B>: Trait1<A=B>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information - = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr b/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr index 74a616aaa..4cc68530e 100644 --- a/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr +++ b/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr @@ -1,11 +1,11 @@ error[E0038]: the trait `X` cannot be made into an object - --> $DIR/issue-67510-pass.rs:13:23 + --> $DIR/issue-67510-pass.rs:12:23 | LL | fn _func1<'a>(_x: Box<dyn X<Y<'a>=&'a ()>>) {} | ^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-67510-pass.rs:10:10 + --> $DIR/issue-67510-pass.rs:9:10 | LL | trait X { | - this trait cannot be made into an object... diff --git a/src/test/ui/generic-associated-types/issue-67510-pass.rs b/src/test/ui/generic-associated-types/issue-67510-pass.rs index c5b02ff9a..66ce3e807 100644 --- a/src/test/ui/generic-associated-types/issue-67510-pass.rs +++ b/src/test/ui/generic-associated-types/issue-67510-pass.rs @@ -2,7 +2,6 @@ //[base] check-fail //[extended] check-pass -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/issue-67510.rs b/src/test/ui/generic-associated-types/issue-67510.rs index 5725b660a..ab5c25d74 100644 --- a/src/test/ui/generic-associated-types/issue-67510.rs +++ b/src/test/ui/generic-associated-types/issue-67510.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; } diff --git a/src/test/ui/generic-associated-types/issue-67510.stderr b/src/test/ui/generic-associated-types/issue-67510.stderr index 8aeda22ba..d25c5b0f3 100644 --- a/src/test/ui/generic-associated-types/issue-67510.stderr +++ b/src/test/ui/generic-associated-types/issue-67510.stderr @@ -1,5 +1,5 @@ error[E0261]: use of undeclared lifetime name `'a` - --> $DIR/issue-67510.rs:7:21 + --> $DIR/issue-67510.rs:5:21 | LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {} | ^^ undeclared lifetime @@ -15,7 +15,7 @@ LL | fn f<'a>(x: Box<dyn X<Y<'a> = &'a ()>>) {} | ++++ error[E0261]: use of undeclared lifetime name `'a` - --> $DIR/issue-67510.rs:7:28 + --> $DIR/issue-67510.rs:5:28 | LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {} | ^^ undeclared lifetime @@ -30,13 +30,13 @@ LL | fn f<'a>(x: Box<dyn X<Y<'a> = &'a ()>>) {} | ++++ error[E0038]: the trait `X` cannot be made into an object - --> $DIR/issue-67510.rs:7:13 + --> $DIR/issue-67510.rs:5:13 | LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {} | ^^^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-67510.rs:4:10 + --> $DIR/issue-67510.rs:2:10 | LL | trait X { | - this trait cannot be made into an object... diff --git a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs index 617d985dc..f1e779fcb 100644 --- a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs +++ b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs @@ -1,7 +1,5 @@ // Regression test for #68641 -#![feature(generic_associated_types)] - trait UnsafeCopy { type Item<'a>: Copy; diff --git a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr index 2e21b38cb..6bb7492af 100644 --- a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr +++ b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-68641-check-gat-bounds.rs:14:21 + --> $DIR/issue-68641-check-gat-bounds.rs:12:21 | LL | type Item<'a> = T; | ^ the trait `Copy` is not implemented for `T` | note: required by a bound in `UnsafeCopy::Item` - --> $DIR/issue-68641-check-gat-bounds.rs:6:20 + --> $DIR/issue-68641-check-gat-bounds.rs:4:20 | LL | type Item<'a>: Copy; | ^^^^ required by this bound in `UnsafeCopy::Item` diff --git a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs index def0ad18f..f5502adee 100644 --- a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs +++ b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs @@ -1,7 +1,5 @@ // Regression test for #68642 -#![feature(generic_associated_types)] - trait Fun { type F<'a>: Fn() -> u32; diff --git a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr index 713cc744f..07452137b 100644 --- a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr +++ b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr @@ -1,12 +1,12 @@ error[E0277]: expected a `Fn<()>` closure, found `T` - --> $DIR/issue-68642-broken-llvm-ir.rs:14:18 + --> $DIR/issue-68642-broken-llvm-ir.rs:12:18 | LL | type F<'a> = Self; | ^^^^ expected an `Fn<()>` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` - --> $DIR/issue-68642-broken-llvm-ir.rs:6:17 + --> $DIR/issue-68642-broken-llvm-ir.rs:4:17 | LL | type F<'a>: Fn() -> u32; | ^^^^^^^^^^^ required by this bound in `Fun::F` diff --git a/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs b/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs index 9af065b5d..6050a8bf5 100644 --- a/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs +++ b/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs @@ -1,7 +1,5 @@ // Regression test for #68643 -#![feature(generic_associated_types)] - trait Fun { type F<'a>: Fn() -> u32; diff --git a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr index a7b7f64cd..31ded5dab 100644 --- a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr +++ b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr @@ -1,12 +1,12 @@ error[E0277]: expected a `Fn<()>` closure, found `T` - --> $DIR/issue-68643-broken-mir.rs:14:18 + --> $DIR/issue-68643-broken-mir.rs:12:18 | LL | type F<'a> = Self; | ^^^^ expected an `Fn<()>` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` - --> $DIR/issue-68643-broken-mir.rs:6:17 + --> $DIR/issue-68643-broken-mir.rs:4:17 | LL | type F<'a>: Fn() -> u32; | ^^^^^^^^^^^ required by this bound in `Fun::F` diff --git a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs index 1d2636c26..898cfa1e7 100644 --- a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs +++ b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs @@ -1,7 +1,5 @@ // Regression test for #68644 -#![feature(generic_associated_types)] - trait Fun { type F<'a>: Fn() -> u32; diff --git a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr index 5e921e053..e2f9930cc 100644 --- a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr +++ b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr @@ -1,12 +1,12 @@ error[E0277]: expected a `Fn<()>` closure, found `T` - --> $DIR/issue-68644-codegen-selection.rs:14:18 + --> $DIR/issue-68644-codegen-selection.rs:12:18 | LL | type F<'a> = Self; | ^^^^ expected an `Fn<()>` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` - --> $DIR/issue-68644-codegen-selection.rs:6:17 + --> $DIR/issue-68644-codegen-selection.rs:4:17 | LL | type F<'a>: Fn() -> u32; | ^^^^^^^^^^^ required by this bound in `Fun::F` diff --git a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs index aa505064f..60b065bfc 100644 --- a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs +++ b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs @@ -1,7 +1,5 @@ // Regression test for #68645 -#![feature(generic_associated_types)] - trait Fun { type F<'a>: Fn() -> u32; diff --git a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr index 7edcdce62..0065368ad 100644 --- a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr +++ b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr @@ -1,12 +1,12 @@ error[E0277]: expected a `Fn<()>` closure, found `T` - --> $DIR/issue-68645-codegen-fulfillment.rs:14:18 + --> $DIR/issue-68645-codegen-fulfillment.rs:12:18 | LL | type F<'a> = Self; | ^^^^ expected an `Fn<()>` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` - --> $DIR/issue-68645-codegen-fulfillment.rs:6:17 + --> $DIR/issue-68645-codegen-fulfillment.rs:4:17 | LL | type F<'a>: Fn() -> u32; | ^^^^^^^^^^^ required by this bound in `Fun::F` diff --git a/src/test/ui/generic-associated-types/issue-68648-1.rs b/src/test/ui/generic-associated-types/issue-68648-1.rs index 17bc034b3..0df41bab3 100644 --- a/src/test/ui/generic-associated-types/issue-68648-1.rs +++ b/src/test/ui/generic-associated-types/issue-68648-1.rs @@ -1,8 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - - trait Fun { type F<'a>; diff --git a/src/test/ui/generic-associated-types/issue-68648-2.rs b/src/test/ui/generic-associated-types/issue-68648-2.rs index 6c9a0d126..0f963d58f 100644 --- a/src/test/ui/generic-associated-types/issue-68648-2.rs +++ b/src/test/ui/generic-associated-types/issue-68648-2.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Fun { type F<'a>; diff --git a/src/test/ui/generic-associated-types/issue-68648-2.stderr b/src/test/ui/generic-associated-types/issue-68648-2.stderr index 06c1efcd8..b2bef19eb 100644 --- a/src/test/ui/generic-associated-types/issue-68648-2.stderr +++ b/src/test/ui/generic-associated-types/issue-68648-2.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-68648-2.rs:14:17 + --> $DIR/issue-68648-2.rs:12:17 | LL | fn bug<'a, T: Fun<F<'a> = T>>(t: T) -> T::F<'a> { | - this type parameter @@ -11,7 +11,7 @@ LL | T::identity(()) = note: expected type parameter `T` found unit type `()` note: associated function defined here - --> $DIR/issue-68648-2.rs:6:8 + --> $DIR/issue-68648-2.rs:4:8 | LL | fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t } | ^^^^^^^^ -------------- diff --git a/src/test/ui/generic-associated-types/issue-68649-pass.rs b/src/test/ui/generic-associated-types/issue-68649-pass.rs index 33f08faff..772743877 100644 --- a/src/test/ui/generic-associated-types/issue-68649-pass.rs +++ b/src/test/ui/generic-associated-types/issue-68649-pass.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Fun { type F<'a>; diff --git a/src/test/ui/generic-associated-types/issue-68653.rs b/src/test/ui/generic-associated-types/issue-68653.rs index 1e84717e9..170b87cf2 100644 --- a/src/test/ui/generic-associated-types/issue-68653.rs +++ b/src/test/ui/generic-associated-types/issue-68653.rs @@ -2,8 +2,6 @@ // check-pass -#![feature(generic_associated_types)] - trait Fun { type F<'a: 'a>; } diff --git a/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs b/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs index c0d933362..607cfed0b 100644 --- a/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs +++ b/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs @@ -1,7 +1,5 @@ // Regression test for #68656 -#![feature(generic_associated_types)] - trait UnsafeCopy<T: Copy> { type Item<'a>: std::ops::Deref<Target = T>; diff --git a/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr b/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr index 8e0f23716..e8770aedf 100644 --- a/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr +++ b/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr @@ -1,5 +1,5 @@ error[E0271]: type mismatch resolving `<T as Deref>::Target == T` - --> $DIR/issue-68656-unsized-values.rs:15:21 + --> $DIR/issue-68656-unsized-values.rs:13:21 | LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T { | - this type parameter @@ -9,7 +9,7 @@ LL | type Item<'a> = T; = note: expected type parameter `T` found associated type `<T as Deref>::Target` note: required by a bound in `UnsafeCopy::Item` - --> $DIR/issue-68656-unsized-values.rs:6:36 + --> $DIR/issue-68656-unsized-values.rs:4:36 | LL | type Item<'a>: std::ops::Deref<Target = T>; | ^^^^^^^^^^ required by this bound in `UnsafeCopy::Item` diff --git a/src/test/ui/generic-associated-types/issue-70303.rs b/src/test/ui/generic-associated-types/issue-70303.rs index 568996e1a..0edff5e4e 100644 --- a/src/test/ui/generic-associated-types/issue-70303.rs +++ b/src/test/ui/generic-associated-types/issue-70303.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Document { type Cursor<'a>: DocCursor<'a> where Self: 'a; diff --git a/src/test/ui/generic-associated-types/issue-70304.rs b/src/test/ui/generic-associated-types/issue-70304.rs index f778f985c..8898d4c7d 100644 --- a/src/test/ui/generic-associated-types/issue-70304.rs +++ b/src/test/ui/generic-associated-types/issue-70304.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Document { type Cursor<'a>: DocCursor<'a>; //~^ ERROR: missing required bound on `Cursor` diff --git a/src/test/ui/generic-associated-types/issue-70304.stderr b/src/test/ui/generic-associated-types/issue-70304.stderr index bba7cab70..99339e968 100644 --- a/src/test/ui/generic-associated-types/issue-70304.stderr +++ b/src/test/ui/generic-associated-types/issue-70304.stderr @@ -1,11 +1,11 @@ error[E0637]: `'_` cannot be used here - --> $DIR/issue-70304.rs:48:41 + --> $DIR/issue-70304.rs:46:41 | LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> { | ^^ `'_` is a reserved lifetime name error[E0106]: missing lifetime specifier - --> $DIR/issue-70304.rs:48:61 + --> $DIR/issue-70304.rs:46:61 | LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> { | ^^ expected named lifetime parameter @@ -17,7 +17,7 @@ LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'static>> { | ~~~~~~~ error: missing required bound on `Cursor` - --> $DIR/issue-70304.rs:4:5 + --> $DIR/issue-70304.rs:2:5 | LL | type Cursor<'a>: DocCursor<'a>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- diff --git a/src/test/ui/generic-associated-types/issue-71176.rs b/src/test/ui/generic-associated-types/issue-71176.rs index c2f0d59f4..f0e162d82 100644 --- a/src/test/ui/generic-associated-types/issue-71176.rs +++ b/src/test/ui/generic-associated-types/issue-71176.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Provider { type A<'a>; } diff --git a/src/test/ui/generic-associated-types/issue-71176.stderr b/src/test/ui/generic-associated-types/issue-71176.stderr index 08c8d4162..386c97161 100644 --- a/src/test/ui/generic-associated-types/issue-71176.stderr +++ b/src/test/ui/generic-associated-types/issue-71176.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `Provider::A` - --> $DIR/issue-71176.rs:12:27 + --> $DIR/issue-71176.rs:10:27 | LL | inner: Box<dyn Provider<A = B>>, | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-71176.rs:4:10 + --> $DIR/issue-71176.rs:2:10 | LL | type A<'a>; | ^ -- diff --git a/src/test/ui/generic-associated-types/issue-74684-1.rs b/src/test/ui/generic-associated-types/issue-74684-1.rs index 0e3899a88..e9ec80074 100644 --- a/src/test/ui/generic-associated-types/issue-74684-1.rs +++ b/src/test/ui/generic-associated-types/issue-74684-1.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Fun { type F<'a>: ?Sized; diff --git a/src/test/ui/generic-associated-types/issue-74684-1.stderr b/src/test/ui/generic-associated-types/issue-74684-1.stderr index 2cd050ed8..cacc97307 100644 --- a/src/test/ui/generic-associated-types/issue-74684-1.stderr +++ b/src/test/ui/generic-associated-types/issue-74684-1.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/issue-74684-1.rs:15:26 + --> $DIR/issue-74684-1.rs:13:26 | LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(_ : Box<T>) -> &'static T::F<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/generic-associated-types/issue-74684-2.rs b/src/test/ui/generic-associated-types/issue-74684-2.rs index fca55070b..ff243af2c 100644 --- a/src/test/ui/generic-associated-types/issue-74684-2.rs +++ b/src/test/ui/generic-associated-types/issue-74684-2.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Fun { type F<'a>: ?Sized; diff --git a/src/test/ui/generic-associated-types/issue-74684-2.stderr b/src/test/ui/generic-associated-types/issue-74684-2.stderr index f0e03e73f..59b85abf5 100644 --- a/src/test/ui/generic-associated-types/issue-74684-2.stderr +++ b/src/test/ui/generic-associated-types/issue-74684-2.stderr @@ -1,16 +1,18 @@ error[E0271]: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]` - --> $DIR/issue-74684-2.rs:23:5 + --> $DIR/issue-74684-2.rs:21:9 | LL | bug(Box::new(x)); - | ^^^ type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]` + | --- ^^^^^^^^^^^ type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]` + | | + | required by a bound introduced by this call | note: expected this to be `[u8]` - --> $DIR/issue-74684-2.rs:10:18 + --> $DIR/issue-74684-2.rs:8:18 | LL | type F<'a> = i32; | ^^^ note: required by a bound in `bug` - --> $DIR/issue-74684-2.rs:13:28 + --> $DIR/issue-74684-2.rs:11:28 | LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> { | ^^^^^^^^^^^^ required by this bound in `bug` diff --git a/src/test/ui/generic-associated-types/issue-74816.rs b/src/test/ui/generic-associated-types/issue-74816.rs index c932025d1..344afb87f 100644 --- a/src/test/ui/generic-associated-types/issue-74816.rs +++ b/src/test/ui/generic-associated-types/issue-74816.rs @@ -1,5 +1,4 @@ #![feature(associated_type_defaults)] -#![feature(generic_associated_types)] trait Trait1 { fn foo(); diff --git a/src/test/ui/generic-associated-types/issue-74816.stderr b/src/test/ui/generic-associated-types/issue-74816.stderr index 9eaa74e34..45018e697 100644 --- a/src/test/ui/generic-associated-types/issue-74816.stderr +++ b/src/test/ui/generic-associated-types/issue-74816.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `Self: Trait1` is not satisfied - --> $DIR/issue-74816.rs:9:31 + --> $DIR/issue-74816.rs:8:31 | LL | type Associated: Trait1 = Self; | ^^^^ the trait `Trait1` is not implemented for `Self` | note: required by a bound in `Trait2::Associated` - --> $DIR/issue-74816.rs:9:22 + --> $DIR/issue-74816.rs:8:22 | LL | type Associated: Trait1 = Self; | ^^^^^^ required by this bound in `Trait2::Associated` @@ -15,13 +15,13 @@ LL | trait Trait2: Trait1 { | ++++++++ error[E0277]: the size for values of type `Self` cannot be known at compilation time - --> $DIR/issue-74816.rs:9:31 + --> $DIR/issue-74816.rs:8:31 | LL | type Associated: Trait1 = Self; | ^^^^ doesn't have a size known at compile-time | note: required by a bound in `Trait2::Associated` - --> $DIR/issue-74816.rs:9:5 + --> $DIR/issue-74816.rs:8:5 | LL | type Associated: Trait1 = Self; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated` diff --git a/src/test/ui/generic-associated-types/issue-74824.rs b/src/test/ui/generic-associated-types/issue-74824.rs index 1bbf7aac5..10c45d133 100644 --- a/src/test/ui/generic-associated-types/issue-74824.rs +++ b/src/test/ui/generic-associated-types/issue-74824.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] use std::ops::Deref; diff --git a/src/test/ui/generic-associated-types/issue-74824.stderr b/src/test/ui/generic-associated-types/issue-74824.stderr index 8517eb9fa..623adb1c2 100644 --- a/src/test/ui/generic-associated-types/issue-74824.stderr +++ b/src/test/ui/generic-associated-types/issue-74824.stderr @@ -1,24 +1,24 @@ error[E0277]: the trait bound `Box<T>: Copy` is not satisfied - --> $DIR/issue-74824.rs:7:26 + --> $DIR/issue-74824.rs:6:26 | LL | type Copy<T>: Copy = Box<T>; | ^^^^^^ the trait `Copy` is not implemented for `Box<T>` | note: required by a bound in `UnsafeCopy::Copy` - --> $DIR/issue-74824.rs:7:19 + --> $DIR/issue-74824.rs:6:19 | LL | type Copy<T>: Copy = Box<T>; | ^^^^ required by this bound in `UnsafeCopy::Copy` error[E0277]: the trait bound `T: Clone` is not satisfied - --> $DIR/issue-74824.rs:7:26 + --> $DIR/issue-74824.rs:6:26 | LL | type Copy<T>: Copy = Box<T>; | ^^^^^^ the trait `Clone` is not implemented for `T` | - = note: required because of the requirements on the impl of `Clone` for `Box<T>` + = note: required for `Box<T>` to implement `Clone` note: required by a bound in `UnsafeCopy::Copy` - --> $DIR/issue-74824.rs:7:19 + --> $DIR/issue-74824.rs:6:19 | LL | type Copy<T>: Copy = Box<T>; | ^^^^ required by this bound in `UnsafeCopy::Copy` diff --git a/src/test/ui/generic-associated-types/issue-76407.rs b/src/test/ui/generic-associated-types/issue-76407.rs index a8141829b..9556ec6da 100644 --- a/src/test/ui/generic-associated-types/issue-76407.rs +++ b/src/test/ui/generic-associated-types/issue-76407.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Marker {} impl Marker for u32 {} diff --git a/src/test/ui/generic-associated-types/issue-76535.base.stderr b/src/test/ui/generic-associated-types/issue-76535.base.stderr index 5decd58bb..088f69b09 100644 --- a/src/test/ui/generic-associated-types/issue-76535.base.stderr +++ b/src/test/ui/generic-associated-types/issue-76535.base.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `SuperTrait::SubType` - --> $DIR/issue-76535.rs:40:33 + --> $DIR/issue-76535.rs:39:33 | LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); | ^^^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-76535.rs:10:10 + --> $DIR/issue-76535.rs:9:10 | LL | type SubType<'a>: SubTrait where Self: 'a; | ^^^^^^^ -- @@ -15,13 +15,13 @@ LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperS | ~~~~~~~~~~~ error[E0038]: the trait `SuperTrait` cannot be made into an object - --> $DIR/issue-76535.rs:40:14 + --> $DIR/issue-76535.rs:39:14 | LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-76535.rs:10:10 + --> $DIR/issue-76535.rs:9:10 | LL | pub trait SuperTrait { | ---------- this trait cannot be made into an object... @@ -30,20 +30,20 @@ LL | type SubType<'a>: SubTrait where Self: 'a; = help: consider moving `SubType` to another trait error[E0038]: the trait `SuperTrait` cannot be made into an object - --> $DIR/issue-76535.rs:40:57 + --> $DIR/issue-76535.rs:39:57 | LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-76535.rs:10:10 + --> $DIR/issue-76535.rs:9:10 | LL | pub trait SuperTrait { | ---------- this trait cannot be made into an object... LL | type SubType<'a>: SubTrait where Self: 'a; | ^^^^^^^ ...because it contains the generic associated type `SubType` = help: consider moving `SubType` to another trait - = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>` for `Box<SuperStruct>` + = note: required for `Box<SuperStruct>` to implement `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>` = note: required by cast to type `Box<dyn SuperTrait<SubType = SubStruct<'_>>>` error: aborting due to 3 previous errors diff --git a/src/test/ui/generic-associated-types/issue-76535.extended.stderr b/src/test/ui/generic-associated-types/issue-76535.extended.stderr index 067d0489b..e79f0a73f 100644 --- a/src/test/ui/generic-associated-types/issue-76535.extended.stderr +++ b/src/test/ui/generic-associated-types/issue-76535.extended.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `SuperTrait::SubType` - --> $DIR/issue-76535.rs:40:33 + --> $DIR/issue-76535.rs:39:33 | LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); | ^^^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-76535.rs:10:10 + --> $DIR/issue-76535.rs:9:10 | LL | type SubType<'a>: SubTrait where Self: 'a; | ^^^^^^^ -- diff --git a/src/test/ui/generic-associated-types/issue-76535.rs b/src/test/ui/generic-associated-types/issue-76535.rs index 46f217ba0..2457a05a0 100644 --- a/src/test/ui/generic-associated-types/issue-76535.rs +++ b/src/test/ui/generic-associated-types/issue-76535.rs @@ -1,6 +1,5 @@ // revisions: base extended -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/issue-76826.rs b/src/test/ui/generic-associated-types/issue-76826.rs index 28eb3b0e7..ead78453e 100644 --- a/src/test/ui/generic-associated-types/issue-76826.rs +++ b/src/test/ui/generic-associated-types/issue-76826.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(generic_associated_types)] - pub trait Iter { type Item<'a> where Self: 'a; diff --git a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs index 850d83be6..fd3b967d9 100644 --- a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs +++ b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs @@ -1,9 +1,7 @@ -// Test for diagnostics when we have mismatched lifetime due to implict 'static lifetime in GATs +// Test for diagnostics when we have mismatched lifetime due to implicit 'static lifetime in GATs // check-fail -#![feature(generic_associated_types)] - pub trait A {} impl A for &dyn A {} impl A for Box<dyn A> {} diff --git a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr index d487f19ba..86e0f5745 100644 --- a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr +++ b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr @@ -1,22 +1,22 @@ error: incompatible lifetime on type - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:17:18 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:18 | LL | type T<'a> = Box<dyn A + 'a>; | ^^^^^^^^^^^^^^^ | note: because this has an unmet lifetime requirement - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:12:17 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:10:17 | LL | type T<'a>: A; | ^ introduces a `'static` lifetime requirement note: the lifetime `'a` as defined here... - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:17:12 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:12 | LL | type T<'a> = Box<dyn A + 'a>; | ^^ = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl` note: this has an implicit `'static` lifetime requirement - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:9:20 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:7:20 | LL | impl A for Box<dyn A> {} | ^ @@ -26,51 +26,51 @@ LL | impl A for Box<dyn A + '_> {} | ++++ error: incompatible lifetime on type - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:18 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:18 | LL | type T<'a> = Box<dyn A + 'a>; | ^^^^^^^^^^^^^^^ | note: because this has an unmet lifetime requirement - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:23:17 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:17 | LL | type T<'a>: C; | ^ introduces a `'static` lifetime requirement note: the lifetime `'a` as defined here... - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:12 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:12 | LL | type T<'a> = Box<dyn A + 'a>; | ^^ note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl` - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:1 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:19:1 | LL | impl C for Box<dyn A + 'static> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: incompatible lifetime on type - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:18 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:18 | LL | type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: because this has an unmet lifetime requirement - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:33:17 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:17 | LL | type T<'a>: E; | ^ introduces a `'static` lifetime requirement note: the lifetime `'a` as defined here... - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:12 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:12 | LL | type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>); | ^^ = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl` note: this has an implicit `'static` lifetime requirement - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:21 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:21 | LL | impl E for (Box<dyn A>, Box<dyn A>) {} | ^ note: this has an implicit `'static` lifetime requirement - --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:33 + --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:33 | LL | impl E for (Box<dyn A>, Box<dyn A>) {} | ^ diff --git a/src/test/ui/generic-associated-types/issue-78671.base.stderr b/src/test/ui/generic-associated-types/issue-78671.base.stderr index 6bcd004b1..514f8d45a 100644 --- a/src/test/ui/generic-associated-types/issue-78671.base.stderr +++ b/src/test/ui/generic-associated-types/issue-78671.base.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `CollectionFamily::Member` - --> $DIR/issue-78671.rs:11:47 + --> $DIR/issue-78671.rs:10:47 | LL | Box::new(Family) as &dyn CollectionFamily<Member=usize> | ^^^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-78671.rs:8:10 + --> $DIR/issue-78671.rs:7:10 | LL | type Member<T>; | ^^^^^^ - @@ -15,13 +15,13 @@ LL | Box::new(Family) as &dyn CollectionFamily<Member<T>=usize> | ~~~~~~~~~ error[E0038]: the trait `CollectionFamily` cannot be made into an object - --> $DIR/issue-78671.rs:11:25 + --> $DIR/issue-78671.rs:10:25 | LL | Box::new(Family) as &dyn CollectionFamily<Member=usize> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `CollectionFamily` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-78671.rs:8:10 + --> $DIR/issue-78671.rs:7:10 | LL | trait CollectionFamily { | ---------------- this trait cannot be made into an object... diff --git a/src/test/ui/generic-associated-types/issue-78671.extended.stderr b/src/test/ui/generic-associated-types/issue-78671.extended.stderr index f1b489335..6fa09a4c7 100644 --- a/src/test/ui/generic-associated-types/issue-78671.extended.stderr +++ b/src/test/ui/generic-associated-types/issue-78671.extended.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `CollectionFamily::Member` - --> $DIR/issue-78671.rs:11:47 + --> $DIR/issue-78671.rs:10:47 | LL | Box::new(Family) as &dyn CollectionFamily<Member=usize> | ^^^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-78671.rs:8:10 + --> $DIR/issue-78671.rs:7:10 | LL | type Member<T>; | ^^^^^^ - diff --git a/src/test/ui/generic-associated-types/issue-78671.rs b/src/test/ui/generic-associated-types/issue-78671.rs index c09dac28b..327b0c14a 100644 --- a/src/test/ui/generic-associated-types/issue-78671.rs +++ b/src/test/ui/generic-associated-types/issue-78671.rs @@ -1,6 +1,5 @@ // revisions: base extended -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/issue-79422.base.stderr b/src/test/ui/generic-associated-types/issue-79422.base.stderr index 404c975d6..3c1a29d48 100644 --- a/src/test/ui/generic-associated-types/issue-79422.base.stderr +++ b/src/test/ui/generic-associated-types/issue-79422.base.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `MapLike::VRefCont` - --> $DIR/issue-79422.rs:48:36 + --> $DIR/issue-79422.rs:47:36 | LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>; | ^^^^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-79422.rs:24:10 + --> $DIR/issue-79422.rs:23:10 | LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; | ^^^^^^^^ -- @@ -15,13 +15,13 @@ LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>; | ~~~~~~~~~~~~ error[E0038]: the trait `MapLike` cannot be made into an object - --> $DIR/issue-79422.rs:48:12 + --> $DIR/issue-79422.rs:47:12 | LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-79422.rs:24:10 + --> $DIR/issue-79422.rs:23:10 | LL | trait MapLike<K, V> { | ------- this trait cannot be made into an object... @@ -30,20 +30,20 @@ LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; = help: consider moving `VRefCont` to another trait error[E0038]: the trait `MapLike` cannot be made into an object - --> $DIR/issue-79422.rs:45:13 + --> $DIR/issue-79422.rs:44:13 | LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-79422.rs:24:10 + --> $DIR/issue-79422.rs:23:10 | LL | trait MapLike<K, V> { | ------- this trait cannot be made into an object... LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; | ^^^^^^^^ ...because it contains the generic associated type `VRefCont` = help: consider moving `VRefCont` to another trait - = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>>` for `Box<BTreeMap<u8, u8>>` + = note: required for `Box<BTreeMap<u8, u8>>` to implement `CoerceUnsized<Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>>` = note: required by cast to type `Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>` error: aborting due to 3 previous errors diff --git a/src/test/ui/generic-associated-types/issue-79422.extended.stderr b/src/test/ui/generic-associated-types/issue-79422.extended.stderr index 9bcbd7471..58c921bf0 100644 --- a/src/test/ui/generic-associated-types/issue-79422.extended.stderr +++ b/src/test/ui/generic-associated-types/issue-79422.extended.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `MapLike::VRefCont` - --> $DIR/issue-79422.rs:48:36 + --> $DIR/issue-79422.rs:47:36 | LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>; | ^^^^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-79422.rs:24:10 + --> $DIR/issue-79422.rs:23:10 | LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; | ^^^^^^^^ -- @@ -15,13 +15,13 @@ LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>; | ~~~~~~~~~~~~ error[E0271]: type mismatch resolving `<BTreeMap<u8, u8> as MapLike<u8, u8>>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)` - --> $DIR/issue-79422.rs:45:13 + --> $DIR/issue-79422.rs:44:13 | LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<BTreeMap<u8, u8> as MapLike<u8, u8>>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)` | note: expected this to be `(dyn RefCont<'_, u8> + 'static)` - --> $DIR/issue-79422.rs:29:25 + --> $DIR/issue-79422.rs:28:25 | LL | type VRefCont<'a> = &'a V where Self: 'a; | ^^^^^ diff --git a/src/test/ui/generic-associated-types/issue-79422.rs b/src/test/ui/generic-associated-types/issue-79422.rs index 7749975e6..a52dd792d 100644 --- a/src/test/ui/generic-associated-types/issue-79422.rs +++ b/src/test/ui/generic-associated-types/issue-79422.rs @@ -1,6 +1,5 @@ // revisions: base extended -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/issue-79636-1.rs b/src/test/ui/generic-associated-types/issue-79636-1.rs index 6d73fd68d..a89039b5c 100644 --- a/src/test/ui/generic-associated-types/issue-79636-1.rs +++ b/src/test/ui/generic-associated-types/issue-79636-1.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Monad { type Unwrapped; type Wrapped<B>; diff --git a/src/test/ui/generic-associated-types/issue-79636-1.stderr b/src/test/ui/generic-associated-types/issue-79636-1.stderr index 1ecb86282..155477048 100644 --- a/src/test/ui/generic-associated-types/issue-79636-1.stderr +++ b/src/test/ui/generic-associated-types/issue-79636-1.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `Monad::Wrapped` - --> $DIR/issue-79636-1.rs:15:34 + --> $DIR/issue-79636-1.rs:13:34 | LL | MInner: Monad<Unwrapped = A, Wrapped = MOuter::Wrapped<A>>, | ^^^^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `B` - --> $DIR/issue-79636-1.rs:5:10 + --> $DIR/issue-79636-1.rs:3:10 | LL | type Wrapped<B>; | ^^^^^^^ - diff --git a/src/test/ui/generic-associated-types/issue-79636-2.rs b/src/test/ui/generic-associated-types/issue-79636-2.rs index cdaf2e483..ff5ff38c9 100644 --- a/src/test/ui/generic-associated-types/issue-79636-2.rs +++ b/src/test/ui/generic-associated-types/issue-79636-2.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait SomeTrait { type Wrapped<A>: SomeTrait; diff --git a/src/test/ui/generic-associated-types/issue-79636-2.stderr b/src/test/ui/generic-associated-types/issue-79636-2.stderr index ae61b7b10..6a36bfc37 100644 --- a/src/test/ui/generic-associated-types/issue-79636-2.stderr +++ b/src/test/ui/generic-associated-types/issue-79636-2.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `SomeTrait::Wrapped` - --> $DIR/issue-79636-2.rs:11:18 + --> $DIR/issue-79636-2.rs:9:18 | LL | W: SomeTrait<Wrapped = W>, | ^^^^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `A` - --> $DIR/issue-79636-2.rs:4:10 + --> $DIR/issue-79636-2.rs:2:10 | LL | type Wrapped<A>: SomeTrait; | ^^^^^^^ - diff --git a/src/test/ui/generic-associated-types/issue-80433-reduced.rs b/src/test/ui/generic-associated-types/issue-80433-reduced.rs index f15d4d8b1..44831a995 100644 --- a/src/test/ui/generic-associated-types/issue-80433-reduced.rs +++ b/src/test/ui/generic-associated-types/issue-80433-reduced.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - struct E {} trait TestMut { diff --git a/src/test/ui/generic-associated-types/issue-80433.rs b/src/test/ui/generic-associated-types/issue-80433.rs index 6a1fe7519..05ff82fa7 100644 --- a/src/test/ui/generic-associated-types/issue-80433.rs +++ b/src/test/ui/generic-associated-types/issue-80433.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - #[derive(Default)] struct E<T> { data: T, diff --git a/src/test/ui/generic-associated-types/issue-80433.stderr b/src/test/ui/generic-associated-types/issue-80433.stderr index d8c210dcf..20a407dd4 100644 --- a/src/test/ui/generic-associated-types/issue-80433.stderr +++ b/src/test/ui/generic-associated-types/issue-80433.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `TestMut::Output` - --> $DIR/issue-80433.rs:23:47 + --> $DIR/issue-80433.rs:21:47 | LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output = &'a mut f32>) | ^^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-80433.rs:9:10 + --> $DIR/issue-80433.rs:7:10 | LL | type Output<'a>; | ^^^^^^ -- diff --git a/src/test/ui/generic-associated-types/issue-81487.rs b/src/test/ui/generic-associated-types/issue-81487.rs index 7f399c4f9..0d19a75bb 100644 --- a/src/test/ui/generic-associated-types/issue-81487.rs +++ b/src/test/ui/generic-associated-types/issue-81487.rs @@ -1,7 +1,5 @@ // build-pass -#![feature(generic_associated_types)] - trait Trait { type Ref<'a>; } diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs index fa2f86242..a7cc9a605 100644 --- a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs +++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs @@ -1,7 +1,5 @@ // Regression test for #81712. -#![feature(generic_associated_types)] - trait A { type BType: B<AType = Self>; } diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr index 86c99c32f..c8961e28e 100644 --- a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr +++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `C::DType` - --> $DIR/issue-81712-cyclic-traits.rs:16:19 + --> $DIR/issue-81712-cyclic-traits.rs:14:19 | LL | type CType: C<DType = Self>; | ^^^^^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/issue-81712-cyclic-traits.rs:13:10 + --> $DIR/issue-81712-cyclic-traits.rs:11:10 | LL | type DType<T>: D<T, CType = Self>; | ^^^^^ - diff --git a/src/test/ui/generic-associated-types/issue-81862.rs b/src/test/ui/generic-associated-types/issue-81862.rs index e457bca0c..bde828b77 100644 --- a/src/test/ui/generic-associated-types/issue-81862.rs +++ b/src/test/ui/generic-associated-types/issue-81862.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait StreamingIterator { type Item<'a>; fn next(&mut self) -> Option<Self::Item>; diff --git a/src/test/ui/generic-associated-types/issue-81862.stderr b/src/test/ui/generic-associated-types/issue-81862.stderr index c664b3ee6..ba7980846 100644 --- a/src/test/ui/generic-associated-types/issue-81862.stderr +++ b/src/test/ui/generic-associated-types/issue-81862.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `StreamingIterator::Item` - --> $DIR/issue-81862.rs:5:40 + --> $DIR/issue-81862.rs:3:40 | LL | fn next(&mut self) -> Option<Self::Item>; | ^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-81862.rs:4:10 + --> $DIR/issue-81862.rs:2:10 | LL | type Item<'a>; | ^^^^ -- diff --git a/src/test/ui/generic-associated-types/issue-84931.rs b/src/test/ui/generic-associated-types/issue-84931.rs index 9e247de16..4123ce9d4 100644 --- a/src/test/ui/generic-associated-types/issue-84931.rs +++ b/src/test/ui/generic-associated-types/issue-84931.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] // check-fail trait StreamingIter { diff --git a/src/test/ui/generic-associated-types/issue-84931.stderr b/src/test/ui/generic-associated-types/issue-84931.stderr index 11c3dffde..fffea98a4 100644 --- a/src/test/ui/generic-associated-types/issue-84931.stderr +++ b/src/test/ui/generic-associated-types/issue-84931.stderr @@ -1,5 +1,5 @@ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/issue-84931.rs:15:21 + --> $DIR/issue-84931.rs:14:21 | LL | type Item<'a> = &'a mut T; | ^^^^^^^^^- help: consider adding a where clause: `where T: 'a` diff --git a/src/test/ui/generic-associated-types/issue-85921.rs b/src/test/ui/generic-associated-types/issue-85921.rs index df59f497d..d281ed9ee 100644 --- a/src/test/ui/generic-associated-types/issue-85921.rs +++ b/src/test/ui/generic-associated-types/issue-85921.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Trait { type Assoc<'a>; diff --git a/src/test/ui/generic-associated-types/issue-86218-2.rs b/src/test/ui/generic-associated-types/issue-86218-2.rs new file mode 100644 index 000000000..63c839ea8 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-86218-2.rs @@ -0,0 +1,23 @@ +// check-pass + +#![feature(type_alias_impl_trait)] + +pub trait Stream { + type Item; +} + +impl Stream for () { + type Item = i32; +} + +trait Yay<AdditionalValue> { + type InnerStream<'s>: Stream<Item = i32> + 's; + fn foo<'s>() -> Self::InnerStream<'s>; +} + +impl<T> Yay<T> for () { + type InnerStream<'s> = impl Stream<Item = i32> + 's; + fn foo<'s>() -> Self::InnerStream<'s> { () } +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.rs b/src/test/ui/generic-associated-types/issue-86218.rs index fb62c10a9..b2c3071f0 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-86218.rs +++ b/src/test/ui/generic-associated-types/issue-86218.rs @@ -1,9 +1,5 @@ -// check-fail -// known-bug: #86218 +// check-pass -// This should pass, but seems to run into a TAIT issue. - -#![feature(generic_associated_types)] #![feature(type_alias_impl_trait)] pub trait Stream { @@ -21,7 +17,8 @@ trait Yay<AdditionalValue> { impl<'a> Yay<&'a ()> for () { type InnerStream<'s> = impl Stream<Item = i32> + 's; - fn foo<'s>() -> Self::InnerStream<'s> { todo!() } + //^ ERROR does not fulfill the required lifetime + fn foo<'s>() -> Self::InnerStream<'s> { () } } fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-86483.rs b/src/test/ui/generic-associated-types/issue-86483.rs index 07dd0bffd..70267637a 100644 --- a/src/test/ui/generic-associated-types/issue-86483.rs +++ b/src/test/ui/generic-associated-types/issue-86483.rs @@ -4,8 +4,6 @@ // // check-pass -#![feature(generic_associated_types)] - pub trait IceIce<T> where for<'a> T: 'a, diff --git a/src/test/ui/generic-associated-types/issue-86787.rs b/src/test/ui/generic-associated-types/issue-86787.rs index 0f8096c8a..96075ca50 100644 --- a/src/test/ui/generic-associated-types/issue-86787.rs +++ b/src/test/ui/generic-associated-types/issue-86787.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] // check-fail enum Either<L, R> { diff --git a/src/test/ui/generic-associated-types/issue-86787.stderr b/src/test/ui/generic-associated-types/issue-86787.stderr index d4b2267d3..f34c63cf7 100644 --- a/src/test/ui/generic-associated-types/issue-86787.stderr +++ b/src/test/ui/generic-associated-types/issue-86787.stderr @@ -1,5 +1,5 @@ error: missing required bound on `TRef` - --> $DIR/issue-86787.rs:11:5 + --> $DIR/issue-86787.rs:10:5 | LL | type TRef<'a>; | ^^^^^^^^^^^^^- diff --git a/src/test/ui/generic-associated-types/issue-87258_a.rs b/src/test/ui/generic-associated-types/issue-87258_a.rs index c65f3fb2a..9ab683d3d 100644 --- a/src/test/ui/generic-associated-types/issue-87258_a.rs +++ b/src/test/ui/generic-associated-types/issue-87258_a.rs @@ -1,5 +1,4 @@ #![feature(type_alias_impl_trait)] -#![feature(generic_associated_types)] // See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367 diff --git a/src/test/ui/generic-associated-types/issue-87258_a.stderr b/src/test/ui/generic-associated-types/issue-87258_a.stderr index db3a5c819..eae9bd9b1 100644 --- a/src/test/ui/generic-associated-types/issue-87258_a.stderr +++ b/src/test/ui/generic-associated-types/issue-87258_a.stderr @@ -1,10 +1,10 @@ error: unconstrained opaque type - --> $DIR/issue-87258_a.rs:18:26 + --> $DIR/issue-87258_a.rs:17:26 | LL | type FooFuture<'a> = impl Trait1; | ^^^^^^^^^^^ | - = note: `FooFuture` must be used in combination with a concrete type within the same module + = note: `FooFuture` must be used in combination with a concrete type within the same impl error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/issue-87258_b.rs b/src/test/ui/generic-associated-types/issue-87258_b.rs index f59e0d766..7b7610b21 100644 --- a/src/test/ui/generic-associated-types/issue-87258_b.rs +++ b/src/test/ui/generic-associated-types/issue-87258_b.rs @@ -1,5 +1,4 @@ #![feature(type_alias_impl_trait)] -#![feature(generic_associated_types)] // See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367 diff --git a/src/test/ui/generic-associated-types/issue-87258_b.stderr b/src/test/ui/generic-associated-types/issue-87258_b.stderr index 9faccc961..0ee665f38 100644 --- a/src/test/ui/generic-associated-types/issue-87258_b.stderr +++ b/src/test/ui/generic-associated-types/issue-87258_b.stderr @@ -1,5 +1,5 @@ error: unconstrained opaque type - --> $DIR/issue-87258_b.rs:17:49 + --> $DIR/issue-87258_b.rs:16:49 | LL | type Helper<'xenon, 'yttrium, KABOOM: Trait2> = impl Trait1; | ^^^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/issue-87429-2.rs b/src/test/ui/generic-associated-types/issue-87429-2.rs index d35bb098a..feb43ee5a 100644 --- a/src/test/ui/generic-associated-types/issue-87429-2.rs +++ b/src/test/ui/generic-associated-types/issue-87429-2.rs @@ -4,8 +4,6 @@ // check-pass -#![feature(generic_associated_types)] - trait Family { type Member<'a, C: Eq>: for<'b> MyBound<'b, C>; } diff --git a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs index 9ee07c2f1..2006f9bc7 100644 --- a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs +++ b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs @@ -1,7 +1,6 @@ // check-fail #![feature(associated_type_defaults)] -#![feature(generic_associated_types)] trait Family { // Fine, i32: PartialEq<i32> diff --git a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr index c6fa02cb9..b1abe012b 100644 --- a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr +++ b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr @@ -1,12 +1,12 @@ error[E0277]: can't compare `Foo` with `Foo` - --> $DIR/issue-87429-associated-type-default.rs:14:60 + --> $DIR/issue-87429-associated-type-default.rs:13:60 | LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo; | ^^^ no implementation for `Foo == Foo` | = help: the trait `PartialEq` is not implemented for `Foo` note: required by a bound in `Family2::Member` - --> $DIR/issue-87429-associated-type-default.rs:14:22 + --> $DIR/issue-87429-associated-type-default.rs:13:22 | LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family2::Member` diff --git a/src/test/ui/generic-associated-types/issue-87429-specialization.rs b/src/test/ui/generic-associated-types/issue-87429-specialization.rs index b365e07fe..6e31f1b21 100644 --- a/src/test/ui/generic-associated-types/issue-87429-specialization.rs +++ b/src/test/ui/generic-associated-types/issue-87429-specialization.rs @@ -2,7 +2,6 @@ #![feature(specialization)] //~^ WARN incomplete -#![feature(generic_associated_types)] trait Family { type Member<'a>: for<'b> PartialEq<Self::Member<'b>>; diff --git a/src/test/ui/generic-associated-types/issue-87429-specialization.stderr b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr index 015e0c779..11c4ebf60 100644 --- a/src/test/ui/generic-associated-types/issue-87429-specialization.stderr +++ b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr @@ -4,19 +4,19 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default error[E0277]: can't compare `Foo` with `Foo` - --> $DIR/issue-87429-specialization.rs:21:31 + --> $DIR/issue-87429-specialization.rs:20:31 | LL | default type Member<'a> = Foo; | ^^^ no implementation for `Foo == Foo` | = help: the trait `PartialEq` is not implemented for `Foo` note: required by a bound in `Family::Member` - --> $DIR/issue-87429-specialization.rs:8:22 + --> $DIR/issue-87429-specialization.rs:7:22 | LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family::Member` diff --git a/src/test/ui/generic-associated-types/issue-87429.rs b/src/test/ui/generic-associated-types/issue-87429.rs index f905348ae..56394823c 100644 --- a/src/test/ui/generic-associated-types/issue-87429.rs +++ b/src/test/ui/generic-associated-types/issue-87429.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Family { type Member<'a>: for<'b> PartialEq<Self::Member<'b>>; } diff --git a/src/test/ui/generic-associated-types/issue-87748.rs b/src/test/ui/generic-associated-types/issue-87748.rs new file mode 100644 index 000000000..6cbe3d902 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-87748.rs @@ -0,0 +1,21 @@ +// Checks that we properly add implied bounds from unnormalized projections in +// inputs when typechecking functions. + +// check-pass + +trait MyTrait { + type Assoc<'a, 'b> where 'b: 'a; + fn do_sth(arg: Self::Assoc<'_, '_>); + fn do_sth2(arg: Self::Assoc<'_, '_>) {} +} + +struct Foo; + +impl MyTrait for Foo { + type Assoc<'a, 'b> = u32 where 'b: 'a; + + fn do_sth(_: u32) {} + fn do_sth2(_: Self::Assoc<'static, 'static>) {} +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-87750.rs b/src/test/ui/generic-associated-types/issue-87750.rs index 89bd79ac2..0a11a0f3a 100644 --- a/src/test/ui/generic-associated-types/issue-87750.rs +++ b/src/test/ui/generic-associated-types/issue-87750.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait PointerFamily { type Pointer<T>; } diff --git a/src/test/ui/generic-associated-types/issue-87750.stderr b/src/test/ui/generic-associated-types/issue-87750.stderr index 854541f3d..b358ca273 100644 --- a/src/test/ui/generic-associated-types/issue-87750.stderr +++ b/src/test/ui/generic-associated-types/issue-87750.stderr @@ -1,5 +1,5 @@ error[E0275]: overflow evaluating the requirement `Node<i32, RcFamily>: Sized` - --> $DIR/issue-87750.rs:20:16 + --> $DIR/issue-87750.rs:18:16 | LL | let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/issue-88287.rs b/src/test/ui/generic-associated-types/issue-88287.rs index 4952a0825..82188493d 100644 --- a/src/test/ui/generic-associated-types/issue-88287.rs +++ b/src/test/ui/generic-associated-types/issue-88287.rs @@ -1,6 +1,5 @@ // edition:2018 -#![feature(generic_associated_types)] #![feature(type_alias_impl_trait)] use std::future::Future; diff --git a/src/test/ui/generic-associated-types/issue-88287.stderr b/src/test/ui/generic-associated-types/issue-88287.stderr index 5241d85a5..1b84cce62 100644 --- a/src/test/ui/generic-associated-types/issue-88287.stderr +++ b/src/test/ui/generic-associated-types/issue-88287.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `A` cannot be known at compilation time - --> $DIR/issue-88287.rs:35:9 + --> $DIR/issue-88287.rs:34:9 | LL | type SearchFutureTy<'f, A, B: 'f> | - this type parameter needs to be `std::marker::Sized` @@ -8,7 +8,7 @@ LL | async move { todo!() } | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | note: required by a bound in `<T as SearchableResourceExt<Criteria>>` - --> $DIR/issue-88287.rs:25:6 + --> $DIR/issue-88287.rs:24:6 | LL | impl<T, Criteria> SearchableResourceExt<Criteria> for T | ^ required by this bound in `<T as SearchableResourceExt<Criteria>>` diff --git a/src/test/ui/generic-associated-types/issue-88360.rs b/src/test/ui/generic-associated-types/issue-88360.rs index 8ee98201a..c02690618 100644 --- a/src/test/ui/generic-associated-types/issue-88360.rs +++ b/src/test/ui/generic-associated-types/issue-88360.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait GatTrait { type Gat<'a> where Self: 'a; diff --git a/src/test/ui/generic-associated-types/issue-88360.stderr b/src/test/ui/generic-associated-types/issue-88360.stderr index 5f769d799..cd3750344 100644 --- a/src/test/ui/generic-associated-types/issue-88360.stderr +++ b/src/test/ui/generic-associated-types/issue-88360.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-88360.rs:15:9 + --> $DIR/issue-88360.rs:13:9 | LL | trait SuperTrait<T> | - this type parameter diff --git a/src/test/ui/generic-associated-types/issue-88405.rs b/src/test/ui/generic-associated-types/issue-88405.rs index 4a405bd36..8dad6a89f 100644 --- a/src/test/ui/generic-associated-types/issue-88405.rs +++ b/src/test/ui/generic-associated-types/issue-88405.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait SomeTrait {} trait OtherTrait { type Item; diff --git a/src/test/ui/generic-associated-types/issue-88459.rs b/src/test/ui/generic-associated-types/issue-88459.rs index 3b26a1801..07d7bc06d 100644 --- a/src/test/ui/generic-associated-types/issue-88459.rs +++ b/src/test/ui/generic-associated-types/issue-88459.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - trait Trait { type Assoc<'a>; } diff --git a/src/test/ui/generic-associated-types/issue-88595.rs b/src/test/ui/generic-associated-types/issue-88595.rs index e0796dfec..24641ee1f 100644 --- a/src/test/ui/generic-associated-types/issue-88595.rs +++ b/src/test/ui/generic-associated-types/issue-88595.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-88595.stderr b/src/test/ui/generic-associated-types/issue-88595.stderr index 79d3479af..bcefc8066 100644 --- a/src/test/ui/generic-associated-types/issue-88595.stderr +++ b/src/test/ui/generic-associated-types/issue-88595.stderr @@ -1,11 +1,11 @@ error: non-defining opaque type use in defining scope - --> $DIR/issue-88595.rs:21:35 + --> $DIR/issue-88595.rs:20:35 | LL | fn a(&'a self) -> Self::B<'a> {} | ^^ | note: lifetime used multiple times - --> $DIR/issue-88595.rs:18:6 + --> $DIR/issue-88595.rs:17:6 | LL | impl<'a> A<'a> for C { | ^^ diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.rs b/src/test/ui/generic-associated-types/issue-89008.rs index 79c28b0d2..669dbafb5 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-89008.rs +++ b/src/test/ui/generic-associated-types/issue-89008.rs @@ -1,43 +1,36 @@ -// check-fail +// check-pass // edition:2021 -// known-bug: #88908 - -// This should pass, but seems to run into a TAIT bug. #![feature(type_alias_impl_trait)] -#![feature(generic_associated_types)] use std::future::Future; +use std::marker::PhantomData; trait Stream { type Item; } -struct Empty<T>(T); -impl<T> Stream for Empty<T> { - type Item = (); +struct Empty<T> { + _phantom: PhantomData<T>, } -fn empty<T>() -> Empty<T> { - todo!() + +impl<T> Stream for Empty<T> { + type Item = T; } trait X { type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a; - - type LineStreamFut<'a,Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a; - - fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>; + type LineStreamFut<'a, Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a; + fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>; } struct Y; impl X for Y { type LineStream<'a, Repr> = impl Stream<Item = Repr>; - - type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>> ; - + type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { - async {empty()} + async { Empty { _phantom: PhantomData } } } } diff --git a/src/test/ui/generic-associated-types/issue-89352.rs b/src/test/ui/generic-associated-types/issue-89352.rs index d9c656d5f..1896d0c87 100644 --- a/src/test/ui/generic-associated-types/issue-89352.rs +++ b/src/test/ui/generic-associated-types/issue-89352.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - use std::marker::PhantomData; pub trait GenAssoc<T> { diff --git a/src/test/ui/generic-associated-types/issue-90014.rs b/src/test/ui/generic-associated-types/issue-90014.rs index f110b0693..55db95a6d 100644 --- a/src/test/ui/generic-associated-types/issue-90014.rs +++ b/src/test/ui/generic-associated-types/issue-90014.rs @@ -1,6 +1,5 @@ // edition:2018 -#![feature(generic_associated_types)] #![feature(type_alias_impl_trait)] use std::future::Future; diff --git a/src/test/ui/generic-associated-types/issue-90014.stderr b/src/test/ui/generic-associated-types/issue-90014.stderr index 457c582e8..2d3f4a6af 100644 --- a/src/test/ui/generic-associated-types/issue-90014.stderr +++ b/src/test/ui/generic-associated-types/issue-90014.stderr @@ -1,5 +1,5 @@ error[E0477]: the type `&mut ()` does not fulfill the required lifetime - --> $DIR/issue-90014.rs:14:20 + --> $DIR/issue-90014.rs:13:20 | LL | type Fut<'a> where Self: 'a; | ------------ definition of `Fut` from trait @@ -8,7 +8,7 @@ LL | type Fut<'a> = impl Future<Output = ()>; | ^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a` | note: type must outlive the lifetime `'a` as defined here - --> $DIR/issue-90014.rs:14:14 + --> $DIR/issue-90014.rs:13:14 | LL | type Fut<'a> = impl Future<Output = ()>; | ^^ diff --git a/src/test/ui/generic-associated-types/issue-90729.rs b/src/test/ui/generic-associated-types/issue-90729.rs index 98295cce8..bcec2e321 100644 --- a/src/test/ui/generic-associated-types/issue-90729.rs +++ b/src/test/ui/generic-associated-types/issue-90729.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - use std::marker::PhantomData; pub trait Type { diff --git a/src/test/ui/generic-associated-types/issue-91139.migrate.stderr b/src/test/ui/generic-associated-types/issue-91139.migrate.stderr index b424d9a2f..690160577 100644 --- a/src/test/ui/generic-associated-types/issue-91139.migrate.stderr +++ b/src/test/ui/generic-associated-types/issue-91139.migrate.stderr @@ -1,13 +1,8 @@ -error[E0311]: the parameter type `T` may not live long enough - --> $DIR/issue-91139.rs:27:12 +error: expected identifier, found `<<` + --> $DIR/issue-91139.rs:1:1 | -LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound... - | -LL | fn foo<T: 'a>() { - | ++++ +LL | <<<<<<< HEAD + | ^^ expected identifier error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/issue-91139.rs b/src/test/ui/generic-associated-types/issue-91139.rs index 40eef11f0..5fc6071c9 100644 --- a/src/test/ui/generic-associated-types/issue-91139.rs +++ b/src/test/ui/generic-associated-types/issue-91139.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Foo<T> { type Type<'a> where diff --git a/src/test/ui/generic-associated-types/issue-91139.stderr b/src/test/ui/generic-associated-types/issue-91139.stderr index b789b3a42..8bbe98fa1 100644 --- a/src/test/ui/generic-associated-types/issue-91139.stderr +++ b/src/test/ui/generic-associated-types/issue-91139.stderr @@ -1,41 +1,41 @@ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:12 + --> $DIR/issue-91139.rs:14:12 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:12 + --> $DIR/issue-91139.rs:14:12 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:12 + --> $DIR/issue-91139.rs:14:12 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:12 + --> $DIR/issue-91139.rs:14:12 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:58 + --> $DIR/issue-91139.rs:14:58 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:58 + --> $DIR/issue-91139.rs:14:58 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/issue-91139.rs:16:58 + --> $DIR/issue-91139.rs:14:58 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -46,13 +46,13 @@ LL | fn foo<T: 'static>() { | +++++++++ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:58 + --> $DIR/issue-91139.rs:14:58 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ error: `T` does not live long enough - --> $DIR/issue-91139.rs:16:58 + --> $DIR/issue-91139.rs:14:58 | LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/issue-91883.rs b/src/test/ui/generic-associated-types/issue-91883.rs index 3d4585a44..e870e08a3 100644 --- a/src/test/ui/generic-associated-types/issue-91883.rs +++ b/src/test/ui/generic-associated-types/issue-91883.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - use std::fmt::Debug; use std::marker::PhantomData; diff --git a/src/test/ui/generic-associated-types/issue-91883.stderr b/src/test/ui/generic-associated-types/issue-91883.stderr index baf4889cc..1cfc2aaf1 100644 --- a/src/test/ui/generic-associated-types/issue-91883.stderr +++ b/src/test/ui/generic-associated-types/issue-91883.stderr @@ -1,5 +1,5 @@ error[E0478]: lifetime bound not satisfied - --> $DIR/issue-91883.rs:32:24 + --> $DIR/issue-91883.rs:30:24 | LL | type Cursor<'tx>: Cursor<'tx> | ----------------------------- definition of `Cursor` from trait @@ -8,12 +8,12 @@ LL | type Cursor<'tx> = CursorImpl<'tx>; | ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx` | note: lifetime parameter instantiated with the lifetime `'db` as defined here - --> $DIR/issue-91883.rs:31:6 + --> $DIR/issue-91883.rs:29:6 | LL | impl<'db> Transaction<'db> for TransactionImpl<'db> { | ^^^ note: but lifetime parameter must outlive the lifetime `'tx` as defined here - --> $DIR/issue-91883.rs:32:17 + --> $DIR/issue-91883.rs:30:17 | LL | type Cursor<'tx> = CursorImpl<'tx>; | ^^^ diff --git a/src/test/ui/generic-associated-types/issue-92033.rs b/src/test/ui/generic-associated-types/issue-92033.rs index 1d5f7d5c0..d111580b8 100644 --- a/src/test/ui/generic-associated-types/issue-92033.rs +++ b/src/test/ui/generic-associated-types/issue-92033.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - struct Texture; trait Surface { diff --git a/src/test/ui/generic-associated-types/issue-92033.stderr b/src/test/ui/generic-associated-types/issue-92033.stderr index 6dd901027..cd7eed254 100644 --- a/src/test/ui/generic-associated-types/issue-92033.stderr +++ b/src/test/ui/generic-associated-types/issue-92033.stderr @@ -1,5 +1,5 @@ error[E0477]: the type `&'s Texture` does not fulfill the required lifetime - --> $DIR/issue-92033.rs:22:28 + --> $DIR/issue-92033.rs:20:28 | LL | type TextureIter<'a>: Iterator<Item = &'a Texture> | -------------------------------------------------- definition of `TextureIter` from trait @@ -8,7 +8,7 @@ LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a` | note: type must outlive the lifetime `'a` as defined here - --> $DIR/issue-92033.rs:22:22 + --> $DIR/issue-92033.rs:20:22 | LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>; | ^^ diff --git a/src/test/ui/generic-associated-types/issue-92096.migrate.stderr b/src/test/ui/generic-associated-types/issue-92096.migrate.stderr index c74161cd3..ce1fd6dd9 100644 --- a/src/test/ui/generic-associated-types/issue-92096.migrate.stderr +++ b/src/test/ui/generic-associated-types/issue-92096.migrate.stderr @@ -1,5 +1,5 @@ error[E0311]: the parameter type `C` may not live long enough - --> $DIR/issue-92096.rs:20:33 + --> $DIR/issue-92096.rs:19:33 | LL | fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send | ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds @@ -10,7 +10,7 @@ LL | C: Client + Send + Sync + 'a, | ++++ error[E0311]: the parameter type `C` may not live long enough - --> $DIR/issue-92096.rs:20:33 + --> $DIR/issue-92096.rs:19:33 | LL | fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send | ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds diff --git a/src/test/ui/generic-associated-types/issue-92096.rs b/src/test/ui/generic-associated-types/issue-92096.rs index 377b8164a..e285af666 100644 --- a/src/test/ui/generic-associated-types/issue-92096.rs +++ b/src/test/ui/generic-associated-types/issue-92096.rs @@ -1,7 +1,5 @@ // edition:2018 -#![feature(generic_associated_types)] - use std::future::Future; trait Client { diff --git a/src/test/ui/generic-associated-types/issue-92096.stderr b/src/test/ui/generic-associated-types/issue-92096.stderr index ca61a0f43..91a06d5ac 100644 --- a/src/test/ui/generic-associated-types/issue-92096.stderr +++ b/src/test/ui/generic-associated-types/issue-92096.stderr @@ -1,5 +1,5 @@ error: `C` does not live long enough - --> $DIR/issue-92096.rs:19:5 + --> $DIR/issue-92096.rs:17:5 | LL | async move { c.connect().await } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/issue-92280.rs b/src/test/ui/generic-associated-types/issue-92280.rs index 81d000f10..9284beea3 100644 --- a/src/test/ui/generic-associated-types/issue-92280.rs +++ b/src/test/ui/generic-associated-types/issue-92280.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(generic_associated_types)] #![allow(non_camel_case_types)] trait HasAssoc { diff --git a/src/test/ui/generic-associated-types/issue-92954.rs b/src/test/ui/generic-associated-types/issue-92954.rs index 95c090ff4..22ce8f9fe 100644 --- a/src/test/ui/generic-associated-types/issue-92954.rs +++ b/src/test/ui/generic-associated-types/issue-92954.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - pub trait Foo { type Assoc<'c>; fn function() -> for<'x> fn(Self::Assoc<'x>); diff --git a/src/test/ui/generic-associated-types/issue-93141.rs b/src/test/ui/generic-associated-types/issue-93141.rs index 39ca77d13..48c78b9c0 100644 --- a/src/test/ui/generic-associated-types/issue-93141.rs +++ b/src/test/ui/generic-associated-types/issue-93141.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - pub trait Fooey: Sized { type Context<'c> where Self: 'c; } diff --git a/src/test/ui/generic-associated-types/issue-93262.rs b/src/test/ui/generic-associated-types/issue-93262.rs index adc6aa8fa..a7bcd111d 100644 --- a/src/test/ui/generic-associated-types/issue-93262.rs +++ b/src/test/ui/generic-associated-types/issue-93262.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - pub trait Trait { type Assoc<'a> where Self: 'a; } diff --git a/src/test/ui/generic-associated-types/issue-93340.rs b/src/test/ui/generic-associated-types/issue-93340.rs index d065bde88..4662fda53 100644 --- a/src/test/ui/generic-associated-types/issue-93340.rs +++ b/src/test/ui/generic-associated-types/issue-93340.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - pub trait Scalar: 'static { type RefType<'a>: ScalarRef<'a>; } diff --git a/src/test/ui/generic-associated-types/issue-93341.rs b/src/test/ui/generic-associated-types/issue-93341.rs index e96a768ec..737b2bbdb 100644 --- a/src/test/ui/generic-associated-types/issue-93341.rs +++ b/src/test/ui/generic-associated-types/issue-93341.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(generic_associated_types)] use std::marker::PhantomData; pub struct Id<'id>(PhantomData<fn(&'id ()) -> &'id ()>); diff --git a/src/test/ui/generic-associated-types/issue-93342.rs b/src/test/ui/generic-associated-types/issue-93342.rs index d8d7adac9..d4422d5d1 100644 --- a/src/test/ui/generic-associated-types/issue-93342.rs +++ b/src/test/ui/generic-associated-types/issue-93342.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - use std::marker::PhantomData; pub trait Scalar: 'static { diff --git a/src/test/ui/generic-associated-types/issue-93874.rs b/src/test/ui/generic-associated-types/issue-93874.rs index f403d7516..30956655a 100644 --- a/src/test/ui/generic-associated-types/issue-93874.rs +++ b/src/test/ui/generic-associated-types/issue-93874.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(generic_associated_types)] - pub trait Build { type Output<O>; fn build<O>(self, input: O) -> Self::Output<O>; diff --git a/src/test/ui/generic-associated-types/issue-95305.rs b/src/test/ui/generic-associated-types/issue-95305.rs index e2f1710fa..6c3ec20e7 100644 --- a/src/test/ui/generic-associated-types/issue-95305.rs +++ b/src/test/ui/generic-associated-types/issue-95305.rs @@ -2,7 +2,6 @@ // Forbid it for now but proper support might be added // at some point in the future. -#![feature(generic_associated_types)] #![feature(anonymous_lifetime_in_impl_trait)] trait Foo { type Item<'a>; diff --git a/src/test/ui/generic-associated-types/issue-95305.stderr b/src/test/ui/generic-associated-types/issue-95305.stderr index d8557525f..eb15cbc62 100644 --- a/src/test/ui/generic-associated-types/issue-95305.stderr +++ b/src/test/ui/generic-associated-types/issue-95305.stderr @@ -1,5 +1,5 @@ error[E0637]: `'_` cannot be used here - --> $DIR/issue-95305.rs:11:26 + --> $DIR/issue-95305.rs:10:26 | LL | fn foo(x: &impl Foo<Item<'_> = u32>) { } | ^^ `'_` is a reserved lifetime name diff --git a/src/test/ui/generic-associated-types/iterable.rs b/src/test/ui/generic-associated-types/iterable.rs index af0049891..8ad351bd3 100644 --- a/src/test/ui/generic-associated-types/iterable.rs +++ b/src/test/ui/generic-associated-types/iterable.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // run-pass trait Iterable { diff --git a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs index 655abd18d..36974b3df 100644 --- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs +++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs @@ -1,8 +1,6 @@ // Test that the predicate printed in an unresolved method error prints the // generics for a generic associated type. -#![feature(generic_associated_types)] - trait X { type Y<T>; } diff --git a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr index d9dc77ac8..baef38f6b 100644 --- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr +++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr @@ -1,5 +1,5 @@ error[E0599]: the method `f` exists for struct `S`, but its trait bounds were not satisfied - --> $DIR/method-unsatified-assoc-type-predicate.rs:30:7 + --> $DIR/method-unsatified-assoc-type-predicate.rs:28:7 | LL | struct S; | -------- @@ -12,7 +12,7 @@ LL | a.f(); | ^ method cannot be called on `S` due to unsatisfied trait bounds | note: trait bound `<S as X>::Y<i32> = i32` was not satisfied - --> $DIR/method-unsatified-assoc-type-predicate.rs:14:11 + --> $DIR/method-unsatified-assoc-type-predicate.rs:12:11 | LL | impl<T: X<Y<i32> = i32>> M for T {} | ^^^^^^^^^^^^ - - diff --git a/src/test/ui/generic-associated-types/missing-bounds.fixed b/src/test/ui/generic-associated-types/missing-bounds.fixed index 2315810a4..ee758f19e 100644 --- a/src/test/ui/generic-associated-types/missing-bounds.fixed +++ b/src/test/ui/generic-associated-types/missing-bounds.fixed @@ -24,7 +24,7 @@ impl<B: Add + Add<Output = B>> Add for C<B> { struct D<B>(B); -impl<B: std::ops::Add<Output=B>> Add for D<B> { +impl<B: std::ops::Add<Output = B>> Add for D<B> { type Output = Self; fn add(self, rhs: Self) -> Self { diff --git a/src/test/ui/generic-associated-types/missing-bounds.stderr b/src/test/ui/generic-associated-types/missing-bounds.stderr index 138c642dd..c913483a8 100644 --- a/src/test/ui/generic-associated-types/missing-bounds.stderr +++ b/src/test/ui/generic-associated-types/missing-bounds.stderr @@ -66,8 +66,8 @@ LL | Self(self.0 + rhs.0) | help: consider restricting type parameter `B` | -LL | impl<B: std::ops::Add<Output=B>> Add for D<B> { - | +++++++++++++++++++++++++ +LL | impl<B: std::ops::Add<Output = B>> Add for D<B> { + | +++++++++++++++++++++++++++ error[E0308]: mismatched types --> $DIR/missing-bounds.rs:42:14 diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs index 8171dc0ae..de9cad308 100644 --- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs +++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs @@ -1,7 +1,5 @@ // check-fail -#![feature(generic_associated_types)] - trait Foo { type Assoc<'a, 'b>; } diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr index edd1f9367..ffdba6676 100644 --- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr +++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/missing-where-clause-on-trait.rs:9:39 + --> $DIR/missing-where-clause-on-trait.rs:7:39 | LL | type Assoc<'a, 'b>; | ------------------ definition of `Assoc` from trait diff --git a/src/test/ui/generic-associated-types/missing_lifetime_args.rs b/src/test/ui/generic-associated-types/missing_lifetime_args.rs index cd918157f..78def8092 100644 --- a/src/test/ui/generic-associated-types/missing_lifetime_args.rs +++ b/src/test/ui/generic-associated-types/missing_lifetime_args.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a, 'b>; } diff --git a/src/test/ui/generic-associated-types/missing_lifetime_args.stderr b/src/test/ui/generic-associated-types/missing_lifetime_args.stderr index 7cf3f4b73..0ad1f1f8c 100644 --- a/src/test/ui/generic-associated-types/missing_lifetime_args.stderr +++ b/src/test/ui/generic-associated-types/missing_lifetime_args.stderr @@ -1,11 +1,11 @@ error[E0107]: missing generics for associated type `X::Y` - --> $DIR/missing_lifetime_args.rs:13:32 + --> $DIR/missing_lifetime_args.rs:11:32 | LL | fn foo<'c, 'd>(_arg: Box<dyn X<Y = (&'c u32, &'d u32)>>) {} | ^ expected 2 lifetime arguments | note: associated type defined here, with 2 lifetime parameters: `'a`, `'b` - --> $DIR/missing_lifetime_args.rs:4:10 + --> $DIR/missing_lifetime_args.rs:2:10 | LL | type Y<'a, 'b>; | ^ -- -- @@ -15,7 +15,7 @@ LL | fn foo<'c, 'd>(_arg: Box<dyn X<Y<'c, 'd> = (&'c u32, &'d u32)>>) {} | ~~~~~~~~~ error[E0107]: this struct takes 3 lifetime arguments but 2 lifetime arguments were supplied - --> $DIR/missing_lifetime_args.rs:16:26 + --> $DIR/missing_lifetime_args.rs:14:26 | LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {} | ^^^ -- -- supplied 2 lifetime arguments @@ -23,7 +23,7 @@ LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {} | expected 3 lifetime arguments | note: struct defined here, with 3 lifetime parameters: `'a`, `'b`, `'c` - --> $DIR/missing_lifetime_args.rs:7:8 + --> $DIR/missing_lifetime_args.rs:5:8 | LL | struct Foo<'a, 'b, 'c> { | ^^^ -- -- -- @@ -33,7 +33,7 @@ LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b, 'a>) {} | ++++ error[E0107]: this struct takes 3 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/missing_lifetime_args.rs:19:16 + --> $DIR/missing_lifetime_args.rs:17:16 | LL | fn f<'a>(_arg: Foo<'a>) {} | ^^^ -- supplied 1 lifetime argument @@ -41,7 +41,7 @@ LL | fn f<'a>(_arg: Foo<'a>) {} | expected 3 lifetime arguments | note: struct defined here, with 3 lifetime parameters: `'a`, `'b`, `'c` - --> $DIR/missing_lifetime_args.rs:7:8 + --> $DIR/missing_lifetime_args.rs:5:8 | LL | struct Foo<'a, 'b, 'c> { | ^^^ -- -- -- diff --git a/src/test/ui/generic-associated-types/missing_lifetime_const.rs b/src/test/ui/generic-associated-types/missing_lifetime_const.rs index e3e78dd96..8b174b9e9 100644 --- a/src/test/ui/generic-associated-types/missing_lifetime_const.rs +++ b/src/test/ui/generic-associated-types/missing_lifetime_const.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Foo { type Assoc<'a, const N: usize>; } diff --git a/src/test/ui/generic-associated-types/missing_lifetime_const.stderr b/src/test/ui/generic-associated-types/missing_lifetime_const.stderr index 5d50637bd..62d2e9f49 100644 --- a/src/test/ui/generic-associated-types/missing_lifetime_const.stderr +++ b/src/test/ui/generic-associated-types/missing_lifetime_const.stderr @@ -1,11 +1,11 @@ error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/missing_lifetime_const.rs:8:24 + --> $DIR/missing_lifetime_const.rs:6:24 | LL | let _: <T as Foo>::Assoc<3>; | ^^^^^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/missing_lifetime_const.rs:4:10 + --> $DIR/missing_lifetime_const.rs:2:10 | LL | type Assoc<'a, const N: usize>; | ^^^^^ -- diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind.rs b/src/test/ui/generic-associated-types/parameter_number_and_kind.rs index 0508cc2da..8428e7763 100644 --- a/src/test/ui/generic-associated-types/parameter_number_and_kind.rs +++ b/src/test/ui/generic-associated-types/parameter_number_and_kind.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] trait Foo { diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr b/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr index 53d76fd22..c20b9669e 100644 --- a/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr +++ b/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr @@ -1,5 +1,5 @@ error[E0107]: this associated type takes 1 lifetime argument but 2 lifetime arguments were supplied - --> $DIR/parameter_number_and_kind.rs:12:24 + --> $DIR/parameter_number_and_kind.rs:11:24 | LL | type FErr1 = Self::E<'static, 'static>; | ^ ------- help: remove this lifetime argument @@ -7,19 +7,19 @@ LL | type FErr1 = Self::E<'static, 'static>; | expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/parameter_number_and_kind.rs:9:10 + --> $DIR/parameter_number_and_kind.rs:8:10 | LL | type E<'a, T>; | ^ -- error[E0107]: this associated type takes 1 generic argument but 0 generic arguments were supplied - --> $DIR/parameter_number_and_kind.rs:12:24 + --> $DIR/parameter_number_and_kind.rs:11:24 | LL | type FErr1 = Self::E<'static, 'static>; | ^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/parameter_number_and_kind.rs:9:10 + --> $DIR/parameter_number_and_kind.rs:8:10 | LL | type E<'a, T>; | ^ - @@ -29,7 +29,7 @@ LL | type FErr1 = Self::E<'static, 'static, T>; | +++ error[E0107]: this associated type takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/parameter_number_and_kind.rs:15:27 + --> $DIR/parameter_number_and_kind.rs:14:27 | LL | type FErr2<T> = Self::E<'static, T, u32>; | ^ --- help: remove this generic argument @@ -37,7 +37,7 @@ LL | type FErr2<T> = Self::E<'static, T, u32>; | expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` - --> $DIR/parameter_number_and_kind.rs:9:10 + --> $DIR/parameter_number_and_kind.rs:8:10 | LL | type E<'a, T>; | ^ - diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs index 6ca0bc6dd..c1381025a 100644 --- a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs +++ b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs @@ -1,4 +1,3 @@ -#![feature(generic_associated_types)] #![feature(associated_type_defaults)] // FIXME(#44265) add tests for type-generic and const-genertic associated types. diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr index 1458bf0c4..fdd6d305a 100644 --- a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr +++ b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr @@ -1,5 +1,5 @@ error[E0195]: lifetime parameters or bounds on type `A` do not match the trait declaration - --> $DIR/parameter_number_and_kind_impl.rs:15:11 + --> $DIR/parameter_number_and_kind_impl.rs:14:11 | LL | type A<'a>; | ---- lifetimes in impl do not match this type in trait @@ -8,7 +8,7 @@ LL | type A = u32; | ^ lifetimes do not match type in trait error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters - --> $DIR/parameter_number_and_kind_impl.rs:17:12 + --> $DIR/parameter_number_and_kind_impl.rs:16:12 | LL | type B<'a, 'b>; | -- -- @@ -21,7 +21,7 @@ LL | type B<'a, T> = Vec<T>; | found 1 type parameter error[E0195]: lifetime parameters or bounds on type `C` do not match the trait declaration - --> $DIR/parameter_number_and_kind_impl.rs:19:11 + --> $DIR/parameter_number_and_kind_impl.rs:18:11 | LL | type C; | - lifetimes in impl do not match this type in trait @@ -30,7 +30,7 @@ LL | type C<'a> = u32; | ^^^^ lifetimes do not match type in trait error[E0049]: type `A` has 1 type parameter but its trait declaration has 0 type parameters - --> $DIR/parameter_number_and_kind_impl.rs:26:12 + --> $DIR/parameter_number_and_kind_impl.rs:25:12 | LL | type A<'a>; | -- expected 0 type parameters @@ -39,7 +39,7 @@ LL | type A<T> = u32; | ^ found 1 type parameter error[E0195]: lifetime parameters or bounds on type `B` do not match the trait declaration - --> $DIR/parameter_number_and_kind_impl.rs:28:11 + --> $DIR/parameter_number_and_kind_impl.rs:27:11 | LL | type B<'a, 'b>; | -------- lifetimes in impl do not match this type in trait @@ -48,7 +48,7 @@ LL | type B<'a> = u32; | ^^^^ lifetimes do not match type in trait error[E0049]: type `C` has 1 type parameter but its trait declaration has 0 type parameters - --> $DIR/parameter_number_and_kind_impl.rs:30:12 + --> $DIR/parameter_number_and_kind_impl.rs:29:12 | LL | type C; | - expected 0 type parameters diff --git a/src/test/ui/generic-associated-types/parse/in-trait-impl.rs b/src/test/ui/generic-associated-types/parse/in-trait-impl.rs index 7f4775ddb..767098835 100644 --- a/src/test/ui/generic-associated-types/parse/in-trait-impl.rs +++ b/src/test/ui/generic-associated-types/parse/in-trait-impl.rs @@ -1,8 +1,6 @@ // check-pass // compile-flags: -Z parse-only -#![feature(generic_associated_types)] - impl<T> Baz for T where T: Foo { type Quux<'a> = <T as Foo>::Bar<'a, 'static>; } diff --git a/src/test/ui/generic-associated-types/parse/in-trait.rs b/src/test/ui/generic-associated-types/parse/in-trait.rs index d438795eb..6628aac37 100644 --- a/src/test/ui/generic-associated-types/parse/in-trait.rs +++ b/src/test/ui/generic-associated-types/parse/in-trait.rs @@ -1,8 +1,6 @@ // check-pass // compile-flags: -Z parse-only -#![feature(generic_associated_types)] - use std::ops::Deref; use std::fmt::Debug; diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs index be85598b7..cbb051892 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs +++ b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; } diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr index 2b265e921..53d5f9de6 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr +++ b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` - --> $DIR/trait-path-expected-token.rs:7:33 + --> $DIR/trait-path-expected-token.rs:5:33 | LL | fn f1<'a>(arg : Box<dyn X<Y = B = &'a ()>>) {} | - ^ expected one of 7 possible tokens diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs b/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs index d57c2813b..9183ec497 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs +++ b/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - mod error1 { trait X { type Y<'a>; diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr b/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr index 272afc10b..cf2b1763f 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr +++ b/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr @@ -1,5 +1,5 @@ error: expected expression, found `)` - --> $DIR/trait-path-expressions.rs:8:39 + --> $DIR/trait-path-expressions.rs:6:39 | LL | fn f1<'a>(arg : Box<dyn X< 1 = 32 >>) {} | - ^ expected expression @@ -7,7 +7,7 @@ LL | fn f1<'a>(arg : Box<dyn X< 1 = 32 >>) {} | while parsing a const generic argument starting here error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-expressions.rs:18:36 + --> $DIR/trait-path-expressions.rs:16:36 | LL | fn f2<'a>(arg : Box<dyn X< { 1 } = 32 >>) {} | - ^ expected one of `,`, `:`, or `>` diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs index 791486480..ecabf8943 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs +++ b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; } diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr index 3ace774a0..10ceccedc 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr +++ b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr @@ -1,5 +1,5 @@ error: expected one of `>`, a const expression, lifetime, or type, found `:` - --> $DIR/trait-path-missing-gen_arg.rs:8:30 + --> $DIR/trait-path-missing-gen_arg.rs:6:30 | LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} | ^ expected one of `>`, a const expression, lifetime, or type @@ -10,13 +10,13 @@ LL | fn f1<'a>(arg : Box<{ dyn X< : 32 } >>) {} | + + error: expected parameter name, found `>` - --> $DIR/trait-path-missing-gen_arg.rs:8:36 + --> $DIR/trait-path-missing-gen_arg.rs:6:36 | LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} | ^ expected parameter name error: expected one of `!`, `)`, `+`, `,`, or `::`, found `>` - --> $DIR/trait-path-missing-gen_arg.rs:8:36 + --> $DIR/trait-path-missing-gen_arg.rs:6:36 | LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} | ^ @@ -25,7 +25,7 @@ LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} | help: missing `,` error: expected one of `>`, a const expression, lifetime, or type, found `=` - --> $DIR/trait-path-missing-gen_arg.rs:16:30 + --> $DIR/trait-path-missing-gen_arg.rs:14:30 | LL | fn f1<'a>(arg : Box<dyn X< = 32 >>) {} | - ^ expected one of `>`, a const expression, lifetime, or type @@ -33,7 +33,7 @@ LL | fn f1<'a>(arg : Box<dyn X< = 32 >>) {} | maybe try to close unmatched angle bracket error[E0747]: constant provided when a type was expected - --> $DIR/trait-path-missing-gen_arg.rs:8:23 + --> $DIR/trait-path-missing-gen_arg.rs:6:23 | LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {} | ^^^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/parse/trait-path-segments.rs b/src/test/ui/generic-associated-types/parse/trait-path-segments.rs index e943f075f..458e203eb 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-segments.rs +++ b/src/test/ui/generic-associated-types/parse/trait-path-segments.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - const _: () = { trait X { type Y<'a>; diff --git a/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr b/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr index 7394393c0..8bc737d67 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr +++ b/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `+`, `,`, `::`, `:`, `<`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:8:36 + --> $DIR/trait-path-segments.rs:6:36 | LL | fn f1<'a>(arg : Box<dyn X<X::Y = u32>>) {} | - ^ expected one of 8 possible tokens @@ -12,7 +12,7 @@ LL | fn f1<'a>(arg : Box<dyn X<X::Y> = u32>>) {} | + error: expected one of `,`, `::`, `:`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:19:35 + --> $DIR/trait-path-segments.rs:17:35 | LL | impl<T : X<<Self as X>::Y<'a> = &'a u32>> Z for T {} | - ^ expected one of `,`, `::`, `:`, or `>` @@ -25,7 +25,7 @@ LL | impl<T : X<<Self as X>::Y<'a>> = &'a u32>> Z for T {} | + error: expected one of `!`, `+`, `,`, `::`, `:`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:30:25 + --> $DIR/trait-path-segments.rs:28:25 | LL | impl<T : X<X::Y<'a> = &'a u32>> Z for T {} | - ^ expected one of `!`, `+`, `,`, `::`, `:`, or `>` diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs index 4846af96d..1622b92aa 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs +++ b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; } diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr index 46ddcb635..e00a414ef 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr +++ b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr @@ -1,11 +1,11 @@ error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/trait-path-type-error-once-implemented.rs:8:29 + --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/trait-path-type-error-once-implemented.rs:4:10 + --> $DIR/trait-path-type-error-once-implemented.rs:2:10 | LL | type Y<'a>; | ^ -- @@ -15,7 +15,7 @@ LL | fn f2<'a>(arg : Box<dyn X<Y<'a, 1> = &'a ()>>) {} | +++ error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/trait-path-type-error-once-implemented.rs:8:29 + --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} | ^--- help: remove these generics @@ -23,7 +23,7 @@ LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters - --> $DIR/trait-path-type-error-once-implemented.rs:4:10 + --> $DIR/trait-path-type-error-once-implemented.rs:2:10 | LL | type Y<'a>; | ^ diff --git a/src/test/ui/generic-associated-types/parse/trait-path-types.rs b/src/test/ui/generic-associated-types/parse/trait-path-types.rs index 856253cc7..74a00342f 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-types.rs +++ b/src/test/ui/generic-associated-types/parse/trait-path-types.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait X { type Y<'a>; } diff --git a/src/test/ui/generic-associated-types/parse/trait-path-types.stderr b/src/test/ui/generic-associated-types/parse/trait-path-types.stderr index fe9ed579e..8f7a73c95 100644 --- a/src/test/ui/generic-associated-types/parse/trait-path-types.stderr +++ b/src/test/ui/generic-associated-types/parse/trait-path-types.stderr @@ -1,5 +1,5 @@ error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-types.rs:8:37 + --> $DIR/trait-path-types.rs:6:37 | LL | fn f<'a>(arg : Box<dyn X< [u8; 1] = u32>>) {} | - ^ expected one of `,`, `:`, or `>` @@ -12,7 +12,7 @@ LL | fn f<'a>(arg : Box<dyn X< [u8; 1]> = u32>>) {} | + error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-types.rs:13:37 + --> $DIR/trait-path-types.rs:11:37 | LL | fn f1<'a>(arg : Box<dyn X<(Y<'a>) = &'a ()>>) {} | - ^ expected one of `,`, `:`, or `>` @@ -25,7 +25,7 @@ LL | fn f1<'a>(arg : Box<dyn X<(Y<'a>)> = &'a ()>>) {} | + error: expected one of `,`, `:`, or `>`, found `=` - --> $DIR/trait-path-types.rs:18:33 + --> $DIR/trait-path-types.rs:16:33 | LL | fn f1<'a>(arg : Box<dyn X< 'a = u32 >>) {} | -- ^ expected one of `,`, `:`, or `>` diff --git a/src/test/ui/generic-associated-types/pointer_family.rs b/src/test/ui/generic-associated-types/pointer_family.rs index da86e7f27..80827cd56 100644 --- a/src/test/ui/generic-associated-types/pointer_family.rs +++ b/src/test/ui/generic-associated-types/pointer_family.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // check-pass use std::rc::Rc; diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs index 794d677c8..58d57df63 100644 --- a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs +++ b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs @@ -1,8 +1,6 @@ // Like `projection-bound-cycle.rs` but this avoids using // `feature(trivial_bounds)`. -#![feature(generic_associated_types)] - trait Print { fn print(); } diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr index 2b57c439f..27c1a8299 100644 --- a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr +++ b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr @@ -1,11 +1,11 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized` - --> $DIR/projection-bound-cycle-generic.rs:44:18 + --> $DIR/projection-bound-cycle-generic.rs:42:18 | LL | type Assoc = OnlySized<<T as Foo>::Item>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required by a bound in `OnlySized` - --> $DIR/projection-bound-cycle-generic.rs:28:18 + --> $DIR/projection-bound-cycle-generic.rs:26:18 | LL | struct OnlySized<T> where T: Sized { f: T } | ^ required by this bound in `OnlySized` diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle.rs b/src/test/ui/generic-associated-types/projection-bound-cycle.rs index 6564a3608..4cad1f613 100644 --- a/src/test/ui/generic-associated-types/projection-bound-cycle.rs +++ b/src/test/ui/generic-associated-types/projection-bound-cycle.rs @@ -2,7 +2,6 @@ // Make sure that we make sure that we don't allow arbitrary bounds to be // proven when a bound and a where clause of an associated type are the same. -#![feature(generic_associated_types)] #![feature(trivial_bounds)] trait Print { diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle.stderr b/src/test/ui/generic-associated-types/projection-bound-cycle.stderr index d9d0bf427..a46518c80 100644 --- a/src/test/ui/generic-associated-types/projection-bound-cycle.stderr +++ b/src/test/ui/generic-associated-types/projection-bound-cycle.stderr @@ -1,11 +1,11 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized` - --> $DIR/projection-bound-cycle.rs:46:18 + --> $DIR/projection-bound-cycle.rs:45:18 | LL | type Assoc = OnlySized<<T as Foo>::Item>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required by a bound in `OnlySized` - --> $DIR/projection-bound-cycle.rs:30:18 + --> $DIR/projection-bound-cycle.rs:29:18 | LL | struct OnlySized<T> where T: Sized { f: T } | ^ required by this bound in `OnlySized` diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs index a40c0c2c4..8e4d5ca5e 100644 --- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs +++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - pub trait X { type Y<'a> where Self: 'a; fn m(&self) -> Self::Y<'_>; diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr index 4620aa34e..753ead48b 100644 --- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr +++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/projection-type-lifetime-mismatch.rs:17:5 + --> $DIR/projection-type-lifetime-mismatch.rs:15:5 | LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () { | - let's call the lifetime of this reference `'1` @@ -7,7 +7,7 @@ LL | x.m() | ^^^^^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough - --> $DIR/projection-type-lifetime-mismatch.rs:22:5 + --> $DIR/projection-type-lifetime-mismatch.rs:20:5 | LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () { | - let's call the lifetime of this reference `'1` @@ -15,7 +15,7 @@ LL | x.m() | ^^^^^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough - --> $DIR/projection-type-lifetime-mismatch.rs:27:5 + --> $DIR/projection-type-lifetime-mismatch.rs:25:5 | LL | fn h(x: &()) -> &'static () { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.rs b/src/test/ui/generic-associated-types/self-outlives-lint.rs index 300907adb..673891fc3 100644 --- a/src/test/ui/generic-associated-types/self-outlives-lint.rs +++ b/src/test/ui/generic-associated-types/self-outlives-lint.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - // check-fail use std::fmt::Debug; @@ -210,4 +208,17 @@ trait StaticReturnAndTakes<'a> { fn bar<'b>(&self, arg: Self::Y<'b>); } +// We require bounds when the GAT appears in the inputs +trait Input { + type Item<'a>; + //~^ missing required + fn takes_item<'a>(&'a self, item: Self::Item<'a>); +} + +// We don't require bounds when the GAT appears in the where clauses +trait WhereClause { + type Item<'a>; + fn takes_item<'a>(&'a self) where Self::Item<'a>: ; +} + fn main() {} diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.stderr b/src/test/ui/generic-associated-types/self-outlives-lint.stderr index fdb1f50a7..58172bf06 100644 --- a/src/test/ui/generic-associated-types/self-outlives-lint.stderr +++ b/src/test/ui/generic-associated-types/self-outlives-lint.stderr @@ -1,5 +1,5 @@ error: missing required bound on `Item` - --> $DIR/self-outlives-lint.rs:9:5 + --> $DIR/self-outlives-lint.rs:7:5 | LL | type Item<'x>; | ^^^^^^^^^^^^^- @@ -10,7 +10,7 @@ LL | type Item<'x>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Out` - --> $DIR/self-outlives-lint.rs:25:5 + --> $DIR/self-outlives-lint.rs:23:5 | LL | type Out<'x>; | ^^^^^^^^^^^^- @@ -21,7 +21,7 @@ LL | type Out<'x>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Out` - --> $DIR/self-outlives-lint.rs:39:5 + --> $DIR/self-outlives-lint.rs:37:5 | LL | type Out<'x>; | ^^^^^^^^^^^^- @@ -32,7 +32,7 @@ LL | type Out<'x>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bounds on `Out` - --> $DIR/self-outlives-lint.rs:46:5 + --> $DIR/self-outlives-lint.rs:44:5 | LL | type Out<'x, 'y>; | ^^^^^^^^^^^^^^^^- @@ -43,7 +43,7 @@ LL | type Out<'x, 'y>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Out` - --> $DIR/self-outlives-lint.rs:61:5 + --> $DIR/self-outlives-lint.rs:59:5 | LL | type Out<'x, D>; | ^^^^^^^^^^^^^^^- @@ -54,7 +54,7 @@ LL | type Out<'x, D>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Out` - --> $DIR/self-outlives-lint.rs:77:5 + --> $DIR/self-outlives-lint.rs:75:5 | LL | type Out<'x, D>; | ^^^^^^^^^^^^^^^- @@ -65,7 +65,7 @@ LL | type Out<'x, D>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Out` - --> $DIR/self-outlives-lint.rs:92:5 + --> $DIR/self-outlives-lint.rs:90:5 | LL | type Out<'x, D>; | ^^^^^^^^^^^^^^^- @@ -76,7 +76,7 @@ LL | type Out<'x, D>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bounds on `Bar` - --> $DIR/self-outlives-lint.rs:114:5 + --> $DIR/self-outlives-lint.rs:112:5 | LL | type Bar<'b>; | ^^^^^^^^^^^^- @@ -87,7 +87,7 @@ LL | type Bar<'b>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Bar` - --> $DIR/self-outlives-lint.rs:122:5 + --> $DIR/self-outlives-lint.rs:120:5 | LL | type Bar<'b>; | ^^^^^^^^^^^^- @@ -98,7 +98,7 @@ LL | type Bar<'b>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Bar` - --> $DIR/self-outlives-lint.rs:129:5 + --> $DIR/self-outlives-lint.rs:127:5 | LL | type Bar<'b>; | ^^^^^^^^^^^^- @@ -109,7 +109,7 @@ LL | type Bar<'b>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Item` - --> $DIR/self-outlives-lint.rs:142:5 + --> $DIR/self-outlives-lint.rs:140:5 | LL | type Item<'a>; | ^^^^^^^^^^^^^- @@ -120,7 +120,7 @@ LL | type Item<'a>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Iterator` - --> $DIR/self-outlives-lint.rs:144:5 + --> $DIR/self-outlives-lint.rs:142:5 | LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- @@ -131,7 +131,7 @@ LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Item` - --> $DIR/self-outlives-lint.rs:150:5 + --> $DIR/self-outlives-lint.rs:148:5 | LL | type Item<'a>; | ^^^^^^^^^^^^^- @@ -142,7 +142,7 @@ LL | type Item<'a>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Bar` - --> $DIR/self-outlives-lint.rs:159:5 + --> $DIR/self-outlives-lint.rs:157:5 | LL | type Bar<'a, 'b>; | ^^^^^^^^^^^^^^^^- @@ -153,7 +153,7 @@ LL | type Bar<'a, 'b>; = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information error: missing required bound on `Fut` - --> $DIR/self-outlives-lint.rs:175:5 + --> $DIR/self-outlives-lint.rs:173:5 | LL | type Fut<'out>; | ^^^^^^^^^^^^^^- @@ -163,5 +163,16 @@ LL | type Fut<'out>; = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information -error: aborting due to 15 previous errors +error: missing required bound on `Item` + --> $DIR/self-outlives-lint.rs:213:5 + | +LL | type Item<'a>; + | ^^^^^^^^^^^^^- + | | + | help: add the required where clause: `where Self: 'a` + | + = note: this bound is currently required to ensure that impls have maximum flexibility + = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information + +error: aborting due to 16 previous errors diff --git a/src/test/ui/generic-associated-types/shadowing.rs b/src/test/ui/generic-associated-types/shadowing.rs index 2a9763457..a05d6e143 100644 --- a/src/test/ui/generic-associated-types/shadowing.rs +++ b/src/test/ui/generic-associated-types/shadowing.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Shadow<'a> { type Bar<'a>; //~^ ERROR lifetime name `'a` shadows a lifetime name that is already in scope diff --git a/src/test/ui/generic-associated-types/shadowing.stderr b/src/test/ui/generic-associated-types/shadowing.stderr index be7659209..bb32684bc 100644 --- a/src/test/ui/generic-associated-types/shadowing.stderr +++ b/src/test/ui/generic-associated-types/shadowing.stderr @@ -1,5 +1,5 @@ error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope - --> $DIR/shadowing.rs:4:14 + --> $DIR/shadowing.rs:2:14 | LL | trait Shadow<'a> { | -- first declared here @@ -7,7 +7,7 @@ LL | type Bar<'a>; | ^^ lifetime `'a` already in scope error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope - --> $DIR/shadowing.rs:13:14 + --> $DIR/shadowing.rs:11:14 | LL | impl<'a> NoShadow<'a> for &'a u32 { | -- first declared here @@ -15,7 +15,7 @@ LL | type Bar<'a> = i32; | ^^ lifetime `'a` already in scope error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters - --> $DIR/shadowing.rs:18:14 + --> $DIR/shadowing.rs:16:14 | LL | trait ShadowT<T> { | - first use of `T` @@ -23,7 +23,7 @@ LL | type Bar<T>; | ^ already used error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters - --> $DIR/shadowing.rs:27:14 + --> $DIR/shadowing.rs:25:14 | LL | impl<T> NoShadowT<T> for Option<T> { | - first use of `T` diff --git a/src/test/ui/generic-associated-types/streaming_iterator.rs b/src/test/ui/generic-associated-types/streaming_iterator.rs index e71b6805a..408b8dc99 100644 --- a/src/test/ui/generic-associated-types/streaming_iterator.rs +++ b/src/test/ui/generic-associated-types/streaming_iterator.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(generic_associated_types)] - use std::fmt::Display; trait StreamingIterator { diff --git a/src/test/ui/generic-associated-types/trait-objects.base.stderr b/src/test/ui/generic-associated-types/trait-objects.base.stderr index 1df76a21b..556422c27 100644 --- a/src/test/ui/generic-associated-types/trait-objects.base.stderr +++ b/src/test/ui/generic-associated-types/trait-objects.base.stderr @@ -1,11 +1,11 @@ error[E0038]: the trait `StreamingIterator` cannot be made into an object - --> $DIR/trait-objects.rs:14:21 + --> $DIR/trait-objects.rs:13:21 | LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/trait-objects.rs:8:10 + --> $DIR/trait-objects.rs:7:10 | LL | trait StreamingIterator { | ----------------- this trait cannot be made into an object... diff --git a/src/test/ui/generic-associated-types/trait-objects.extended.stderr b/src/test/ui/generic-associated-types/trait-objects.extended.stderr index 52d48d578..45b64d2b0 100644 --- a/src/test/ui/generic-associated-types/trait-objects.extended.stderr +++ b/src/test/ui/generic-associated-types/trait-objects.extended.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of function - --> $DIR/trait-objects.rs:16:5 + --> $DIR/trait-objects.rs:15:5 | LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize { | - - let's call the lifetime of this reference `'1` @@ -11,6 +11,8 @@ LL | x.size_hint().0 | | | `x` escapes the function body here | argument requires that `'1` must outlive `'static` + | + = note: due to current limitations in the borrow checker, this implies a `'static` lifetime error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/trait-objects.rs b/src/test/ui/generic-associated-types/trait-objects.rs index c1da1e0a3..17fed11ba 100644 --- a/src/test/ui/generic-associated-types/trait-objects.rs +++ b/src/test/ui/generic-associated-types/trait-objects.rs @@ -1,6 +1,5 @@ // revisions: base extended -#![feature(generic_associated_types)] #![cfg_attr(extended, feature(generic_associated_types_extended))] #![cfg_attr(extended, allow(incomplete_features))] diff --git a/src/test/ui/generic-associated-types/type-param-defaults.rs b/src/test/ui/generic-associated-types/type-param-defaults.rs new file mode 100644 index 000000000..f034076b0 --- /dev/null +++ b/src/test/ui/generic-associated-types/type-param-defaults.rs @@ -0,0 +1,34 @@ +// Check that we disallow GAT param defaults, even with `invalid_type_param_default` allowed + +#![allow(invalid_type_param_default)] + +trait Trait { + type Assoc<T = u32>; + //~^ defaults for type parameters are only allowed +} + +impl Trait for () { + type Assoc<T = u32> = u64; + //~^ defaults for type parameters are only allowed +} + +impl Trait for u32 { + type Assoc<T = u32> = T; + //~^ defaults for type parameters are only allowed +} + +trait Other {} +impl Other for u32 {} + +fn foo<T>() +where + T: Trait<Assoc = u32>, + T::Assoc: Other { + } + +fn main() { + // errors + foo::<()>(); + // works + foo::<u32>(); +} diff --git a/src/test/ui/generic-associated-types/type-param-defaults.stderr b/src/test/ui/generic-associated-types/type-param-defaults.stderr new file mode 100644 index 000000000..85ccaba0e --- /dev/null +++ b/src/test/ui/generic-associated-types/type-param-defaults.stderr @@ -0,0 +1,20 @@ +error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions + --> $DIR/type-param-defaults.rs:6:16 + | +LL | type Assoc<T = u32>; + | ^^^^^^^ + +error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions + --> $DIR/type-param-defaults.rs:11:16 + | +LL | type Assoc<T = u32> = u64; + | ^^^^^^^ + +error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions + --> $DIR/type-param-defaults.rs:16:16 + | +LL | type Assoc<T = u32> = T; + | ^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs index 8b40dac57..1cc09aa6d 100644 --- a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs +++ b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - pub trait X { type Y<'a: 'static>; //~^ WARNING unnecessary lifetime parameter diff --git a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr index ae52010cc..fbd79879d 100644 --- a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr +++ b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr @@ -1,5 +1,5 @@ warning: unnecessary lifetime parameter `'a` - --> $DIR/unsatified-item-lifetime-bound.rs:4:12 + --> $DIR/unsatified-item-lifetime-bound.rs:2:12 | LL | type Y<'a: 'static>; | ^^ @@ -7,39 +7,39 @@ LL | type Y<'a: 'static>; = help: you can use the `'static` lifetime directly, in place of `'a` error[E0478]: lifetime bound not satisfied - --> $DIR/unsatified-item-lifetime-bound.rs:13:8 + --> $DIR/unsatified-item-lifetime-bound.rs:11:8 | LL | f: <T as X>::Y<'a>, | ^^^^^^^^^^^^^^^ | note: lifetime parameter instantiated with the lifetime `'a` as defined here - --> $DIR/unsatified-item-lifetime-bound.rs:12:10 + --> $DIR/unsatified-item-lifetime-bound.rs:10:10 | LL | struct B<'a, T: for<'r> X<Y<'r> = &'r ()>> { | ^^ = note: but lifetime parameter must outlive the static lifetime error[E0478]: lifetime bound not satisfied - --> $DIR/unsatified-item-lifetime-bound.rs:18:8 + --> $DIR/unsatified-item-lifetime-bound.rs:16:8 | LL | f: <T as X>::Y<'a>, | ^^^^^^^^^^^^^^^ | note: lifetime parameter instantiated with the lifetime `'a` as defined here - --> $DIR/unsatified-item-lifetime-bound.rs:17:10 + --> $DIR/unsatified-item-lifetime-bound.rs:15:10 | LL | struct C<'a, T: X> { | ^^ = note: but lifetime parameter must outlive the static lifetime error[E0478]: lifetime bound not satisfied - --> $DIR/unsatified-item-lifetime-bound.rs:23:8 + --> $DIR/unsatified-item-lifetime-bound.rs:21:8 | LL | f: <() as X>::Y<'a>, | ^^^^^^^^^^^^^^^^ | note: lifetime parameter instantiated with the lifetime `'a` as defined here - --> $DIR/unsatified-item-lifetime-bound.rs:22:10 + --> $DIR/unsatified-item-lifetime-bound.rs:20:10 | LL | struct D<'a> { | ^^ diff --git a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs index 6466bf98d..7137d9237 100644 --- a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs +++ b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait ATy { type Item<'a>: 'a; } diff --git a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr index 7ec9386ca..1c9ac01ec 100644 --- a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr +++ b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr @@ -1,23 +1,23 @@ error[E0477]: the type `&'b ()` does not fulfill the required lifetime - --> $DIR/unsatisfied-outlives-bound.rs:8:21 + --> $DIR/unsatisfied-outlives-bound.rs:6:21 | LL | type Item<'a> = &'b (); | ^^^^^^ | note: type must outlive the lifetime `'a` as defined here as required by this binding - --> $DIR/unsatisfied-outlives-bound.rs:8:15 + --> $DIR/unsatisfied-outlives-bound.rs:6:15 | LL | type Item<'a> = &'b (); | ^^ error[E0477]: the type `&'a ()` does not fulfill the required lifetime - --> $DIR/unsatisfied-outlives-bound.rs:17:21 + --> $DIR/unsatisfied-outlives-bound.rs:15:21 | LL | type Item<'a> = &'a (); | ^^^^^^ | note: type must satisfy the static lifetime as required by this binding - --> $DIR/unsatisfied-outlives-bound.rs:13:20 + --> $DIR/unsatisfied-outlives-bound.rs:11:20 | LL | type Item<'a>: 'static; | ^^^^^^^ diff --git a/src/test/ui/generic-associated-types/variance_constraints.rs b/src/test/ui/generic-associated-types/variance_constraints.rs index 7d0f7638a..0e9dbb8b1 100644 --- a/src/test/ui/generic-associated-types/variance_constraints.rs +++ b/src/test/ui/generic-associated-types/variance_constraints.rs @@ -1,6 +1,5 @@ // check-pass // issue #69184 -#![feature(generic_associated_types)] trait A { type B<'a> where Self: 'a; |