2014-12-14 19:23:00 -06:00
|
|
|
// Test range syntax - borrow errors.
|
2018-04-10 17:20:05 -05:00
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
pub fn main() { #![rustc_error] // rust-lang/rust#49855
|
2014-12-14 19:23:00 -06:00
|
|
|
let r = {
|
2016-01-13 00:29:39 -06:00
|
|
|
let a = 42;
|
|
|
|
let b = 42;
|
|
|
|
&a..&b
|
2014-12-14 19:23:00 -06:00
|
|
|
};
|
2017-12-13 19:27:23 -06:00
|
|
|
//~^^ ERROR `a` does not live long enough
|
|
|
|
//~| ERROR `b` does not live long enough
|
2018-05-25 05:36:58 -05:00
|
|
|
r.use_ref();
|
2014-12-14 19:23:00 -06:00
|
|
|
}
|
2018-05-25 05:36:58 -05:00
|
|
|
|
|
|
|
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
|
|
|
|
impl<T> Fake for T { }
|