]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/match/match-ref-mut-let-invariance.rs
1 // Check that when making a ref mut binding with type `&mut T`, the
2 // type `T` must match precisely the type `U` of the value being
3 // matched, and in particular cannot be some supertype of `U`. Issue
4 // #23116. This test focuses on a `let`.
9 fn bar
<'a
>(&'a
mut self) -> &'a
mut &'a
i32 {
10 let ref mut x
= self.0;
12 //~^ ERROR lifetime may not live long enough