summary refs log tree commit diff
path: root/src/test/ui/issues/issue-61623.rs
blob: e5b8747bd80476d9bb395c6ea2e52c676fc3908f (plain)
1
2
3
4
5
6
7
8
9
10
11
fn f1<'a>(_: &'a mut ()) {}

fn f2<P>(_: P, _: ()) {}

fn f3<'a>(x: &'a ((), &'a mut ())) {
    f2(|| x.0, f1(x.1))
//~^ ERROR cannot borrow `*x.1` as mutable, as it is behind a `&` reference
//~| ERROR cannot borrow `*x.1` as mutable because it is also borrowed as immutable
}

fn main() {}