diff --git a/src/test/compile-fail/range-1.rs b/src/test/compile-fail/range-1.rs index b839902c6832..e4ab5829f416 100644 --- a/src/test/compile-fail/range-1.rs +++ b/src/test/compile-fail/range-1.rs @@ -13,7 +13,7 @@ pub fn main() { // Mixed types. let _ = 0u32..10i32; - //~^ ERROR start and end of range have incompatible types + //~^ ERROR mismatched types // Bool => does not implement iterator. for i in false..true {} diff --git a/src/test/compile-fail/range-2.rs b/src/test/compile-fail/range-2.rs index c9053328572b..94967693ecf9 100644 --- a/src/test/compile-fail/range-2.rs +++ b/src/test/compile-fail/range-2.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -12,8 +12,10 @@ pub fn main() { let r = { - &42..&42 - //~^ ERROR borrowed value does not live long enough - //~^^ ERROR borrowed value does not live long enough + let a = 42; + let b = 42; + &a..&b + //~^ ERROR `a` does not live long enough + //~^^ ERROR `b` does not live long enough }; } diff --git a/src/test/run-pass/range.rs b/src/test/run-pass/range.rs index 24261772add0..4c249bbe1f73 100644 --- a/src/test/run-pass/range.rs +++ b/src/test/run-pass/range.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -44,6 +44,7 @@ pub fn main() { let _ = 0_usize..4+4-3; let _ = 0..foo(); + let _ = { &42..&100 }; // references to literals are OK let _ = ..42_usize; // Test we can use two different types with a common supertype.