Skip to content

Commit

Permalink
one must imagine ci happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Feb 8, 2024
1 parent 9af8dff commit 89e8cc9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 8 additions & 2 deletions tests/ui/impl-trait/recursive-coroutine-boxed.next.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ error[E0282]: type annotations needed
|
LL | let mut gen = Box::pin(foo());
| ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Box`
LL |
...
LL | let mut r = gen.as_mut().resume(());
| ------ type must be known at this point
|
Expand All @@ -12,6 +12,12 @@ help: consider specifying the generic argument
LL | let mut gen = Box::<T>::pin(foo());
| +++++

error: aborting due to 1 previous error
error[E0282]: type annotations needed
--> $DIR/recursive-coroutine-boxed.rs:10:32
|
LL | let mut gen = Box::pin(foo());
| ^^^^^ cannot infer type for opaque type `impl Coroutine<Yield = (), Return = ()>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0282`.
1 change: 1 addition & 0 deletions tests/ui/impl-trait/recursive-coroutine-boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fn foo() -> impl Coroutine<Yield = (), Return = ()> {
|| {
let mut gen = Box::pin(foo());
//[next]~^ ERROR type annotations needed
//[next]~| ERROR type annotations needed
let mut r = gen.as_mut().resume(());
while let CoroutineState::Yielded(v) = r {
yield v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ error[E0284]: type annotations needed: cannot satisfy `Foo == _`
LL | Blah { my_foo: make_foo(), my_u8: 12 }
| ^^^^^^^^^^ cannot satisfy `Foo == _`

error[E0282]: type annotations needed
--> $DIR/type-alias-impl-trait-tuple.rs:24:28
error[E0284]: type annotations needed: cannot satisfy `Foo == _`
--> $DIR/type-alias-impl-trait-tuple.rs:25:10
|
LL | fn into_inner(self) -> (Foo, u8, Foo) {
| ^^^^^^^^^^^^^^ cannot infer type for tuple `(Foo, u8, Foo)`
LL | (self.my_foo, self.my_u8, make_foo())
| ^^^^^^^^^^^ cannot satisfy `Foo == _`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0282, E0284.
For more information about an error, try `rustc --explain E0282`.
For more information about this error, try `rustc --explain E0284`.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ impl Blah {
//[next]~^ ERROR type annotations needed: cannot satisfy `Foo == _`
}
fn into_inner(self) -> (Foo, u8, Foo) {
//[next]~^ ERROR type annotations needed
(self.my_foo, self.my_u8, make_foo())
//[next]~^ ERROR type annotations needed: cannot satisfy `Foo == _`
}
}

Expand Down

0 comments on commit 89e8cc9

Please sign in to comment.