mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
This commit is contained in:
parent
ff8cbff810
commit
95fc29fa0d
255 changed files with 3550 additions and 3362 deletions
|
@ -10,6 +10,7 @@ use flow::Flow;
|
|||
use flow;
|
||||
|
||||
use std::mem;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::ptr;
|
||||
use std::raw;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
@ -19,6 +20,9 @@ pub struct FlowRef {
|
|||
object: raw::TraitObject,
|
||||
}
|
||||
|
||||
unsafe impl Send for FlowRef {}
|
||||
unsafe impl Sync for FlowRef {}
|
||||
|
||||
impl FlowRef {
|
||||
pub fn new(mut flow: Box<Flow>) -> FlowRef {
|
||||
unsafe {
|
||||
|
@ -33,7 +37,8 @@ impl FlowRef {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Deref<Flow + 'a> for FlowRef {
|
||||
impl<'a> Deref for FlowRef {
|
||||
type Target = Flow + 'a;
|
||||
fn deref(&self) -> &(Flow + 'a) {
|
||||
unsafe {
|
||||
mem::transmute_copy::<raw::TraitObject, &(Flow + 'a)>(&self.object)
|
||||
|
@ -41,7 +46,7 @@ impl<'a> Deref<Flow + 'a> for FlowRef {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> DerefMut<Flow + 'a> for FlowRef {
|
||||
impl<'a> DerefMut for FlowRef {
|
||||
fn deref_mut<'a>(&mut self) -> &mut (Flow + 'a) {
|
||||
unsafe {
|
||||
mem::transmute_copy::<raw::TraitObject, &mut (Flow + 'a)>(&self.object)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue