mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
add test for newly supported behavior
This commit is contained in:
parent
7eb677e7eb
commit
fe874cd99b
@ -0,0 +1,17 @@
|
||||
error[E0275]: overflow evaluating the requirement `Foo<T>: SendIndir`
|
||||
--> $DIR/only-one-coinductive-step-needed.rs:9:15
|
||||
|
|
||||
LL | struct Foo<T>(<Foo<T> as Trait>::Assoc);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: required for `Foo<T>` to implement `Trait`
|
||||
--> $DIR/only-one-coinductive-step-needed.rs:18:20
|
||||
|
|
||||
LL | impl<T: SendIndir> Trait for T {
|
||||
| --------- ^^^^^ ^
|
||||
| |
|
||||
| unsatisfied trait bound introduced here
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0275`.
|
@ -0,0 +1,26 @@
|
||||
//@ revisions: current next
|
||||
//@ ignore-compare-mode-next-solver (explicit revisions)
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
//@[next] check-pass
|
||||
|
||||
// #136824 changed cycles to be coinductive if they have at least
|
||||
// one productive step, causing this test to pass with the new solver.
|
||||
|
||||
struct Foo<T>(<Foo<T> as Trait>::Assoc);
|
||||
//[current]~^ ERROR overflow evaluating the requirement `Foo<T>: SendIndir`
|
||||
|
||||
trait SendIndir {}
|
||||
impl<T: Send> SendIndir for T {}
|
||||
|
||||
trait Trait {
|
||||
type Assoc;
|
||||
}
|
||||
impl<T: SendIndir> Trait for T {
|
||||
type Assoc = ();
|
||||
}
|
||||
|
||||
fn is_send<T: Send>() {}
|
||||
|
||||
fn main() {
|
||||
is_send::<Foo<u32>>();
|
||||
}
|
Loading…
Reference in New Issue
Block a user