about summary refs log tree commit diff
path: root/src/test/run-pass/variadic-ffi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/run-pass/variadic-ffi.rs')
-rw-r--r--src/test/run-pass/variadic-ffi.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/run-pass/variadic-ffi.rs b/src/test/run-pass/variadic-ffi.rs
index b3fff6977a5..60d617822cd 100644
--- a/src/test/run-pass/variadic-ffi.rs
+++ b/src/test/run-pass/variadic-ffi.rs
@@ -28,11 +28,11 @@ pub fn main() {
 
     unsafe {
         // Call with just the named parameter
-        let c = CString::new(b"Hello World\n").unwrap();
+        let c = CString::new(&b"Hello World\n"[..]).unwrap();
         check("Hello World\n", |s| sprintf(s, c.as_ptr()));
 
         // Call with variable number of arguments
-        let c = CString::new(b"%d %f %c %s\n").unwrap();
+        let c = CString::new(&b"%d %f %c %s\n"[..]).unwrap();
         check("42 42.500000 a %d %f %c %s\n\n", |s| {
             sprintf(s, c.as_ptr(), 42, 42.5f64, 'a' as c_int, c.as_ptr());
         });
@@ -43,11 +43,11 @@ pub fn main() {
         // A function that takes a function pointer
         unsafe fn call(p: unsafe extern fn(*mut c_char, *const c_char, ...) -> c_int) {
             // Call with just the named parameter
-            let c = CString::new(b"Hello World\n").unwrap();
+            let c = CString::new(&b"Hello World\n"[..]).unwrap();
             check("Hello World\n", |s| sprintf(s, c.as_ptr()));
 
             // Call with variable number of arguments
-            let c = CString::new(b"%d %f %c %s\n").unwrap();
+            let c = CString::new(&b"%d %f %c %s\n"[..]).unwrap();
             check("42 42.500000 a %d %f %c %s\n\n", |s| {
                 sprintf(s, c.as_ptr(), 42, 42.5f64, 'a' as c_int, c.as_ptr());
             });