Skip to content

Commit 8b2295f

Browse files
Wf is not coinductive
1 parent a932eb3 commit 8b2295f

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

compiler/rustc_trait_selection/src/traits/select/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12421242
ty::PredicateKind::Clause(ty::ClauseKind::Trait(data)) => {
12431243
self.infcx.tcx.trait_is_coinductive(data.def_id())
12441244
}
1245-
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) => true,
1245+
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) => {
1246+
// TODO: GCE is going away
1247+
self.infcx.tcx.features().generic_const_exprs()
1248+
}
12461249
_ => false,
12471250
})
12481251
}

tests/ui/associated-types/issue-64855.stderr

+15-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ help: this trait has no implementations, consider adding one
1010
LL | pub trait Foo {
1111
| ^^^^^^^^^^^^^
1212

13-
error: aborting due to 1 previous error
13+
error[E0275]: overflow evaluating the requirement `Bar<T> well-formed`
14+
--> $DIR/issue-64855.rs:5:46
15+
|
16+
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
17+
| ^^^^
18+
|
19+
note: required by a bound in `Bar`
20+
--> $DIR/issue-64855.rs:5:46
21+
|
22+
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
23+
| ^^^^ required by this bound in `Bar`
24+
25+
error: aborting due to 2 previous errors
1426

15-
For more information about this error, try `rustc --explain E0277`.
27+
Some errors have detailed explanations: E0275, E0277.
28+
For more information about an error, try `rustc --explain E0275`.

0 commit comments

Comments
 (0)