]> git.lizzy.rs Git - rust.git/blob - src/test/ui/in-band-lifetimes/mut_while_borrow.rs
Do not suggest using a const parameter when there are bounds on an unused type parameter
[rust.git] / src / test / ui / in-band-lifetimes / mut_while_borrow.rs
1 #![allow(warnings)]
2 #![feature(in_band_lifetimes)]
3
4 fn foo(x: &'a u32) -> &'a u32 { x }
5
6 fn main() {
7     let mut p = 3;
8     let r = foo(&p);
9     p += 1; //~ ERROR cannot assign to `p` because it is borrowed
10     println!("{}", r);
11 }