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

@ -586,10 +586,10 @@ pub struct ClipScrollNode {
impl ClipScrollNode {
pub fn to_define_item(&self, pipeline_id: PipelineId) -> DisplayItem {
DisplayItem::DefineClipScrollNode(box DefineClipScrollNodeItem {
DisplayItem::DefineClipScrollNode(Box::new(DefineClipScrollNodeItem {
base: BaseDisplayItem::empty(pipeline_id),
node: self.clone(),
})
}))
}
}

View file

@ -4,7 +4,6 @@
// For SIMD
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(allocator_api))]
#![feature(box_syntax)]
#![feature(cfg_target_feature)]
#![deny(unsafe_code)]

View file

@ -118,15 +118,15 @@ impl HeapSizeOf for FontContextHandle {
impl FontContextHandle {
pub fn new() -> FontContextHandle {
let user = Box::into_raw(box User {
let user = Box::into_raw(Box::new(User {
size: 0,
});
let mem = Box::into_raw(box FT_MemoryRec_ {
}));
let mem = Box::into_raw(Box::new(FT_MemoryRec_ {
user: user as *mut c_void,
alloc: Some(ft_alloc),
free: Some(ft_free),
realloc: Some(ft_realloc),
});
}));
unsafe {
let mut ctx: FT_Library = ptr::null_mut();

View file

@ -509,7 +509,7 @@ extern fn font_table_func(_: *mut hb_face_t,
// `Box::into_raw` intentionally leaks the FontTable so we don't destroy the buffer
// while HarfBuzz is using it. When HarfBuzz is done with the buffer, it will pass
// this raw pointer back to `destroy_blob_func` which will deallocate the Box.
let font_table_ptr = Box::into_raw(box font_table);
let font_table_ptr = Box::into_raw(Box::new(font_table));
let buf = (*font_table_ptr).buffer();
// HarfBuzz calls `destroy_blob_func` when the buffer is no longer needed.