Skip to content

Commit 38c05a6

Browse files
Adjust tests
1 parent f918b89 commit 38c05a6

File tree

8 files changed

+53
-27
lines changed

8 files changed

+53
-27
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12431243
self.infcx.tcx.trait_is_coinductive(data.def_id())
12441244
}
12451245
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) => {
1246-
// TODO: GCE is going away
1246+
// FIXME(generic_const_exprs): GCE needs well-formedness predicates to be
1247+
// coinductive, but GCE is on the way out anyways, so this should eventually
1248+
// be replaced with `false`.
12471249
self.infcx.tcx.features().generic_const_exprs()
12481250
}
12491251
_ => false,

tests/crashes/123456.rs

-16
This file was deleted.
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
//@ check-pass
1+
// This was originally a test for a `ReEmpty` ICE, but became an unintentional test of
2+
// the coinductiveness of WF predicates. That behavior was removed, and thus this is
3+
// also inadvertently a test for the (non-)co-inductiveness of WF predicates.
24

35
pub struct Bar<'a>(&'a Self) where Self: ;
6+
//~^ ERROR overflow evaluating the requirement `Bar<'a> well-formed`
47

58
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0275]: overflow evaluating the requirement `Bar<'a> well-formed`
2+
--> $DIR/issue-64855-2.rs:5:36
3+
|
4+
LL | pub struct Bar<'a>(&'a Self) where Self: ;
5+
| ^^^^
6+
|
7+
note: required by a bound in `Bar`
8+
--> $DIR/issue-64855-2.rs:5:36
9+
|
10+
LL | pub struct Bar<'a>(&'a Self) where Self: ;
11+
| ^^^^ required by this bound in `Bar`
12+
13+
error: aborting due to 1 previous error
14+
15+
For more information about this error, try `rustc --explain E0275`.
+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
// This was originally a test for a `ReEmpty` ICE, but became an unintentional test of
2+
// the coinductiveness of WF predicates. That behavior was removed, and thus this is
3+
// also inadvertently a test for the (non-)co-inductiveness of WF predicates.
4+
15
pub trait Foo {
26
type Type;
37
}
48

59
pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
610
//~^ ERROR the trait bound `Bar<T>: Foo` is not satisfied
11+
//~| ERROR overflow evaluating the requirement `Bar<T> well-formed`
712

813
fn main() {}

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied
2-
--> $DIR/issue-64855.rs:5:19
2+
--> $DIR/issue-64855.rs:9:19
33
|
44
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
55
| ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bar<T>`
66
|
77
help: this trait has no implementations, consider adding one
8-
--> $DIR/issue-64855.rs:1:1
8+
--> $DIR/issue-64855.rs:5:1
99
|
1010
LL | pub trait Foo {
1111
| ^^^^^^^^^^^^^
1212

1313
error[E0275]: overflow evaluating the requirement `Bar<T> well-formed`
14-
--> $DIR/issue-64855.rs:5:46
14+
--> $DIR/issue-64855.rs:9:46
1515
|
1616
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
1717
| ^^^^
1818
|
1919
note: required by a bound in `Bar`
20-
--> $DIR/issue-64855.rs:5:46
20+
--> $DIR/issue-64855.rs:9:46
2121
|
2222
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
2323
| ^^^^ required by this bound in `Bar`
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
//@ revisions: old next
2-
//@[next] compile-flags: -Znext-solver
3-
//@[old] check-pass
4-
//@[next] known-bug: #109764
5-
1+
// This used to be a test for overflow handling + higher-ranked outlives
2+
// in the new solver, but this test isn't expected to pass since WF preds
3+
// are not coinductive anymore.
64

75
pub struct Bar
86
where
97
for<'a> &'a mut Self:;
8+
//~^ ERROR overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
109

1110
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0275]: overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
2+
--> $DIR/issue-95230.rs:7:13
3+
|
4+
LL | for<'a> &'a mut Self:;
5+
| ^^^^^^^^^^^^
6+
|
7+
note: required by a bound in `Bar`
8+
--> $DIR/issue-95230.rs:7:13
9+
|
10+
LL | pub struct Bar
11+
| --- required by a bound in this struct
12+
LL | where
13+
LL | for<'a> &'a mut Self:;
14+
| ^^^^^^^^^^^^ required by this bound in `Bar`
15+
16+
error: aborting due to 1 previous error
17+
18+
For more information about this error, try `rustc --explain E0275`.

0 commit comments

Comments
 (0)