summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/borrowck-let-suggestion.rs
blob: 3d591a506d59eecdd73b484374324ed946952554 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
fn f() {
    let mut x = vec![1].iter();
    //~^ ERROR temporary value dropped while borrowed
    x.use_mut();
}

fn main() {
    f();
}

trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
impl<T> Fake for T { }