]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/issue-82438-mut-without-upvar.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / closures / issue-82438-mut-without-upvar.rs
CommitLineData
6a06907d
XL
1use std::error::Error;
2struct A {
3}
4
5impl 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
21fn 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}