Use Box::into_raw rather than boxed::into_raw.

The latter is deprecated.
This commit is contained in:
Ms2ger 2015-06-25 23:03:54 +02:00
parent ea06bebca9
commit 28086f3c75
4 changed files with 8 additions and 12 deletions

View file

@ -109,20 +109,18 @@ pub struct FontContextHandle {
impl FontContextHandle { impl FontContextHandle {
pub fn new() -> FontContextHandle { pub fn new() -> FontContextHandle {
let user = box User { let user = Box::into_raw(box User {
size: 0, size: 0,
}; });
let user: *mut User = ::std::boxed::into_raw(user); let mem = Box::into_raw(box struct_FT_MemoryRec_ {
let mem = box struct_FT_MemoryRec_ {
user: user as *mut c_void, user: user as *mut c_void,
alloc: ft_alloc, alloc: ft_alloc,
free: ft_free, free: ft_free,
realloc: ft_realloc, realloc: ft_realloc,
}; });
unsafe { unsafe {
let mut ctx: FT_Library = ptr::null_mut(); let mut ctx: FT_Library = ptr::null_mut();
let mem = ::std::boxed::into_raw(mem);
let result = FT_New_Library(mem, &mut ctx); let result = FT_New_Library(mem, &mut ctx);
if !result.succeeded() { panic!("Unable to initialize FreeType library"); } if !result.succeeded() { panic!("Unable to initialize FreeType library"); }

View file

@ -23,7 +23,7 @@ use hyper::header::{ContentType, Header, SetCookie, UserAgent};
use hyper::mime::{Mime, TopLevel, SubLevel}; use hyper::mime::{Mime, TopLevel, SubLevel};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::boxed::{self, FnBox}; use std::boxed::FnBox;
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;
use std::fs::File; use std::fs::File;
@ -52,8 +52,8 @@ pub fn global_init() {
Err(_) => return, Err(_) => return,
}; };
let host_table = Box::into_raw(parse_hostsfile(&lines));
unsafe { unsafe {
let host_table = boxed::into_raw(parse_hostsfile(&lines));
HOST_TABLE = Some(host_table); HOST_TABLE = Some(host_table);
} }
} }

View file

@ -2059,7 +2059,7 @@ class CGAbstractMethod(CGThing):
assert(False) # Override me! assert(False) # Override me!
def CreateBindingJSObject(descriptor, parent=None): def CreateBindingJSObject(descriptor, parent=None):
create = "let mut raw = boxed::into_raw(object);\nlet _rt = RootedTraceable::new(&*raw);\n" create = "let mut raw = Box::into_raw(object);\nlet _rt = RootedTraceable::new(&*raw);\n"
if descriptor.proxy: if descriptor.proxy:
assert not descriptor.isGlobal() assert not descriptor.isGlobal()
create += """ create += """
@ -5061,7 +5061,6 @@ class CGBindingRoot(CGThing):
'libc', 'libc',
'util::str::DOMString', 'util::str::DOMString',
'std::borrow::ToOwned', 'std::borrow::ToOwned',
'std::boxed',
'std::cmp', 'std::cmp',
'std::iter::repeat', 'std::iter::repeat',
'std::mem', 'std::mem',

View file

@ -21,7 +21,6 @@ use util::str::DOMString;
use libc; use libc;
use libc::c_uint; use libc::c_uint;
use std::boxed;
use std::ffi::CString; use std::ffi::CString;
use std::ptr; use std::ptr;
use std::cmp::PartialEq; use std::cmp::PartialEq;
@ -387,7 +386,7 @@ pub fn initialize_global(global: *mut JSObject) {
([0 as *mut JSObject; PrototypeList::ID::Count as usize]); ([0 as *mut JSObject; PrototypeList::ID::Count as usize]);
unsafe { unsafe {
assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0); assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0);
let box_ = boxed::into_raw(proto_array); let box_ = Box::into_raw(proto_array);
JS_SetReservedSlot(global, JS_SetReservedSlot(global,
DOM_PROTOTYPE_SLOT, DOM_PROTOTYPE_SLOT,
PrivateValue(box_ as *const libc::c_void)); PrivateValue(box_ as *const libc::c_void));