]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-69446-fnmut-capture.rs
Auto merge of #103217 - mejrs:track, r=eholk
[rust.git] / src / test / ui / async-await / issue-69446-fnmut-capture.rs
1 // Regression test for issue #69446 - we should display
2 // which variable is captured
3 // edition:2018
4
5 use core::future::Future;
6
7 struct Foo;
8 impl Foo {
9     fn foo(&mut self) {}
10 }
11
12 async fn bar<T>(_: impl FnMut() -> T)
13 where
14     T: Future<Output = ()>,
15 {}
16
17 fn main() {
18     let mut x = Foo;
19     bar(move || async { //~ ERROR captured
20         x.foo();
21     });
22 }