Skip to content

Commit fe874cd

Browse files
committed
add test for newly supported behavior
1 parent 7eb677e commit fe874cd

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0275]: overflow evaluating the requirement `Foo<T>: SendIndir`
2+
--> $DIR/only-one-coinductive-step-needed.rs:9:15
3+
|
4+
LL | struct Foo<T>(<Foo<T> as Trait>::Assoc);
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: required for `Foo<T>` to implement `Trait`
8+
--> $DIR/only-one-coinductive-step-needed.rs:18:20
9+
|
10+
LL | impl<T: SendIndir> Trait for T {
11+
| --------- ^^^^^ ^
12+
| |
13+
| unsatisfied trait bound introduced here
14+
15+
error: aborting due to 1 previous error
16+
17+
For more information about this error, try `rustc --explain E0275`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ revisions: current next
2+
//@ ignore-compare-mode-next-solver (explicit revisions)
3+
//@[next] compile-flags: -Znext-solver
4+
//@[next] check-pass
5+
6+
// #136824 changed cycles to be coinductive if they have at least
7+
// one productive step, causing this test to pass with the new solver.
8+
9+
struct Foo<T>(<Foo<T> as Trait>::Assoc);
10+
//[current]~^ ERROR overflow evaluating the requirement `Foo<T>: SendIndir`
11+
12+
trait SendIndir {}
13+
impl<T: Send> SendIndir for T {}
14+
15+
trait Trait {
16+
type Assoc;
17+
}
18+
impl<T: SendIndir> Trait for T {
19+
type Assoc = ();
20+
}
21+
22+
fn is_send<T: Send>() {}
23+
24+
fn main() {
25+
is_send::<Foo<u32>>();
26+
}

0 commit comments

Comments
 (0)