2014-05-21 23:44:49 -05:00
|
|
|
fn f() {
|
2018-05-25 05:36:58 -05:00
|
|
|
let mut x = vec![1].iter();
|
2019-04-22 02:40:08 -05:00
|
|
|
//~^ ERROR temporary value dropped while borrowed
|
2018-05-25 05:36:58 -05:00
|
|
|
x.use_mut();
|
2014-05-21 23:44:49 -05:00
|
|
|
}
|
|
|
|
|
2018-05-25 05:36:58 -05:00
|
|
|
fn main() {
|
2014-05-21 23:44:49 -05:00
|
|
|
f();
|
|
|
|
}
|
2018-05-25 05:36:58 -05:00
|
|
|
|
|
|
|
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
|
|
|
|
impl<T> Fake for T { }
|