about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-04-29 03:05:26 +0000
committerMichael Goulet <michael@errs.io>2025-04-29 03:07:24 +0000
commit38c05a68ee94a01ac9ef91ab0b7d0d3fc6a33bda (patch)
treee73f001933c7eabcfbd7b833afe77c6364ecb151
parentf918b89f61d9aac3df4e57b05892f4614ddfc678 (diff)
downloadrust-38c05a68ee94a01ac9ef91ab0b7d0d3fc6a33bda.tar.gz
rust-38c05a68ee94a01ac9ef91ab0b7d0d3fc6a33bda.zip
Adjust tests
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/mod.rs4
-rw-r--r--tests/crashes/123456.rs16
-rw-r--r--tests/ui/associated-types/issue-64855-2.rs5
-rw-r--r--tests/ui/associated-types/issue-64855-2.stderr15
-rw-r--r--tests/ui/associated-types/issue-64855.rs5
-rw-r--r--tests/ui/associated-types/issue-64855.stderr8
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-95230.rs9
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-95230.stderr18
8 files changed, 53 insertions, 27 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index de310f9d371..1a5a1c214bd 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 ed7cbada3f8..00000000000
--- 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 30cb37b5198..20b8ff17e9e 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 00000000000..22292a8721a
--- /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 81cf3ae6e83..5d325b981a2 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<T>(<Self as Foo>::Type) where Self: ;
 //~^ ERROR the trait bound `Bar<T>: Foo` is not satisfied
+//~| ERROR overflow evaluating the requirement `Bar<T> well-formed`
 
 fn main() {}
diff --git a/tests/ui/associated-types/issue-64855.stderr b/tests/ui/associated-types/issue-64855.stderr
index 1562a10b453..d8ba1a9d07e 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<T>: Foo` is not satisfied
-  --> $DIR/issue-64855.rs:5:19
+  --> $DIR/issue-64855.rs:9:19
    |
 LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
    |                   ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bar<T>`
    |
 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<T> well-formed`
-  --> $DIR/issue-64855.rs:5:46
+  --> $DIR/issue-64855.rs:9: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
+  --> $DIR/issue-64855.rs:9:46
    |
 LL | pub struct Bar<T>(<Self as Foo>::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 d1ca6834551..821a04ff065 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 00000000000..7070af75d29
--- /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`.