Skip to content

Commit

Permalink
Auto merge of #11231 - servo:rustup, r=Ms2ger
Browse files Browse the repository at this point in the history
Update Rust to 1.10.0-nightly (cd6a40017 2016-05-16)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11231)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed May 17, 2016
2 parents 9850865 + 60aaac5 commit 82036b5
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 146 deletions.
3 changes: 2 additions & 1 deletion components/plugins/jstraceable.rs
Expand Up @@ -53,7 +53,8 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
ret_ty: ty::nil_ty(),
attributes: vec![quote_attr!(cx, #[inline])],
is_unsafe: false,
combine_substructure: combine_substructure(box jstraceable_substructure)
combine_substructure: combine_substructure(box jstraceable_substructure),
unify_fieldless_variants: true,
}
],
associated_types: vec![],
Expand Down
4 changes: 1 addition & 3 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -6377,9 +6377,7 @@ def type_id_variant(name):
if not config.getInterface(base).getExtendedAttribute("Abstract"):
variants.append(CGGeneric(base))
variants += [CGGeneric(type_id_variant(derivedName)) for derivedName in derived]
derives = "Clone, Copy, Debug"
if base != 'EventTarget' and base != 'HTMLElement':
derives += ", PartialEq"
derives = "Clone, Copy, Debug, PartialEq"
typeIdCode.append(CGWrapper(CGIndenter(CGList(variants, ",\n"), 4),
pre="#[derive(%s)]\npub enum %sTypeId {\n" % (derives, base),
post="\n}\n\n"))
Expand Down
40 changes: 2 additions & 38 deletions components/script/dom/eventtarget.rs
Expand Up @@ -13,7 +13,7 @@ use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::codegen::UnionTypes::EventOrString;
use dom::bindings::error::{Error, Fallible, report_pending_exception};
use dom::bindings::inheritance::{Castable, EventTargetTypeId};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, Reflector};
use dom::element::Element;
Expand All @@ -35,8 +35,8 @@ use std::ffi::CString;
use std::hash::BuildHasherDefault;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::ptr;
use std::rc::Rc;
use std::{intrinsics, ptr};
use string_cache::Atom;
use url::Url;
use util::str::DOMString;
Expand All @@ -62,42 +62,6 @@ pub enum ListenerPhase {
Bubbling,
}

impl PartialEq for EventTargetTypeId {
#[inline]
fn eq(&self, other: &EventTargetTypeId) -> bool {
match (*self, *other) {
(EventTargetTypeId::Node(this_type), EventTargetTypeId::Node(other_type)) => {
this_type == other_type
}
_ => self.eq_slow(other)
}
}
}

impl EventTargetTypeId {
#[allow(unsafe_code)]
fn eq_slow(&self, other: &EventTargetTypeId) -> bool {
match (*self, *other) {
(EventTargetTypeId::Node(this_type), EventTargetTypeId::Node(other_type)) => {
this_type == other_type
}
(EventTargetTypeId::WorkerGlobalScope(this_type),
EventTargetTypeId::WorkerGlobalScope(other_type)) => {
this_type == other_type
}
(EventTargetTypeId::XMLHttpRequestEventTarget(this_type),
EventTargetTypeId::XMLHttpRequestEventTarget(other_type)) => {
this_type == other_type
}
(_, _) => {
unsafe {
intrinsics::discriminant_value(self) == intrinsics::discriminant_value(other)
}
}
}
}
}

/// https://html.spec.whatwg.org/multipage/#internal-raw-uncompiled-handler
#[derive(JSTraceable, Clone, PartialEq)]
pub struct InternalRawUncompiledHandler {
Expand Down
23 changes: 0 additions & 23 deletions components/script/dom/htmlelement.rs
Expand Up @@ -32,7 +32,6 @@ use dom::virtualmethods::VirtualMethods;
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::default::Default;
use std::intrinsics;
use std::rc::Rc;
use string_cache::Atom;
use style::element_state::*;
Expand Down Expand Up @@ -488,25 +487,3 @@ impl VirtualMethods for HTMLElement {
self.update_sequentially_focusable_status();
}
}

impl PartialEq for HTMLElementTypeId {
#[inline]
#[allow(unsafe_code)]
fn eq(&self, other: &HTMLElementTypeId) -> bool {
match (*self, *other) {
(HTMLElementTypeId::HTMLMediaElement(this_type),
HTMLElementTypeId::HTMLMediaElement(other_type)) => {
this_type == other_type
}
(HTMLElementTypeId::HTMLTableCellElement(this_type),
HTMLElementTypeId::HTMLTableCellElement(other_type)) => {
this_type == other_type
}
(_, _) => {
unsafe {
intrinsics::discriminant_value(self) == intrinsics::discriminant_value(other)
}
}
}
}
}
46 changes: 23 additions & 23 deletions components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82036b5

Please sign in to comment.