diff options
| author | Andre Bogus <bogusandre@gmail.com> | 2016-08-24 21:19:39 +0200 |
|---|---|---|
| committer | Andre Bogus <bogusandre@gmail.com> | 2016-08-24 21:19:39 +0200 |
| commit | 1fd85b1a80429a5d217424b2e7f51d0082713b9d (patch) | |
| tree | 05578873c87e9c2c2d1159aeeda90511a5d36d1f | |
| parent | e0eb1ba0db9c832a0385f31710edddd675feee14 (diff) | |
| download | rust-1fd85b1a80429a5d217424b2e7f51d0082713b9d.tar.gz rust-1fd85b1a80429a5d217424b2e7f51d0082713b9d.zip | |
fixed compile-fail test
| -rw-r--r-- | src/test/compile-fail/rfc1623.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/compile-fail/rfc1623.rs b/src/test/compile-fail/rfc1623.rs index 840307ea456..963459b27bf 100644 --- a/src/test/compile-fail/rfc1623.rs +++ b/src/test/compile-fail/rfc1623.rs @@ -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>; @@ -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)); |
