]> git.proxmox.com Git - rustc.git/blob - tests/ui/closures/issue-82438-mut-without-upvar.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / closures / issue-82438-mut-without-upvar.rs
1 use std::error::Error;
2 struct A {
3 }
4
5 impl A {
6 pub fn new() -> A {
7 A {
8 }
9 }
10
11 pub fn f<'a>(
12 &'a self,
13 team_name: &'a str,
14 c: &'a mut dyn FnMut(String, String, u64, u64)
15 ) -> Result<(), Box<dyn Error>> {
16 Ok(())
17 }
18 }
19
20
21 fn main() {
22 let A = A::new();
23 let participant_name = "A";
24
25 let c = |a, b, c, d| {};
26
27 A.f(participant_name, &mut c); //~ ERROR cannot borrow
28 }