From 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:03:36 +0200 Subject: Adding upstream version 1.65.0+dfsg1. Signed-off-by: Daniel Baumann --- .../anonymize-bound-vars.rs | 1 - .../generic-associated-types/auxiliary/foo_defn.rs | 2 - .../bugs/hrtb-implied-1.rs | 35 ++++++++++++++++++ .../bugs/hrtb-implied-1.stderr | 20 ++++++++++ .../bugs/hrtb-implied-2.rs | 40 ++++++++++++++++++++ .../bugs/hrtb-implied-2.stderr | 22 +++++++++++ .../bugs/hrtb-implied-3.rs | 23 ++++++++++++ .../bugs/hrtb-implied-3.stderr | 22 +++++++++++ .../generic-associated-types/bugs/issue-80626.rs | 2 - .../bugs/issue-80626.stderr | 4 +- .../generic-associated-types/bugs/issue-86218.rs | 1 - .../bugs/issue-86218.stderr | 6 +-- .../generic-associated-types/bugs/issue-87735.rs | 2 - .../bugs/issue-87735.stderr | 2 +- .../generic-associated-types/bugs/issue-87748.rs | 23 ------------ .../bugs/issue-87748.stderr | 20 ---------- .../generic-associated-types/bugs/issue-87755.rs | 2 - .../bugs/issue-87755.stderr | 2 +- .../generic-associated-types/bugs/issue-87803.rs | 2 - .../bugs/issue-87803.stderr | 2 +- .../generic-associated-types/bugs/issue-88382.rs | 2 - .../bugs/issue-88382.stderr | 4 +- .../generic-associated-types/bugs/issue-88460.rs | 2 - .../bugs/issue-88460.stderr | 8 ++-- .../generic-associated-types/bugs/issue-88526.rs | 2 - .../bugs/issue-88526.stderr | 2 +- .../generic-associated-types/bugs/issue-89008.rs | 1 - .../bugs/issue-89008.stderr | 4 +- .../generic-associated-types/bugs/issue-91762.rs | 29 +++++++++++++++ .../bugs/issue-91762.stderr | 14 +++++++ .../collections-project-default.rs | 1 - .../collections-project-default.stderr | 2 +- .../ui/generic-associated-types/collections.rs | 1 - .../collectivity-regression.rs | 2 - .../collectivity-regression.stderr | 2 +- .../const-generics-gat-in-trait-return-type-1.rs | 1 - .../const-generics-gat-in-trait-return-type-2.rs | 1 - .../const-generics-gat-in-trait-return-type-3.rs | 1 - .../const_params_have_right_type.rs | 2 - .../const_params_have_right_type.stderr | 2 +- .../constraint-assoc-type-suggestion.rs | 2 - .../constraint-assoc-type-suggestion.stderr | 2 +- .../construct_with_other_type.rs | 2 - .../cross-crate-bounds.stderr | 2 +- .../elided-in-expr-position.rs | 1 - .../elided-in-expr-position.stderr | 8 ++-- .../ui/generic-associated-types/empty_generics.rs | 2 - .../generic-associated-types/empty_generics.stderr | 2 +- .../extended/lending_iterator.base.stderr | 2 +- .../extended/lending_iterator.rs | 1 - .../extended/lending_iterator_2.base.stderr | 2 +- .../extended/lending_iterator_2.rs | 1 - .../gat-dont-ice-on-absent-feature-2.rs | 16 -------- .../gat-dont-ice-on-absent-feature-2.stderr | 21 ----------- .../gat-dont-ice-on-absent-feature.rs | 16 -------- .../gat-dont-ice-on-absent-feature.stderr | 19 ---------- .../gat-in-trait-path-undeclared-lifetime.rs | 2 - .../gat-in-trait-path-undeclared-lifetime.stderr | 4 +- .../gat-in-trait-path.base.stderr | 4 +- .../generic-associated-types/gat-in-trait-path.rs | 1 - .../gat-incomplete-warning.rs | 5 --- .../gat-trait-path-generic-type-arg.rs | 2 - .../gat-trait-path-generic-type-arg.stderr | 6 +-- .../gat-trait-path-missing-lifetime.rs | 2 - .../gat-trait-path-missing-lifetime.stderr | 8 ++-- .../gat-trait-path-parenthesised-args.rs | 2 - .../gat-trait-path-parenthesised-args.stderr | 18 ++++----- .../generic-associated-type-bounds.rs | 2 - .../generic-associated-types-where.rs | 2 - .../generic-associated-types-where.stderr | 4 +- ...generic_associated_type_undeclared_lifetimes.rs | 2 - ...ric_associated_type_undeclared_lifetimes.stderr | 4 +- .../ui/generic-associated-types/impl_bounds.rs | 1 - .../ui/generic-associated-types/impl_bounds.stderr | 26 ++++++------- .../ui/generic-associated-types/impl_bounds_ok.rs | 1 - .../ui/generic-associated-types/issue-101020.rs | 35 ++++++++++++++++++ .../generic-associated-types/issue-101020.stderr | 25 +++++++++++++ .../ui/generic-associated-types/issue-102333.rs | 15 ++++++++ .../generic-associated-types/issue-102335-gat.rs | 12 ++++++ .../issue-102335-gat.stderr | 9 +++++ .../issue-47206-where-clause.rs | 2 - .../issue-47206-where-clause.stderr | 2 +- .../issue-58694-parameter-out-of-range.rs | 2 - .../issue-62326-parameter-out-of-range.rs | 2 - .../ui/generic-associated-types/issue-67424.rs | 2 +- .../ui/generic-associated-types/issue-67424.stderr | 12 ------ .../issue-67510-pass.base.stderr | 4 +- .../generic-associated-types/issue-67510-pass.rs | 1 - .../ui/generic-associated-types/issue-67510.rs | 2 - .../ui/generic-associated-types/issue-67510.stderr | 8 ++-- .../issue-68641-check-gat-bounds.rs | 2 - .../issue-68641-check-gat-bounds.stderr | 4 +- .../issue-68642-broken-llvm-ir.rs | 2 - .../issue-68642-broken-llvm-ir.stderr | 4 +- .../issue-68643-broken-mir.rs | 2 - .../issue-68643-broken-mir.stderr | 4 +- .../issue-68644-codegen-selection.rs | 2 - .../issue-68644-codegen-selection.stderr | 4 +- .../issue-68645-codegen-fulfillment.rs | 2 - .../issue-68645-codegen-fulfillment.stderr | 4 +- .../ui/generic-associated-types/issue-68648-1.rs | 3 -- .../ui/generic-associated-types/issue-68648-2.rs | 2 - .../generic-associated-types/issue-68648-2.stderr | 4 +- .../generic-associated-types/issue-68649-pass.rs | 2 - .../ui/generic-associated-types/issue-68653.rs | 2 - .../issue-68656-unsized-values.rs | 2 - .../issue-68656-unsized-values.stderr | 4 +- .../ui/generic-associated-types/issue-70303.rs | 2 - .../ui/generic-associated-types/issue-70304.rs | 2 - .../ui/generic-associated-types/issue-70304.stderr | 6 +-- .../ui/generic-associated-types/issue-71176.rs | 2 - .../ui/generic-associated-types/issue-71176.stderr | 4 +- .../ui/generic-associated-types/issue-74684-1.rs | 2 - .../generic-associated-types/issue-74684-1.stderr | 2 +- .../ui/generic-associated-types/issue-74684-2.rs | 2 - .../generic-associated-types/issue-74684-2.stderr | 10 +++-- .../ui/generic-associated-types/issue-74816.rs | 1 - .../ui/generic-associated-types/issue-74816.stderr | 8 ++-- .../ui/generic-associated-types/issue-74824.rs | 1 - .../ui/generic-associated-types/issue-74824.stderr | 10 ++--- .../ui/generic-associated-types/issue-76407.rs | 2 - .../issue-76535.base.stderr | 14 +++---- .../issue-76535.extended.stderr | 4 +- .../ui/generic-associated-types/issue-76535.rs | 1 - .../ui/generic-associated-types/issue-76826.rs | 2 - .../issue-78113-lifetime-mismatch-dyn-trait-box.rs | 4 +- ...ue-78113-lifetime-mismatch-dyn-trait-box.stderr | 26 ++++++------- .../issue-78671.base.stderr | 8 ++-- .../issue-78671.extended.stderr | 4 +- .../ui/generic-associated-types/issue-78671.rs | 1 - .../issue-79422.base.stderr | 14 +++---- .../issue-79422.extended.stderr | 8 ++-- .../ui/generic-associated-types/issue-79422.rs | 1 - .../ui/generic-associated-types/issue-79636-1.rs | 2 - .../generic-associated-types/issue-79636-1.stderr | 4 +- .../ui/generic-associated-types/issue-79636-2.rs | 2 - .../generic-associated-types/issue-79636-2.stderr | 4 +- .../issue-80433-reduced.rs | 2 - .../ui/generic-associated-types/issue-80433.rs | 2 - .../ui/generic-associated-types/issue-80433.stderr | 4 +- .../ui/generic-associated-types/issue-81487.rs | 2 - .../issue-81712-cyclic-traits.rs | 2 - .../issue-81712-cyclic-traits.stderr | 4 +- .../ui/generic-associated-types/issue-81862.rs | 2 - .../ui/generic-associated-types/issue-81862.stderr | 4 +- .../ui/generic-associated-types/issue-84931.rs | 1 - .../ui/generic-associated-types/issue-84931.stderr | 2 +- .../ui/generic-associated-types/issue-85921.rs | 2 - .../ui/generic-associated-types/issue-86483.rs | 2 - .../ui/generic-associated-types/issue-86787.rs | 1 - .../ui/generic-associated-types/issue-86787.stderr | 2 +- .../ui/generic-associated-types/issue-87258_a.rs | 1 - .../generic-associated-types/issue-87258_a.stderr | 2 +- .../ui/generic-associated-types/issue-87258_b.rs | 1 - .../generic-associated-types/issue-87258_b.stderr | 2 +- .../ui/generic-associated-types/issue-87429-2.rs | 2 - .../issue-87429-associated-type-default.rs | 1 - .../issue-87429-associated-type-default.stderr | 4 +- .../issue-87429-specialization.rs | 1 - .../issue-87429-specialization.stderr | 4 +- .../ui/generic-associated-types/issue-87429.rs | 2 - .../ui/generic-associated-types/issue-87748.rs | 21 +++++++++++ .../ui/generic-associated-types/issue-87750.rs | 2 - .../ui/generic-associated-types/issue-87750.stderr | 2 +- .../ui/generic-associated-types/issue-88287.rs | 1 - .../ui/generic-associated-types/issue-88287.stderr | 4 +- .../ui/generic-associated-types/issue-88360.rs | 2 - .../ui/generic-associated-types/issue-88360.stderr | 2 +- .../ui/generic-associated-types/issue-88405.rs | 2 - .../ui/generic-associated-types/issue-88459.rs | 2 - .../ui/generic-associated-types/issue-88595.rs | 1 - .../ui/generic-associated-types/issue-88595.stderr | 4 +- .../ui/generic-associated-types/issue-89352.rs | 2 - .../ui/generic-associated-types/issue-90014.rs | 1 - .../ui/generic-associated-types/issue-90014.stderr | 4 +- .../ui/generic-associated-types/issue-90729.rs | 2 - .../issue-91139.migrate.stderr | 13 ++----- .../ui/generic-associated-types/issue-91139.rs | 2 - .../ui/generic-associated-types/issue-91139.stderr | 18 ++++----- .../ui/generic-associated-types/issue-91762.rs | 30 --------------- .../ui/generic-associated-types/issue-91762.stderr | 14 ------- .../ui/generic-associated-types/issue-91883.rs | 2 - .../ui/generic-associated-types/issue-91883.stderr | 6 +-- .../ui/generic-associated-types/issue-92033.rs | 2 - .../ui/generic-associated-types/issue-92033.stderr | 4 +- .../issue-92096.migrate.stderr | 4 +- .../ui/generic-associated-types/issue-92096.rs | 2 - .../ui/generic-associated-types/issue-92096.stderr | 2 +- .../ui/generic-associated-types/issue-92280.rs | 1 - .../ui/generic-associated-types/issue-92954.rs | 2 - .../ui/generic-associated-types/issue-93141.rs | 2 - .../ui/generic-associated-types/issue-93262.rs | 2 - .../ui/generic-associated-types/issue-93340.rs | 2 - .../ui/generic-associated-types/issue-93341.rs | 1 - .../ui/generic-associated-types/issue-93342.rs | 2 - .../ui/generic-associated-types/issue-93874.rs | 2 - .../ui/generic-associated-types/issue-95305.rs | 1 - .../ui/generic-associated-types/issue-95305.stderr | 2 +- src/test/ui/generic-associated-types/iterable.rs | 2 - .../method-unsatified-assoc-type-predicate.rs | 2 - .../method-unsatified-assoc-type-predicate.stderr | 4 +- .../generic-associated-types/missing-bounds.fixed | 2 +- .../generic-associated-types/missing-bounds.stderr | 4 +- .../missing-where-clause-on-trait.rs | 2 - .../missing-where-clause-on-trait.stderr | 2 +- .../missing_lifetime_args.rs | 2 - .../missing_lifetime_args.stderr | 12 +++--- .../missing_lifetime_const.rs | 2 - .../missing_lifetime_const.stderr | 4 +- .../parameter_number_and_kind.rs | 1 - .../parameter_number_and_kind.stderr | 12 +++--- .../parameter_number_and_kind_impl.rs | 1 - .../parameter_number_and_kind_impl.stderr | 12 +++--- .../parse/in-trait-impl.rs | 2 - .../ui/generic-associated-types/parse/in-trait.rs | 2 - .../parse/trait-path-expected-token.rs | 2 - .../parse/trait-path-expected-token.stderr | 2 +- .../parse/trait-path-expressions.rs | 2 - .../parse/trait-path-expressions.stderr | 4 +- .../parse/trait-path-missing-gen_arg.rs | 2 - .../parse/trait-path-missing-gen_arg.stderr | 10 ++--- .../parse/trait-path-segments.rs | 2 - .../parse/trait-path-segments.stderr | 6 +-- .../trait-path-type-error-once-implemented.rs | 2 - .../trait-path-type-error-once-implemented.stderr | 8 ++-- .../parse/trait-path-types.rs | 2 - .../parse/trait-path-types.stderr | 6 +-- .../ui/generic-associated-types/pointer_family.rs | 2 - .../projection-bound-cycle-generic.rs | 2 - .../projection-bound-cycle-generic.stderr | 4 +- .../projection-bound-cycle.rs | 1 - .../projection-bound-cycle.stderr | 4 +- .../projection-type-lifetime-mismatch.rs | 2 - .../projection-type-lifetime-mismatch.stderr | 6 +-- .../generic-associated-types/self-outlives-lint.rs | 15 +++++++- .../self-outlives-lint.stderr | 43 ++++++++++++++-------- src/test/ui/generic-associated-types/shadowing.rs | 2 - .../ui/generic-associated-types/shadowing.stderr | 8 ++-- .../generic-associated-types/streaming_iterator.rs | 2 - .../trait-objects.base.stderr | 4 +- .../trait-objects.extended.stderr | 4 +- .../ui/generic-associated-types/trait-objects.rs | 1 - .../type-param-defaults.rs | 34 +++++++++++++++++ .../type-param-defaults.stderr | 20 ++++++++++ .../unsatified-item-lifetime-bound.rs | 2 - .../unsatified-item-lifetime-bound.stderr | 14 +++---- .../unsatisfied-outlives-bound.rs | 2 - .../unsatisfied-outlives-bound.stderr | 8 ++-- .../variance_constraints.rs | 1 - 249 files changed, 685 insertions(+), 678 deletions(-) create mode 100644 src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs create mode 100644 src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr create mode 100644 src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs create mode 100644 src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr create mode 100644 src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs create mode 100644 src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr delete mode 100644 src/test/ui/generic-associated-types/bugs/issue-87748.rs delete mode 100644 src/test/ui/generic-associated-types/bugs/issue-87748.stderr create mode 100644 src/test/ui/generic-associated-types/bugs/issue-91762.rs create mode 100644 src/test/ui/generic-associated-types/bugs/issue-91762.stderr delete mode 100644 src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs delete mode 100644 src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr delete mode 100644 src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs delete mode 100644 src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr delete mode 100644 src/test/ui/generic-associated-types/gat-incomplete-warning.rs create mode 100644 src/test/ui/generic-associated-types/issue-101020.rs create mode 100644 src/test/ui/generic-associated-types/issue-101020.stderr create mode 100644 src/test/ui/generic-associated-types/issue-102333.rs create mode 100644 src/test/ui/generic-associated-types/issue-102335-gat.rs create mode 100644 src/test/ui/generic-associated-types/issue-102335-gat.stderr delete mode 100644 src/test/ui/generic-associated-types/issue-67424.stderr create mode 100644 src/test/ui/generic-associated-types/issue-87748.rs delete mode 100644 src/test/ui/generic-associated-types/issue-91762.rs delete mode 100644 src/test/ui/generic-associated-types/issue-91762.stderr create mode 100644 src/test/ui/generic-associated-types/type-param-defaults.rs create mode 100644 src/test/ui/generic-associated-types/type-param-defaults.stderr (limited to 'src/test/ui/generic-associated-types') 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; 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(_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::>(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::>(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(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 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); +impl Iterator for Eat +where + F: FnMut(I::Item<'_>), +{ + type Item = (); + fn next(&mut self) -> Option { + 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(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 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) +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; } 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: Sized` - --> $DIR/issue-80626.rs:14:10 + --> $DIR/issue-80626.rs:12:10 | LL | Next(A::Allocated) | ^^^^^^^^^^^^^^^^^^ | note: required by a bound in `Allocator::Allocated` - --> $DIR/issue-80626.rs:9:20 + --> $DIR/issue-80626.rs:7:20 | LL | type Allocated; | ^ required by this bound in `Allocator::Allocated` diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.rs b/src/test/ui/generic-associated-types/bugs/issue-86218.rs index fb62c10a9..3a2d758e7 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-86218.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-86218.rs @@ -3,7 +3,6 @@ // This should pass, but seems to run into a TAIT issue. -#![feature(generic_associated_types)] #![feature(type_alias_impl_trait)] pub trait Stream { diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr b/src/test/ui/generic-associated-types/bugs/issue-86218.stderr index fbf1c8f95..de1b464a4 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-86218.stderr @@ -1,17 +1,17 @@ error[E0477]: the type `<() as Yay<&'a ()>>::InnerStream<'s>` does not fulfill the required lifetime - --> $DIR/issue-86218.rs:23:28 + --> $DIR/issue-86218.rs:22:28 | LL | type InnerStream<'s> = impl Stream + 's; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: type must outlive the lifetime `'s` as defined here as required by this binding - --> $DIR/issue-86218.rs:23:22 + --> $DIR/issue-86218.rs:22:22 | LL | type InnerStream<'s> = impl Stream + 's; | ^^ error: unconstrained opaque type - --> $DIR/issue-86218.rs:23:28 + --> $DIR/issue-86218.rs:22:28 | LL | type InnerStream<'s> = impl Stream + 's; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 | ^ 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 `::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..c5fd58096 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 @@ -12,7 +12,7 @@ LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {} = note: expected function signature `for<'r> fn(&'r mut std::iter::Empty) -> _` found function signature `for<'a, 'r> fn(&'r 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: 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(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 | ^ unconstrained type parameter diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.rs b/src/test/ui/generic-associated-types/bugs/issue-89008.rs index 79c28b0d2..012aa8df2 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-89008.rs +++ b/src/test/ui/generic-associated-types/bugs/issue-89008.rs @@ -5,7 +5,6 @@ // This should pass, but seems to run into a TAIT bug. #![feature(type_alias_impl_trait)] -#![feature(generic_associated_types)] use std::future::Future; diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr b/src/test/ui/generic-associated-types/bugs/issue-89008.stderr index 50844fdc1..3f72734ef 100644 --- a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr +++ b/src/test/ui/generic-associated-types/bugs/issue-89008.stderr @@ -1,5 +1,5 @@ error[E0271]: type mismatch resolving ` as Stream>::Item == Repr` - --> $DIR/issue-89008.rs:39:43 + --> $DIR/issue-89008.rs:38:43 | LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving ` as Stream>::Item == Repr` @@ -7,7 +7,7 @@ LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { | this type parameter | note: expected this to be `()` - --> $DIR/issue-89008.rs:18:17 + --> $DIR/issue-89008.rs:17:17 | LL | type Item = (); | ^^ diff --git a/src/test/ui/generic-associated-types/bugs/issue-91762.rs b/src/test/ui/generic-associated-types/bugs/issue-91762.rs new file mode 100644 index 000000000..796935cc0 --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/issue-91762.rs @@ -0,0 +1,29 @@ +// check-fail +// known-bug + +// We almost certaintly want this to pass, but +// it's particularly difficult currently, because we need a way of specifying +// that `::With = 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. + +pub trait Functor { + type With; + + fn fmap(this: Self::With) -> Self::With; +} + +pub trait FunctorExt: Sized { + type Base: Functor = Self>; + + fn fmap(self) { + let arg: ::With; + let ret: ::With; + + arg = self; + ret = ::fmap(arg); + //~^ type annotations needed + } +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/bugs/issue-91762.stderr b/src/test/ui/generic-associated-types/bugs/issue-91762.stderr new file mode 100644 index 000000000..1272c8b8a --- /dev/null +++ b/src/test/ui/generic-associated-types/bugs/issue-91762.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/issue-91762.rs:24:15 + | +LL | ret = ::fmap(arg); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `fmap` + | +help: consider specifying the generic arguments + | +LL | ret = ::fmap::(arg); + | ++++++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. 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(ints: &C) -> >::Sibling | ------------------------------------ expected `>::Sibling` 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; } 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; } 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 = 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 LendingIterator = 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 LendingIterator = 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; - //~^ ERROR generic associated types are unstable [E0658] -} - -impl MyTrait for Foo { - type Item = 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; - | ^^^^^^^^^^^^^ - | - = note: see issue #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; - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #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 { - 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 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 X = &'a [u32]>>) {} | ^^ undeclared lifetime @@ -15,7 +15,7 @@ LL | fn _f<'x>(arg : Box 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 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 Foo = &'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 - --> $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 Foo for T { | -- first use of `T1` @@ -8,13 +8,13 @@ LL | type F = &[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 = &[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 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>(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 = 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>(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>) {} | ^^ 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>) {} | ^^^^^ @@ -16,7 +16,7 @@ LL | fn foo<'a>(arg: Box = &'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>) {} | ^-- @@ -24,13 +24,13 @@ LL | fn bar<'a>(arg: Box>) {} | 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>) {} | ^ 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>) {} | +++ 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>) {} | ^---- help: remove these generics @@ -48,19 +48,19 @@ LL | fn foo<'a>(arg: Box>) {} | 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>) {} | ^ 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 = Vec; | ^^^^^^ `T` cannot be formatted with the default formatter @@ -11,7 +11,7 @@ LL | type Assoc2 = Vec; | +++++++++++++++++++ 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; | -------------- 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>; | ^^ 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` - --> $DIR/impl_bounds.rs:11:10 +note: required for `Fooy` to implement `Copy` + --> $DIR/impl_bounds.rs:10:10 | LL | #[derive(Copy, Clone)] | ^^^^ note: the requirement `Fooy: 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 Foo for Fooy { | +++++++++++++++++++ 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` - --> $DIR/impl_bounds.rs:11:10 +note: required for `Fooy` to implement `Copy` + --> $DIR/impl_bounds.rs:10:10 | LL | #[derive(Copy, Clone)] | ^^^^ note: the requirement `Fooy: 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(self, _f: F) + where + Self: Sized, + for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>, + { + } +} + +impl 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: Sized, +{ +} +impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo {} +trait Foo {} + +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 {} + | ^^^^^^^^^^^^^^^^ ^ +note: required by a bound in `LendingIterator::consume` + --> $DIR/issue-101020.rs:9:33 + | +LL | fn consume(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-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 = ()>; +} + +trait B { + type U; +} + +fn f() { + let _: <::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 = ()>; + //~^ ERROR associated type bindings are not allowed here +} + +trait Q {} + +trait S { + type C: 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 = ()>; + | ^^^^^^^^ 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; } 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; | -------------- 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: Trait1; - //~^ 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: Trait1; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #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=&'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 - --> $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 = &'a ()>>) {} | ^^ undeclared lifetime @@ -15,7 +15,7 @@ LL | fn f<'a>(x: Box = &'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 = &'a ()>>) {} | ^^ undeclared lifetime @@ -30,13 +30,13 @@ LL | fn f<'a>(x: Box = &'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 = &'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 - --> $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 = 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 { type Item<'a>: std::ops::Deref; 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 `::Target == T` - --> $DIR/issue-68656-unsized-values.rs:15:21 + --> $DIR/issue-68656-unsized-values.rs:13:21 | LL | impl UnsafeCopy for T { | - this type parameter @@ -9,7 +9,7 @@ LL | type Item<'a> = T; = note: expected type parameter `T` found associated type `::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; | ^^^^^^^^^^ 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 = 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 = DocCursorImpl<'_>> { | ^^ expected named lifetime parameter @@ -17,7 +17,7 @@ LL | fn create_doc() -> impl Document = 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>, | ^ 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 = [u8]>>(_ : Box) -> &'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 = [u8]>>(t: Box) -> &'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: Copy` is not satisfied - --> $DIR/issue-74824.rs:7:26 + --> $DIR/issue-74824.rs:6:26 | LL | type Copy: Copy = Box; | ^^^^^^ the trait `Copy` is not implemented for `Box` | note: required by a bound in `UnsafeCopy::Copy` - --> $DIR/issue-74824.rs:7:19 + --> $DIR/issue-74824.rs:6:19 | LL | type Copy: Copy = Box; | ^^^^ 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: Copy = Box; | ^^^^^^ the trait `Clone` is not implemented for `T` | - = note: required because of the requirements on the impl of `Clone` for `Box` + = note: required for `Box` 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: Copy = Box; | ^^^^ 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> = 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 = 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> = 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 - --> $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> = 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 - --> $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>>>` for `Box` + = note: required for `Box` to implement `CoerceUnsized>>>` = note: required by cast to type `Box>>` 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> = 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 {} 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; | ^^^^^^^^^^^^^^^ | 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; | ^^ = 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 {} | ^ @@ -26,51 +26,51 @@ LL | impl A for Box {} | ++++ 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; | ^^^^^^^^^^^^^^^ | 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; | ^^ 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 {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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, Box); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 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, Box); | ^^ = 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, Box) {} | ^ 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, Box) {} | ^ 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 | ^^^^^^ 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; | ^^^^^^ - @@ -15,13 +15,13 @@ LL | Box::new(Family) as &dyn CollectionFamily=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 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `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 - --> $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 | ^^^^^^ 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; | ^^^^^^ - 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>>; | ^^^^^^^^ 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 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>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `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 - --> $DIR/issue-79422.rs:24:10 + --> $DIR/issue-79422.rs:23:10 | LL | trait MapLike { | ------- 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::::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 - --> $DIR/issue-79422.rs:24:10 + --> $DIR/issue-79422.rs:23:10 | LL | trait MapLike { | ------- 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 + 'static)>>>` for `Box>` + = note: required for `Box>` to implement `CoerceUnsized + 'static)>>>` = note: required by cast to type `Box + '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>>; | ^^^^^^^^ 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 RefCont<'_, u8>>>; | ~~~~~~~~~~~~ error[E0271]: type mismatch resolving ` as MapLike>::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::::new()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving ` as MapLike>::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; 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>, | ^^^^^^^ 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; | ^^^^^^^ - 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: 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, | ^^^^^^^ 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: 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 { 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) | ^^^^^^ 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; } 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; | ^^^^^ 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: D; | ^^^^^ - 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; 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; | ^^^^ 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-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 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 { 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..fa0748a28 100644 --- a/src/test/ui/generic-associated-types/issue-87258_a.stderr +++ b/src/test/ui/generic-associated-types/issue-87258_a.stderr @@ -1,5 +1,5 @@ error: unconstrained opaque type - --> $DIR/issue-87258_a.rs:18:26 + --> $DIR/issue-87258_a.rs:17:26 | LL | type FooFuture<'a> = impl Trait1; | ^^^^^^^^^^^ 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 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> = 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> = 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>; 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..d8e889aec 100644 --- a/src/test/ui/generic-associated-types/issue-87429-specialization.stderr +++ b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr @@ -9,14 +9,14 @@ LL | #![feature(specialization)] = help: consider using `min_specialization` instead, which is more stable and complete 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>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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>; } 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; } 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: Sized` - --> $DIR/issue-87750.rs:20:16 + --> $DIR/issue-87750.rs:18:16 | LL | let _list: ::Pointer>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 `>` - --> $DIR/issue-88287.rs:25:6 + --> $DIR/issue-88287.rs:24:6 | LL | impl SearchableResourceExt for T | ^ required by this bound in `>` 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 | - 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/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 { 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; | ^^^^^^^^^^^^^^^^^^^^^^^^- 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; | ^^ 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>::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() { - | ++++ +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 { 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>::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>::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>::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>::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>::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>::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>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -46,13 +46,13 @@ LL | fn foo() { | +++++++++ 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>::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>::Type<'a>, &'a T) = |_, _| (); | ^^^^^^^^^ diff --git a/src/test/ui/generic-associated-types/issue-91762.rs b/src/test/ui/generic-associated-types/issue-91762.rs deleted file mode 100644 index b259a3c6e..000000000 --- a/src/test/ui/generic-associated-types/issue-91762.rs +++ /dev/null @@ -1,30 +0,0 @@ -// check-fail - -// FIXME(generic_associated_types): We almost certaintly want this to pass, but -// it's particularly difficult currently, because we need a way of specifying -// that `::With = 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; - - fn fmap(this: Self::With) -> Self::With; -} - -pub trait FunctorExt: Sized { - type Base: Functor = Self>; - - fn fmap(self) { - let arg: ::With; - let ret: ::With; - - arg = self; - ret = ::fmap(arg); - //~^ type annotations needed - } -} - -fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-91762.stderr b/src/test/ui/generic-associated-types/issue-91762.stderr deleted file mode 100644 index c2785fee3..000000000 --- a/src/test/ui/generic-associated-types/issue-91762.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-91762.rs:25:15 - | -LL | ret = ::fmap(arg); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `fmap` - | -help: consider specifying the generic arguments - | -LL | ret = ::fmap::(arg); - | ++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. 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 | -------------------------------------------------- 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) -> 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) -> 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 &'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; fn build(self, input: O) -> Self::Output; 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 = 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; } 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 `::Y = i32` was not satisfied - --> $DIR/method-unsatified-assoc-type-predicate.rs:14:11 + --> $DIR/method-unsatified-assoc-type-predicate.rs:12:11 | LL | impl = 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> Add for C { struct D(B); -impl> Add for D { +impl> Add for D { 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> Add for D { - | +++++++++++++++++++++++++ +LL | impl> Add for D { + | +++++++++++++++++++++++++++ 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>) {} | ^ 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 = (&'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 _: ::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 = Self::E<'static, T, u32>; | ^ --- help: remove this generic argument @@ -37,7 +37,7 @@ LL | type FErr2 = 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; | 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 = 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 Baz for T where T: Foo { type Quux<'a> = ::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>) {} | - ^ 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>) {} | - ^ expected expression @@ -7,7 +7,7 @@ LL | fn f1<'a>(arg : Box>) {} | 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>) {} | - ^ 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>) {} | ^ 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>) {} | ^ 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>) {} | ^ @@ -25,7 +25,7 @@ LL | fn f1<'a>(arg : Box>) {} | 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>) {} | - ^ expected one of `>`, a const expression, lifetime, or type @@ -33,7 +33,7 @@ LL | fn f1<'a>(arg : Box>) {} | 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>) {} | ^^^^^^^^^^^ 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>) {} | - ^ expected one of 8 possible tokens @@ -12,7 +12,7 @@ LL | fn f1<'a>(arg : Box = u32>>) {} | + error: expected one of `,`, `::`, `:`, or `>`, found `=` - --> $DIR/trait-path-segments.rs:19:35 + --> $DIR/trait-path-segments.rs:17:35 | LL | impl::Y<'a> = &'a u32>> Z for T {} | - ^ expected one of `,`, `::`, `:`, or `>` @@ -25,7 +25,7 @@ LL | impl::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 = &'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 = &'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 = &'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 = &'a ()>>) {} | ^--- help: remove these generics @@ -23,7 +23,7 @@ LL | fn f2<'a>(arg : Box = &'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>) {} | - ^ expected one of `,`, `:`, or `>` @@ -12,7 +12,7 @@ LL | fn f<'a>(arg : Box = 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) = &'a ()>>) {} | - ^ expected one of `,`, `:`, or `>` @@ -25,7 +25,7 @@ LL | fn f1<'a>(arg : Box)> = &'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>) {} | -- ^ 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 `::Item: Sized` - --> $DIR/projection-bound-cycle-generic.rs:44:18 + --> $DIR/projection-bound-cycle-generic.rs:42:18 | LL | type Assoc = OnlySized<::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 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 `::Item: Sized` - --> $DIR/projection-bound-cycle.rs:46:18 + --> $DIR/projection-bound-cycle.rs:45:18 | LL | type Assoc = OnlySized<::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 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 = &'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 X = &'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 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 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 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 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 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 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 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 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 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 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 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>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- @@ -131,7 +131,7 @@ LL | type Iterator<'a>: Iterator>; = note: we are soliciting feedback, see issue #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 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 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 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 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 { | - first use of `T` @@ -23,7 +23,7 @@ LL | type Bar; | ^ 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 NoShadowT for Option { | - 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 = &'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 - --> $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 = &'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; + //~^ defaults for type parameters are only allowed +} + +impl Trait for () { + type Assoc = u64; + //~^ defaults for type parameters are only allowed +} + +impl Trait for u32 { + type Assoc = T; + //~^ defaults for type parameters are only allowed +} + +trait Other {} +impl Other for u32 {} + +fn foo() +where + T: Trait, + T::Assoc: Other { + } + +fn main() { + // errors + foo::<()>(); + // works + foo::(); +} 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; + | ^^^^^^^ + +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 = 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; + | ^^^^^^^ + +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: ::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 = &'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: ::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; -- cgit v1.2.3