Skip to content

Commit

Permalink
fixed compile-fail test
Browse files Browse the repository at this point in the history
  • Loading branch information
llogiq committed Aug 24, 2016
1 parent e0eb1ba commit 1fd85b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/compile-fail/rfc1623.rs
Expand Up @@ -14,7 +14,7 @@ fn non_elidable<'a, 'b>(a: &'a u8, b: &'b u8) -> &'a u8 { a }

// the boundaries of elision
static NON_ELIDABLE_FN : &fn(&u8, &u8) -> &u8 =
//^ERROR: missing lifetime specifier
//~^ ERROR: missing lifetime specifier
&(non_elidable as fn(&u8, &u8) -> &u8);

type Baz<'a> = fn(&'a [u8]) -> Option<u8>;
Expand All @@ -25,7 +25,8 @@ static STATIC_BAZ : &Baz<'static> = &(baz as Baz);
const CONST_BAZ : &Baz<'static> = &(baz as Baz);

fn main() {
let y = [1u8, 2, 3];
let x = &[1u8, 2, 3];
let y = x;

//surprisingly this appears to work, so lifetime < `'static` is valid
assert_eq!(Some(1), STATIC_BAZ(y));
Expand Down

0 comments on commit 1fd85b1

Please sign in to comment.