about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndre Bogus <bogusandre@gmail.com>2016-08-23 12:34:28 +0200
committerAndre Bogus <bogusandre@gmail.com>2016-08-23 12:34:28 +0200
commit8bdb3e10ca637033667dec25ebfff64a069c46eb (patch)
tree176a3705d200f6080f96560f3904e5c014ea1006
parentcfce351ad39ae0f5e35006ad11fabb4ec866d725 (diff)
downloadrust-8bdb3e10ca637033667dec25ebfff64a069c46eb.tar.gz
rust-8bdb3e10ca637033667dec25ebfff64a069c46eb.zip
fix run-pass test
-rw-r--r--src/test/run-pass/rfc1623.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/test/run-pass/rfc1623.rs b/src/test/run-pass/rfc1623.rs
index b702a03b481..81e32efe6c7 100644
--- a/src/test/run-pass/rfc1623.rs
+++ b/src/test/run-pass/rfc1623.rs
@@ -22,18 +22,24 @@ const SOME_EXPLICIT_CONST_STR : &'static str = "&'static str";
 fn id_u8_slice(arg: &[u8]) -> &[u8] { arg }
 
 // one with a function, argument elided
-static SOME_STATIC_SIMPLE_FN : &fn(&[u8]) -> &[u8] = id_u8_slice;
-const SOME_CONST_SIMPLE_FN : &fn(&[u8]) -> &[u8] = id_u8_slice;
+static SOME_STATIC_SIMPLE_FN : &fn(&[u8]) -> &[u8] =
+        &(id_u8_slice as fn(&[u8]) -> &[u8]);
+const SOME_CONST_SIMPLE_FN : &fn(&[u8]) -> &[u8] =
+        &(id_u8_slice as fn(&[u8]) -> &[u8]);
 
 // this should be the same as without elision
-static SOME_STATIC_NON_ELIDED_fN : &fn<'a>(&'a [u8]) -> &'a [u8] = id_u8_slice;
-const SOME_CONST_NON_ELIDED_fN : &fn<'a>(&'a [u8]) -> &'a [u8] = id_u8_slice;
+static SOME_STATIC_NON_ELIDED_fN : &for<'a> fn(&'a [u8]) -> &'a [u8] =
+        &(id_u8_slice as for<'a> fn(&'a [u8]) -> &'a [u8]);
+const SOME_CONST_NON_ELIDED_fN : &for<'a> fn(&'a [u8]) -> &'a [u8] =
+        &(id_u8_slice as for<'a> fn(&'a [u8]) -> &'a [u8]);
 
 // another function that elides, each to a different unbound lifetime
 fn multi_args(a: &u8, b: &u8, c: &u8) { }
 
-static SOME_STATIC_MULTI_FN : &fn(&u8, &u8, &u8) = multi_args;
-const SOME_CONST_MULTI_FN : &fn(&u8, &u8, &u8) = multi_args;
+static SOME_STATIC_MULTI_FN : &fn(&u8, &u8, &u8) =
+        &(multi_args as fn(&u8, &u8, &u8));
+const SOME_CONST_MULTI_FN : &fn(&u8, &u8, &u8) =
+        &(multi_args as fn(&u8, &u8, &u8));
 
 
 fn main() {
@@ -41,7 +47,7 @@ fn main() {
     let x = &[1u8, 2, 3];
     SOME_STATIC_SIMPLE_FN(x);
     SOME_CONST_SIMPLE_FN(x);
-    
+
     // make sure this works with different lifetimes
     let a = &1;
     {