]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/range-2.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / span / range-2.rs
1 // Test range syntax - borrow errors.
2 #![feature(rustc_attrs)]
3 pub fn main() { #![rustc_error] // rust-lang/rust#49855
4     let r = {
5         let a = 42;
6         let b = 42;
7         &a..&b
8     };
9     //~^^ ERROR `a` does not live long enough
10     //~| ERROR `b` does not live long enough
11     r.use_ref();
12 }
13
14 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
15 impl<T> Fake for T { }