diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index de310f9d3716..1a5a1c214bd3 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1243,7 +1243,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { self.infcx.tcx.trait_is_coinductive(data.def_id()) } ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) => { - // TODO: GCE is going away + // FIXME(generic_const_exprs): GCE needs well-formedness predicates to be + // coinductive, but GCE is on the way out anyways, so this should eventually + // be replaced with `false`. self.infcx.tcx.features().generic_const_exprs() } _ => false, diff --git a/tests/crashes/123456.rs b/tests/crashes/123456.rs deleted file mode 100644 index ed7cbada3f85..000000000000 --- a/tests/crashes/123456.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ known-bug: #123456 - -trait Project { - const SELF: Self; -} - -fn take1( - _: Project< - SELF = { - j2.join().unwrap(); - }, - >, -) { -} - -pub fn main() {} diff --git a/tests/ui/associated-types/issue-64855-2.rs b/tests/ui/associated-types/issue-64855-2.rs index 30cb37b5198e..20b8ff17e9e5 100644 --- a/tests/ui/associated-types/issue-64855-2.rs +++ b/tests/ui/associated-types/issue-64855-2.rs @@ -1,5 +1,8 @@ -//@ check-pass +// This was originally a test for a `ReEmpty` ICE, but became an unintentional test of +// the coinductiveness of WF predicates. That behavior was removed, and thus this is +// also inadvertently a test for the (non-)co-inductiveness of WF predicates. pub struct Bar<'a>(&'a Self) where Self: ; +//~^ ERROR overflow evaluating the requirement `Bar<'a> well-formed` fn main() {} diff --git a/tests/ui/associated-types/issue-64855-2.stderr b/tests/ui/associated-types/issue-64855-2.stderr new file mode 100644 index 000000000000..22292a8721a1 --- /dev/null +++ b/tests/ui/associated-types/issue-64855-2.stderr @@ -0,0 +1,15 @@ +error[E0275]: overflow evaluating the requirement `Bar<'a> well-formed` + --> $DIR/issue-64855-2.rs:5:36 + | +LL | pub struct Bar<'a>(&'a Self) where Self: ; + | ^^^^ + | +note: required by a bound in `Bar` + --> $DIR/issue-64855-2.rs:5:36 + | +LL | pub struct Bar<'a>(&'a Self) where Self: ; + | ^^^^ required by this bound in `Bar` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/associated-types/issue-64855.rs b/tests/ui/associated-types/issue-64855.rs index 81cf3ae6e83b..5d325b981a2c 100644 --- a/tests/ui/associated-types/issue-64855.rs +++ b/tests/ui/associated-types/issue-64855.rs @@ -1,8 +1,13 @@ +// This was originally a test for a `ReEmpty` ICE, but became an unintentional test of +// the coinductiveness of WF predicates. That behavior was removed, and thus this is +// also inadvertently a test for the (non-)co-inductiveness of WF predicates. + pub trait Foo { type Type; } pub struct Bar(::Type) where Self: ; //~^ ERROR the trait bound `Bar: Foo` is not satisfied +//~| ERROR overflow evaluating the requirement `Bar well-formed` fn main() {} diff --git a/tests/ui/associated-types/issue-64855.stderr b/tests/ui/associated-types/issue-64855.stderr index 1562a10b4534..d8ba1a9d07ee 100644 --- a/tests/ui/associated-types/issue-64855.stderr +++ b/tests/ui/associated-types/issue-64855.stderr @@ -1,23 +1,23 @@ error[E0277]: the trait bound `Bar: Foo` is not satisfied - --> $DIR/issue-64855.rs:5:19 + --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar(::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bar` | help: this trait has no implementations, consider adding one - --> $DIR/issue-64855.rs:1:1 + --> $DIR/issue-64855.rs:5:1 | LL | pub trait Foo { | ^^^^^^^^^^^^^ error[E0275]: overflow evaluating the requirement `Bar well-formed` - --> $DIR/issue-64855.rs:5:46 + --> $DIR/issue-64855.rs:9:46 | LL | pub struct Bar(::Type) where Self: ; | ^^^^ | note: required by a bound in `Bar` - --> $DIR/issue-64855.rs:5:46 + --> $DIR/issue-64855.rs:9:46 | LL | pub struct Bar(::Type) where Self: ; | ^^^^ required by this bound in `Bar` diff --git a/tests/ui/higher-ranked/trait-bounds/issue-95230.rs b/tests/ui/higher-ranked/trait-bounds/issue-95230.rs index d1ca6834551e..821a04ff0655 100644 --- a/tests/ui/higher-ranked/trait-bounds/issue-95230.rs +++ b/tests/ui/higher-ranked/trait-bounds/issue-95230.rs @@ -1,11 +1,10 @@ -//@ revisions: old next -//@[next] compile-flags: -Znext-solver -//@[old] check-pass -//@[next] known-bug: #109764 - +// This used to be a test for overflow handling + higher-ranked outlives +// in the new solver, but this test isn't expected to pass since WF preds +// are not coinductive anymore. pub struct Bar where for<'a> &'a mut Self:; +//~^ ERROR overflow evaluating the requirement `for<'a> &'a mut Bar well-formed` fn main() {} diff --git a/tests/ui/higher-ranked/trait-bounds/issue-95230.stderr b/tests/ui/higher-ranked/trait-bounds/issue-95230.stderr new file mode 100644 index 000000000000..7070af75d290 --- /dev/null +++ b/tests/ui/higher-ranked/trait-bounds/issue-95230.stderr @@ -0,0 +1,18 @@ +error[E0275]: overflow evaluating the requirement `for<'a> &'a mut Bar well-formed` + --> $DIR/issue-95230.rs:7:13 + | +LL | for<'a> &'a mut Self:; + | ^^^^^^^^^^^^ + | +note: required by a bound in `Bar` + --> $DIR/issue-95230.rs:7:13 + | +LL | pub struct Bar + | --- required by a bound in this struct +LL | where +LL | for<'a> &'a mut Self:; + | ^^^^^^^^^^^^ required by this bound in `Bar` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0275`.