forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed diagnostics for coroutines with () as input.
- Loading branch information
Showing
3 changed files
with
61 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] | ||
|
||
use std::ops::Coroutine; | ||
|
||
fn foo() -> impl Coroutine<u8> { | ||
//~^ ERROR type mismatch in coroutine arguments | ||
#[coroutine] | ||
|_: ()| {} | ||
} | ||
|
||
fn main() { } |
15 changes: 15 additions & 0 deletions
15
tests/ui/coroutine/arg-count-mismatch-on-unit-input.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0631]: type mismatch in coroutine arguments | ||
--> $DIR/arg-count-mismatch-on-unit-input.rs:5:13 | ||
| | ||
LL | fn foo() -> impl Coroutine<u8> { | ||
| ^^^^^^^^^^^^^^^^^^ expected due to this | ||
... | ||
LL | |_: ()| {} | ||
| ------- found signature defined here | ||
| | ||
= note: expected coroutine signature `fn(u8) -> _` | ||
found coroutine signature `fn(()) -> _` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0631`. |