about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_feature/src/removed.rs7
-rw-r--r--compiler/rustc_feature/src/unstable.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs5
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs26
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs2
-rw-r--r--tests/crashes/131538.rs13
-rw-r--r--tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs4
-rw-r--r--tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr12
-rw-r--r--tests/ui/generic-associated-types/extended/lending_iterator.rs9
-rw-r--r--tests/ui/generic-associated-types/extended/lending_iterator.stderr (renamed from tests/ui/generic-associated-types/extended/lending_iterator.base.stderr)4
-rw-r--r--tests/ui/generic-associated-types/extended/lending_iterator_2.rs8
-rw-r--r--tests/ui/generic-associated-types/extended/lending_iterator_2.stderr (renamed from tests/ui/generic-associated-types/extended/lending_iterator_2.base.stderr)2
-rw-r--r--tests/ui/generic-associated-types/gat-in-trait-path.rs12
-rw-r--r--tests/ui/generic-associated-types/gat-in-trait-path.stderr58
-rw-r--r--tests/ui/generic-associated-types/issue-67510-pass.rs9
-rw-r--r--tests/ui/generic-associated-types/issue-67510-pass.stderr18
-rw-r--r--tests/ui/generic-associated-types/issue-76535.rs9
-rw-r--r--tests/ui/generic-associated-types/issue-76535.stderr55
-rw-r--r--tests/ui/generic-associated-types/issue-78671.rs7
-rw-r--r--tests/ui/generic-associated-types/issue-78671.stderr35
-rw-r--r--tests/ui/generic-associated-types/issue-79422.rs10
-rw-r--r--tests/ui/generic-associated-types/issue-79422.stderr57
-rw-r--r--tests/ui/generic-associated-types/trait-objects.rs12
-rw-r--r--tests/ui/generic-associated-types/trait-objects.stderr48
24 files changed, 300 insertions, 124 deletions
diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs
index 69a14bd9f12..8b4f441dafe 100644
--- a/compiler/rustc_feature/src/removed.rs
+++ b/compiler/rustc_feature/src/removed.rs
@@ -119,6 +119,13 @@ declare_features! (
     (removed, generator_clone, "1.65.0", Some(95360), Some("renamed to `coroutine_clone`")),
     /// Allows defining generators.
     (removed, generators, "1.21.0", Some(43122), Some("renamed to `coroutines`")),
+    /// An extension to the `generic_associated_types` feature, allowing incomplete features.
+    (removed, generic_associated_types_extended, "CURRENT_RUSTC_VERSION", Some(95451),
+        Some(
+            "feature needs overhaul and reimplementation pending \
+            better implied higher-ranked implied bounds support"
+        )
+    ),
     /// Allows `impl Trait` in bindings (`let`, `const`, `static`).
     (removed, impl_trait_in_bindings, "1.55.0", Some(63065),
      Some("the implementation was not maintainable, the feature may get reintroduced once the current refactorings are done")),
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index ec908762da7..1f205dacd17 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -497,8 +497,6 @@ declare_features! (
     (unstable, gen_blocks, "1.75.0", Some(117078)),
     /// Infer generic args for both consts and types.
     (unstable, generic_arg_infer, "1.55.0", Some(85077)),
-    /// An extension to the `generic_associated_types` feature, allowing incomplete features.
-    (incomplete, generic_associated_types_extended, "1.61.0", Some(95451)),
     /// Allows non-trivial generic constants which have to have wfness manually propagated to callers
     (incomplete, generic_const_exprs, "1.56.0", Some(76560)),
     /// Allows generic parameters and where-clauses on free & associated const items.
diff --git a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs
index e0a9ddf1876..43481ee910a 100644
--- a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs
+++ b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs
@@ -329,10 +329,7 @@ pub fn dyn_compatibility_violations_for_assoc_item(
             .collect(),
         // Associated types can only be dyn-compatible if they have `Self: Sized` bounds.
         ty::AssocKind::Type => {
-            if !tcx.features().generic_associated_types_extended()
-                && !tcx.generics_of(item.def_id).is_own_empty()
-                && !item.is_impl_trait_in_trait()
-            {
+            if !tcx.generics_of(item.def_id).is_own_empty() && !item.is_impl_trait_in_trait() {
                 vec![DynCompatibilityViolation::GAT(item.name, item.ident(tcx).span)]
             } else {
                 // We will permit associated types if they are explicitly mentioned in the trait object.
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 01f6cccb375..49c34550f8e 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -14,7 +14,7 @@ use rustc_middle::traits::select::OverflowError;
 use rustc_middle::traits::{BuiltinImplSource, ImplSource, ImplSourceUserDefinedData};
 use rustc_middle::ty::fast_reject::DeepRejectCtxt;
 use rustc_middle::ty::fold::TypeFoldable;
-use rustc_middle::ty::visit::{MaxUniverse, TypeVisitable, TypeVisitableExt};
+use rustc_middle::ty::visit::TypeVisitableExt;
 use rustc_middle::ty::{self, Term, Ty, TyCtxt, TypingMode, Upcast};
 use rustc_middle::{bug, span_bug};
 use rustc_span::symbol::sym;
@@ -179,35 +179,11 @@ pub(super) fn poly_project_and_unify_term<'cx, 'tcx>(
 ) -> ProjectAndUnifyResult<'tcx> {
     let infcx = selcx.infcx;
     let r = infcx.commit_if_ok(|_snapshot| {
-        let old_universe = infcx.universe();
         let placeholder_predicate = infcx.enter_forall_and_leak_universe(obligation.predicate);
-        let new_universe = infcx.universe();
 
         let placeholder_obligation = obligation.with(infcx.tcx, placeholder_predicate);
         match project_and_unify_term(selcx, &placeholder_obligation) {
             ProjectAndUnifyResult::MismatchedProjectionTypes(e) => Err(e),
-            ProjectAndUnifyResult::Holds(obligations)
-                if old_universe != new_universe
-                    && selcx.tcx().features().generic_associated_types_extended() =>
-            {
-                // If the `generic_associated_types_extended` feature is active, then we ignore any
-                // obligations references lifetimes from any universe greater than or equal to the
-                // universe just created. Otherwise, we can end up with something like `for<'a> I: 'a`,
-                // which isn't quite what we want. Ideally, we want either an implied
-                // `for<'a where I: 'a> I: 'a` or we want to "lazily" check these hold when we
-                // instantiate concrete regions. There is design work to be done here; until then,
-                // however, this allows experimenting potential GAT features without running into
-                // well-formedness issues.
-                let new_obligations = obligations
-                    .into_iter()
-                    .filter(|obligation| {
-                        let mut visitor = MaxUniverse::new();
-                        obligation.predicate.visit_with(&mut visitor);
-                        visitor.max_universe() < new_universe
-                    })
-                    .collect();
-                Ok(ProjectAndUnifyResult::Holds(new_obligations))
-            }
             other => Ok(other),
         }
     });
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index 712856e6a8f..19b4125e75c 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -626,7 +626,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         for assoc_type in assoc_types {
             let defs: &ty::Generics = tcx.generics_of(assoc_type);
 
-            if !defs.own_params.is_empty() && !tcx.features().generic_associated_types_extended() {
+            if !defs.own_params.is_empty() {
                 tcx.dcx().span_delayed_bug(
                     obligation.cause.span,
                     "GATs in trait object shouldn't have been considered",
diff --git a/tests/crashes/131538.rs b/tests/crashes/131538.rs
deleted file mode 100644
index f971d8b7791..00000000000
--- a/tests/crashes/131538.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ known-bug: #131538
-#![feature(generic_associated_types_extended)]
-#![feature(trivial_bounds)]
-
-trait HealthCheck {
-    async fn check<const N: usize>();
-}
-
-fn do_health_check_par()
-where
-    HealthCheck: HealthCheck,
-{
-}
diff --git a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs b/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs
deleted file mode 100644
index 7842d44ac4f..00000000000
--- a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-// This feature doesn't *currently* fire on any specific code; it's just a
-// behavior change. Future changes might.
-#[rustc_error] //~ the
-fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr b/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr
deleted file mode 100644
index a5ab1b0d631..00000000000
--- a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable
-  --> $DIR/feature-gate-generic_associated_types_extended.rs:3:1
-   |
-LL | #[rustc_error]
-   | ^^^^^^^^^^^^^^
-   |
-   = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/generic-associated-types/extended/lending_iterator.rs b/tests/ui/generic-associated-types/extended/lending_iterator.rs
index 7cd32413001..8d815f6dc78 100644
--- a/tests/ui/generic-associated-types/extended/lending_iterator.rs
+++ b/tests/ui/generic-associated-types/extended/lending_iterator.rs
@@ -1,9 +1,4 @@
-//@ revisions: base extended
-//@[base] check-fail
-//@[extended] check-pass
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
+//@ known-bug: #133805
 
 pub trait FromLendingIterator<A>: Sized {
     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
@@ -11,7 +6,6 @@ pub trait FromLendingIterator<A>: Sized {
 
 impl<A> FromLendingIterator<A> for Vec<A> {
     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self {
-        //[base]~^ impl has stricter
         let mut v = vec![];
         while let Some(item) = iter.next() {
             v.push(item);
@@ -32,7 +26,6 @@ pub trait LendingIterator {
         Self: for<'q> LendingIterator<Item<'q> = A>,
     {
         <B as FromLendingIterator<A>>::from_iter(self)
-        //[base]~^ ERROR: does not live long enough
     }
 }
 
diff --git a/tests/ui/generic-associated-types/extended/lending_iterator.base.stderr b/tests/ui/generic-associated-types/extended/lending_iterator.stderr
index b19280b45c2..84f5ed07bda 100644
--- a/tests/ui/generic-associated-types/extended/lending_iterator.base.stderr
+++ b/tests/ui/generic-associated-types/extended/lending_iterator.stderr
@@ -1,5 +1,5 @@
 error[E0276]: impl has stricter requirements than trait
-  --> $DIR/lending_iterator.rs:13:45
+  --> $DIR/lending_iterator.rs:8:45
    |
 LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
    |     ------------------------------------------------------------------------ definition of `from_iter` from trait
@@ -8,7 +8,7 @@ LL |     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) ->
    |                                             ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
 
 error: `Self` does not live long enough
-  --> $DIR/lending_iterator.rs:34:9
+  --> $DIR/lending_iterator.rs:28:9
    |
 LL |         <B as FromLendingIterator<A>>::from_iter(self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/generic-associated-types/extended/lending_iterator_2.rs b/tests/ui/generic-associated-types/extended/lending_iterator_2.rs
index f4b0dae0a91..0545d4d12bb 100644
--- a/tests/ui/generic-associated-types/extended/lending_iterator_2.rs
+++ b/tests/ui/generic-associated-types/extended/lending_iterator_2.rs
@@ -1,9 +1,4 @@
-//@ revisions: base extended
-//@[base] check-fail
-//@[extended] check-pass
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
+//@ known-bug: #133805
 
 pub trait FromLendingIterator<A>: Sized {
     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
@@ -11,7 +6,6 @@ pub trait FromLendingIterator<A>: Sized {
 
 impl<A> FromLendingIterator<A> for Vec<A> {
     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self {
-        //[base]~^ impl has stricter
         let mut v = vec![];
         while let Some(item) = iter.next() {
             v.push(item);
diff --git a/tests/ui/generic-associated-types/extended/lending_iterator_2.base.stderr b/tests/ui/generic-associated-types/extended/lending_iterator_2.stderr
index 717d867057e..47c32a28aea 100644
--- a/tests/ui/generic-associated-types/extended/lending_iterator_2.base.stderr
+++ b/tests/ui/generic-associated-types/extended/lending_iterator_2.stderr
@@ -1,5 +1,5 @@
 error[E0276]: impl has stricter requirements than trait
-  --> $DIR/lending_iterator_2.rs:13:45
+  --> $DIR/lending_iterator_2.rs:8:45
    |
 LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
    |     ------------------------------------------------------------------------ definition of `from_iter` from trait
diff --git a/tests/ui/generic-associated-types/gat-in-trait-path.rs b/tests/ui/generic-associated-types/gat-in-trait-path.rs
index 7eb0aabb333..cd759a73cf2 100644
--- a/tests/ui/generic-associated-types/gat-in-trait-path.rs
+++ b/tests/ui/generic-associated-types/gat-in-trait-path.rs
@@ -1,10 +1,6 @@
-//@ revisions: base extended
-//@[base] check-fail
-//@[extended] check-pass
+//@ check-fail
 
 #![feature(associated_type_defaults)]
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
 
 trait Foo {
     type A<'a> where Self: 'a;
@@ -24,12 +20,12 @@ impl<T> Foo for Fooer<T> {
 }
 
 fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {}
-//[base]~^ the trait `Foo` cannot be made into an object
+//~^ the trait `Foo` cannot be made into an object
 
 
 fn main() {
   let foo = Fooer(5);
   f(Box::new(foo));
-  //[base]~^ the trait `Foo` cannot be made into an object
-  //[base]~| the trait `Foo` cannot be made into an object
+  //~^ the trait `Foo` cannot be made into an object
+  //~| the trait `Foo` cannot be made into an object
 }
diff --git a/tests/ui/generic-associated-types/gat-in-trait-path.stderr b/tests/ui/generic-associated-types/gat-in-trait-path.stderr
new file mode 100644
index 00000000000..b2176fa6de3
--- /dev/null
+++ b/tests/ui/generic-associated-types/gat-in-trait-path.stderr
@@ -0,0 +1,58 @@
+error[E0038]: the trait `Foo` cannot be made into an object
+  --> $DIR/gat-in-trait-path.rs:22:17
+   |
+LL | fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {}
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/gat-in-trait-path.rs:6:10
+   |
+LL | trait Foo {
+   |       --- this trait cannot be made into an object...
+LL |     type A<'a> where Self: 'a;
+   |          ^ ...because it contains the generic associated type `A`
+   = help: consider moving `A` to another trait
+   = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `Foo` for this new enum and using it instead:
+             Fooy
+             Fooer<T>
+
+error[E0038]: the trait `Foo` cannot be made into an object
+  --> $DIR/gat-in-trait-path.rs:28:5
+   |
+LL |   f(Box::new(foo));
+   |     ^^^^^^^^^^^^^ `Foo` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/gat-in-trait-path.rs:6:10
+   |
+LL | trait Foo {
+   |       --- this trait cannot be made into an object...
+LL |     type A<'a> where Self: 'a;
+   |          ^ ...because it contains the generic associated type `A`
+   = help: consider moving `A` to another trait
+   = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `Foo` for this new enum and using it instead:
+             Fooy
+             Fooer<T>
+
+error[E0038]: the trait `Foo` cannot be made into an object
+  --> $DIR/gat-in-trait-path.rs:28:5
+   |
+LL |   f(Box::new(foo));
+   |     ^^^^^^^^^^^^^ `Foo` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/gat-in-trait-path.rs:6:10
+   |
+LL | trait Foo {
+   |       --- this trait cannot be made into an object...
+LL |     type A<'a> where Self: 'a;
+   |          ^ ...because it contains the generic associated type `A`
+   = help: consider moving `A` to another trait
+   = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `Foo` for this new enum and using it instead:
+             Fooy
+             Fooer<T>
+   = note: required for the cast from `Box<Fooer<{integer}>>` to `Box<(dyn Foo<A<'a> = &'a ()> + 'static)>`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/generic-associated-types/issue-67510-pass.rs b/tests/ui/generic-associated-types/issue-67510-pass.rs
index 1596f401bbc..a48d9c37cd4 100644
--- a/tests/ui/generic-associated-types/issue-67510-pass.rs
+++ b/tests/ui/generic-associated-types/issue-67510-pass.rs
@@ -1,15 +1,10 @@
-//@ revisions: base extended
-//@[base] check-fail
-//@[extended] check-pass
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
+//@ check-fail
 
 trait X {
     type Y<'a>;
 }
 
 fn _func1<'a>(_x: Box<dyn X<Y<'a>=&'a ()>>) {}
-//[base]~^ ERROR the trait `X` cannot be made into an object
+//~^ ERROR the trait `X` cannot be made into an object
 
 fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-67510-pass.stderr b/tests/ui/generic-associated-types/issue-67510-pass.stderr
new file mode 100644
index 00000000000..5560cb0f64d
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-67510-pass.stderr
@@ -0,0 +1,18 @@
+error[E0038]: the trait `X` cannot be made into an object
+  --> $DIR/issue-67510-pass.rs:7:23
+   |
+LL | fn _func1<'a>(_x: Box<dyn X<Y<'a>=&'a ()>>) {}
+   |                       ^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-67510-pass.rs:4:10
+   |
+LL | trait X {
+   |       - this trait cannot be made into an object...
+LL |     type Y<'a>;
+   |          ^ ...because it contains the generic associated type `Y`
+   = help: consider moving `Y` to another trait
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/generic-associated-types/issue-76535.rs b/tests/ui/generic-associated-types/issue-76535.rs
index cf26b65c85f..9e18c82c7f1 100644
--- a/tests/ui/generic-associated-types/issue-76535.rs
+++ b/tests/ui/generic-associated-types/issue-76535.rs
@@ -1,8 +1,3 @@
-//@ revisions: base extended
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
-
 pub trait SubTrait {}
 
 pub trait SuperTrait {
@@ -38,6 +33,6 @@ impl SuperTrait for SuperStruct {
 fn main() {
     let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
       //~^ ERROR missing generics for associated type
-      //[base]~^^ ERROR the trait
-      //[base]~| ERROR the trait
+      //~^^ ERROR the trait
+      //~| ERROR the trait
 }
diff --git a/tests/ui/generic-associated-types/issue-76535.stderr b/tests/ui/generic-associated-types/issue-76535.stderr
new file mode 100644
index 00000000000..613ded6f1ef
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-76535.stderr
@@ -0,0 +1,55 @@
+error[E0107]: missing generics for associated type `SuperTrait::SubType`
+  --> $DIR/issue-76535.rs:34:33
+   |
+LL |     let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
+   |                                 ^^^^^^^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/issue-76535.rs:4:10
+   |
+LL |     type SubType<'a>: SubTrait where Self: 'a;
+   |          ^^^^^^^ --
+help: add missing lifetime argument
+   |
+LL |     let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperStruct::new(0));
+   |                                        ++++
+
+error[E0038]: the trait `SuperTrait` cannot be made into an object
+  --> $DIR/issue-76535.rs:34:14
+   |
+LL |     let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-76535.rs:4: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
+   = help: only type `SuperStruct` is seen to implement the trait in this crate, consider using it directly instead
+   = note: `SuperTrait` can be implemented in other crates; if you want to support your users passing their own types here, you can't refer to a specific type
+
+error[E0038]: the trait `SuperTrait` cannot be made into an object
+  --> $DIR/issue-76535.rs:34:57
+   |
+LL |     let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
+   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-76535.rs:4: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
+   = help: only type `SuperStruct` is seen to implement the trait in this crate, consider using it directly instead
+   = note: `SuperTrait` can be implemented in other crates; if you want to support your users passing their own types here, you can't refer to a specific type
+   = note: required for the cast from `Box<SuperStruct>` to `Box<dyn SuperTrait<SubType<'_> = SubStruct<'_>>>`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0038, E0107.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/generic-associated-types/issue-78671.rs b/tests/ui/generic-associated-types/issue-78671.rs
index ce4c040644a..0871def1731 100644
--- a/tests/ui/generic-associated-types/issue-78671.rs
+++ b/tests/ui/generic-associated-types/issue-78671.rs
@@ -1,15 +1,10 @@
-//@ revisions: base extended
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
-
 trait CollectionFamily {
     type Member<T>;
 }
 fn floatify() {
     Box::new(Family) as &dyn CollectionFamily<Member=usize>
     //~^ ERROR: missing generics for associated type
-    //[base]~^^ ERROR: the trait `CollectionFamily` cannot be made into an object
+    //~| ERROR: the trait `CollectionFamily` cannot be made into an object
 }
 
 struct Family;
diff --git a/tests/ui/generic-associated-types/issue-78671.stderr b/tests/ui/generic-associated-types/issue-78671.stderr
new file mode 100644
index 00000000000..fbd76c73895
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-78671.stderr
@@ -0,0 +1,35 @@
+error[E0107]: missing generics for associated type `CollectionFamily::Member`
+  --> $DIR/issue-78671.rs:5:47
+   |
+LL |     Box::new(Family) as &dyn CollectionFamily<Member=usize>
+   |                                               ^^^^^^ expected 1 generic argument
+   |
+note: associated type defined here, with 1 generic parameter: `T`
+  --> $DIR/issue-78671.rs:2:10
+   |
+LL |     type Member<T>;
+   |          ^^^^^^ -
+help: add missing generic argument
+   |
+LL |     Box::new(Family) as &dyn CollectionFamily<Member<T>=usize>
+   |                                                     +++
+
+error[E0038]: the trait `CollectionFamily` cannot be made into an object
+  --> $DIR/issue-78671.rs:5:25
+   |
+LL |     Box::new(Family) as &dyn CollectionFamily<Member=usize>
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `CollectionFamily` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-78671.rs:2:10
+   |
+LL | trait CollectionFamily {
+   |       ---------------- this trait cannot be made into an object...
+LL |     type Member<T>;
+   |          ^^^^^^ ...because it contains the generic associated type `Member`
+   = help: consider moving `Member` to another trait
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0038, E0107.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/generic-associated-types/issue-79422.rs b/tests/ui/generic-associated-types/issue-79422.rs
index bf61dcaee3a..fba7a86990e 100644
--- a/tests/ui/generic-associated-types/issue-79422.rs
+++ b/tests/ui/generic-associated-types/issue-79422.rs
@@ -1,8 +1,3 @@
-//@ revisions: base extended
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
-
 trait RefCont<'a, T> {
     fn t(&'a self) -> &'a T;
 }
@@ -42,9 +37,8 @@ impl<K, V: Default> MapLike<K, V> for Source {
 
 fn main() {
     let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
-    //[base]~^ ERROR the trait
-    //[extended]~^^ type mismatch
+    //~^ ERROR the trait
         as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
       //~^ ERROR missing generics for associated type
-      //[base]~^^ ERROR the trait
+      //~| ERROR the trait
 }
diff --git a/tests/ui/generic-associated-types/issue-79422.stderr b/tests/ui/generic-associated-types/issue-79422.stderr
new file mode 100644
index 00000000000..26567e5e927
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-79422.stderr
@@ -0,0 +1,57 @@
+error[E0107]: missing generics for associated type `MapLike::VRefCont`
+  --> $DIR/issue-79422.rs:41:36
+   |
+LL |         as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
+   |                                    ^^^^^^^^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/issue-79422.rs:18:10
+   |
+LL |     type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
+   |          ^^^^^^^^ --
+help: add missing lifetime argument
+   |
+LL |         as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
+   |                                            ++++
+
+error[E0038]: the trait `MapLike` cannot be made into an object
+  --> $DIR/issue-79422.rs:41:12
+   |
+LL |         as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-79422.rs:18:10
+   |
+LL | trait MapLike<K, V> {
+   |       ------- this trait cannot be made into an object...
+LL |     type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
+   |          ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
+   = help: consider moving `VRefCont` to another trait
+   = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `MapLike` for this new enum and using it instead:
+             std::collections::BTreeMap<K, V>
+             Source
+
+error[E0038]: the trait `MapLike` cannot be made into an object
+  --> $DIR/issue-79422.rs:39:13
+   |
+LL |     let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-79422.rs:18:10
+   |
+LL | trait MapLike<K, V> {
+   |       ------- this trait cannot be made into an object...
+LL |     type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
+   |          ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
+   = help: consider moving `VRefCont` to another trait
+   = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `MapLike` for this new enum and using it instead:
+             std::collections::BTreeMap<K, V>
+             Source
+   = note: required for the cast from `Box<BTreeMap<u8, u8>>` to `Box<dyn MapLike<u8, u8, VRefCont<'_> = (dyn RefCont<'_, u8> + 'static)>>`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0038, E0107.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/generic-associated-types/trait-objects.rs b/tests/ui/generic-associated-types/trait-objects.rs
index 743a3df0acc..bad9289ee5e 100644
--- a/tests/ui/generic-associated-types/trait-objects.rs
+++ b/tests/ui/generic-associated-types/trait-objects.rs
@@ -1,8 +1,3 @@
-//@ revisions: base extended
-
-#![cfg_attr(extended, feature(generic_associated_types_extended))]
-#![cfg_attr(extended, allow(incomplete_features))]
-
 trait StreamingIterator {
     type Item<'a> where Self: 'a;
     fn size_hint(&self) -> (usize, Option<usize>);
@@ -11,11 +6,10 @@ trait StreamingIterator {
 }
 
 fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
-    //[base]~^ the trait `StreamingIterator` cannot be made into an object
+    //~^ the trait `StreamingIterator` cannot be made into an object
     x.size_hint().0
-    //[extended]~^ borrowed data escapes
-    //[base]~^^ the trait `StreamingIterator` cannot be made into an object
-    //[base]~| the trait `StreamingIterator` cannot be made into an object
+    //~^ the trait `StreamingIterator` cannot be made into an object
+    //~| the trait `StreamingIterator` cannot be made into an object
 }
 
 fn main() {}
diff --git a/tests/ui/generic-associated-types/trait-objects.stderr b/tests/ui/generic-associated-types/trait-objects.stderr
new file mode 100644
index 00000000000..3e74776f999
--- /dev/null
+++ b/tests/ui/generic-associated-types/trait-objects.stderr
@@ -0,0 +1,48 @@
+error[E0038]: the trait `StreamingIterator` cannot be made into an object
+  --> $DIR/trait-objects.rs:8:21
+   |
+LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
+   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/trait-objects.rs:2:10
+   |
+LL | trait StreamingIterator {
+   |       ----------------- this trait cannot be made into an object...
+LL |     type Item<'a> where Self: 'a;
+   |          ^^^^ ...because it contains the generic associated type `Item`
+   = help: consider moving `Item` to another trait
+
+error[E0038]: the trait `StreamingIterator` cannot be made into an object
+  --> $DIR/trait-objects.rs:10:7
+   |
+LL |     x.size_hint().0
+   |       ^^^^^^^^^ `StreamingIterator` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/trait-objects.rs:2:10
+   |
+LL | trait StreamingIterator {
+   |       ----------------- this trait cannot be made into an object...
+LL |     type Item<'a> where Self: 'a;
+   |          ^^^^ ...because it contains the generic associated type `Item`
+   = help: consider moving `Item` to another trait
+
+error[E0038]: the trait `StreamingIterator` cannot be made into an object
+  --> $DIR/trait-objects.rs:10:5
+   |
+LL |     x.size_hint().0
+   |     ^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
+   |
+note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/trait-objects.rs:2:10
+   |
+LL | trait StreamingIterator {
+   |       ----------------- this trait cannot be made into an object...
+LL |     type Item<'a> where Self: 'a;
+   |          ^^^^ ...because it contains the generic associated type `Item`
+   = help: consider moving `Item` to another trait
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0038`.