forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quietly fail if an error has already occurred
- Loading branch information
Showing
3 changed files
with
73 additions
and
2 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,19 @@ | ||
// edition:2018 | ||
|
||
#![feature(unboxed_closures)] | ||
use std::future::Future; | ||
|
||
async fn wrapper<F>(f: F) | ||
//~^ ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
//~| ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
//~| ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
where | ||
F:, | ||
for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, | ||
{ | ||
//~^ ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
let mut i = 41; | ||
&mut i; | ||
} | ||
|
||
fn main() {} |
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,51 @@ | ||
error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
--> $DIR/issue-76168-hr-outlives-3.rs:6:1 | ||
| | ||
LL | / async fn wrapper<F>(f: F) | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | where | ||
LL | | F:, | ||
LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, | ||
| |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
| | ||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` | ||
|
||
error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
--> $DIR/issue-76168-hr-outlives-3.rs:6:10 | ||
| | ||
LL | async fn wrapper<F>(f: F) | ||
| ^^^^^^^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
| | ||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` | ||
|
||
error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
--> $DIR/issue-76168-hr-outlives-3.rs:13:1 | ||
| | ||
LL | / { | ||
LL | | | ||
LL | | let mut i = 41; | ||
LL | | &mut i; | ||
LL | | } | ||
| |_^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
| | ||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` | ||
|
||
error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
--> $DIR/issue-76168-hr-outlives-3.rs:6:1 | ||
| | ||
LL | / async fn wrapper<F>(f: F) | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | where | ||
LL | | F:, | ||
LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, | ||
| |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` | ||
| | ||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |