servo: Merge #6464 - Use Box::into_raw rather than boxed::into_raw (from Ms2ger:into_raw); r=saneyuki

The latter is deprecated.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9eb3cc2a241dff4df57d644fa5257fcf3a52325f
This commit is contained in:
Ms2ger 2015-06-26 04:50:54 -06:00
Родитель 951498d312
Коммит 99cf771646
4 изменённых файлов: 8 добавлений и 12 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -2059,7 +2059,7 @@ class CGAbstractMethod(CGThing):
assert(False) # Override me!
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:
assert not descriptor.isGlobal()
create += """
@ -5061,7 +5061,6 @@ class CGBindingRoot(CGThing):
'libc',
'util::str::DOMString',
'std::borrow::ToOwned',
'std::boxed',
'std::cmp',
'std::iter::repeat',
'std::mem',

Просмотреть файл

@ -21,7 +21,6 @@ use util::str::DOMString;
use libc;
use libc::c_uint;
use std::boxed;
use std::ffi::CString;
use std::ptr;
use std::cmp::PartialEq;
@ -387,7 +386,7 @@ pub fn initialize_global(global: *mut JSObject) {
([0 as *mut JSObject; PrototypeList::ID::Count as usize]);
unsafe {
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,
DOM_PROTOTYPE_SLOT,
PrivateValue(box_ as *const libc::c_void));