rust/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
569 B
Rust
Raw Permalink Normal View History

//@ 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`
2024-03-11 11:57:18 -05:00
//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
where
2023-12-07 05:56:48 -06:00
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() {}