]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/dont-print-desugared.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / nll / dont-print-desugared.rs
CommitLineData
dc9dc135
XL
1// Test that we don't show variables with from for loop desugaring
2
3fn for_loop(s: &[i32]) {
4 for &ref mut x in s {}
5 //~^ ERROR cannot borrow data in a `&` reference as mutable [E0596]
6}
7
8struct D<'a>(&'a ());
9
10impl Drop for D<'_> {
11 fn drop(&mut self) {}
12}
13
14fn for_loop_dropck(v: Vec<D<'static>>) {
15 for ref mut d in v {
16 let y = ();
17 *d = D(&y); //~ ERROR `y` does not live long enough
18 }
19}
20
21fn main() {}