about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-04-28 16:36:25 +0000
committerMichael Goulet <michael@errs.io>2025-04-29 02:43:06 +0000
commitf918b89f61d9aac3df4e57b05892f4614ddfc678 (patch)
tree5bb2bd86e032a032529379e25d0d0a65dbbd156a
parent25cdf1f67463c9365d8d83778c933ec7480e940b (diff)
downloadrust-f918b89f61d9aac3df4e57b05892f4614ddfc678.tar.gz
rust-f918b89f61d9aac3df4e57b05892f4614ddfc678.zip
Wf is not coinductive
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/mod.rs5
-rw-r--r--tests/ui/associated-types/issue-64855.stderr17
2 files changed, 19 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index df02a67c2c9..de310f9d371 100644
--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs
@@ -1242,7 +1242,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
             ty::PredicateKind::Clause(ty::ClauseKind::Trait(data)) => {
                 self.infcx.tcx.trait_is_coinductive(data.def_id())
             }
-            ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) => true,
+            ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) => {
+                // TODO: GCE is going away
+                self.infcx.tcx.features().generic_const_exprs()
+            }
             _ => false,
         })
     }
diff --git a/tests/ui/associated-types/issue-64855.stderr b/tests/ui/associated-types/issue-64855.stderr
index 7c09abdb3b6..1562a10b453 100644
--- a/tests/ui/associated-types/issue-64855.stderr
+++ b/tests/ui/associated-types/issue-64855.stderr
@@ -10,6 +10,19 @@ help: this trait has no implementations, consider adding one
 LL | pub trait Foo {
    | ^^^^^^^^^^^^^
 
-error: aborting due to 1 previous error
+error[E0275]: overflow evaluating the requirement `Bar<T> well-formed`
+  --> $DIR/issue-64855.rs:5:46
+   |
+LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
+   |                                              ^^^^
+   |
+note: required by a bound in `Bar`
+  --> $DIR/issue-64855.rs:5:46
+   |
+LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
+   |                                              ^^^^ required by this bound in `Bar`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0275, E0277.
+For more information about an error, try `rustc --explain E0275`.