Remove usage of unstable box syntax, except in the script crate

… because there’s a lot of it,
and script still uses any other unstable features anyway.
This commit is contained in:
Simon Sapin 2017-10-11 23:12:43 +02:00
parent 796a8dc618
commit aa5761a5fb
40 changed files with 195 additions and 195 deletions

View file

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![allow(non_camel_case_types)]
#![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(link_args)]

View file

@ -11,7 +11,7 @@ use types::{cef_string_list_t,cef_string_t};
#[no_mangle]
pub extern "C" fn cef_string_list_alloc() -> *mut cef_string_list_t {
Box::into_raw(box vec!())
Box::into_raw(Box::new(vec!()))
}
#[no_mangle]
@ -63,6 +63,6 @@ pub extern "C" fn cef_string_list_copy(lt: *mut cef_string_list_t) -> *mut cef_s
unsafe {
if lt.is_null() { return 0 as *mut cef_string_list_t; }
let copy = (*lt).clone();
Box::into_raw(box copy)
Box::into_raw(Box::new(copy))
}
}

View file

@ -13,7 +13,7 @@ use types::{cef_string_map_t, cef_string_t};
#[no_mangle]
pub extern "C" fn cef_string_map_alloc() -> *mut cef_string_map_t {
Box::into_raw(box BTreeMap::new())
Box::into_raw(Box::new(BTreeMap::new()))
}
#[no_mangle]

View file

@ -13,7 +13,7 @@ use types::{cef_string_multimap_t,cef_string_t};
#[no_mangle]
pub extern "C" fn cef_string_multimap_alloc() -> *mut cef_string_multimap_t {
Box::into_raw(box BTreeMap::new())
Box::into_raw(Box::new(BTreeMap::new()))
}
#[no_mangle]

View file

@ -302,10 +302,10 @@ impl WindowMethods for Window {
app_wakeup();
}
fn clone(&self) -> Box<EventLoopWaker + Send> {
box CefEventLoopWaker
Box::new(CefEventLoopWaker)
}
}
box CefEventLoopWaker
Box::new(CefEventLoopWaker)
}
fn prepare_for_composite(&self, width: usize, height: usize) -> bool {

View file

@ -205,11 +205,11 @@ impl<'a> CefWrap<*const cef_string_t> for &'a [u16] {
// FIXME(pcwalton): This leaks!! We should instead have the caller pass some scratch
// stack space to create the object in. What a botch.
Box::into_raw(box cef_string_utf16 {
Box::into_raw(Box::new(cef_string_utf16 {
str: ptr,
length: buffer.len(),
dtor: Some(free_boxed_utf16_string as extern "C" fn(*mut c_ushort)),
}) as *const _
})) as *const _
}
}
unsafe fn to_rust(cef_string: *const cef_string_t) -> &'a [u16] {

View file

@ -4,7 +4,6 @@
//! A simple application that uses glutin to open a window for Servo to display in.
#![feature(box_syntax)]
#[macro_use] extern crate bitflags;
extern crate compositing;

View file

@ -1088,15 +1088,15 @@ impl WindowMethods for Window {
}
}
fn clone(&self) -> Box<EventLoopWaker + Send> {
box GlutinEventLoopWaker {
Box::new(GlutinEventLoopWaker {
window_proxy: self.window_proxy.clone(),
}
})
}
}
let window_proxy = create_window_proxy(self);
box GlutinEventLoopWaker {
Box::new(GlutinEventLoopWaker {
window_proxy: window_proxy,
}
})
}
#[cfg(not(target_os = "windows"))]