Skip to content

Commit

Permalink
Auto merge of #9470 - servo:rustup, r=Ms2ger
Browse files Browse the repository at this point in the history
Bump Rust to 2016-01-31 nightly

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9470)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Feb 1, 2016
2 parents b19faa5 + 436b952 commit 9baa59a
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 73 deletions.
26 changes: 16 additions & 10 deletions components/plugins/lints/inheritance_integrity.rs
Expand Up @@ -46,9 +46,12 @@ impl LateLintPass for InheritancePass {
// Find all #[dom_struct] fields
let dom_spans: Vec<_> = def.fields().iter().enumerate().filter_map(|(ctr, f)| {
if let hir::TyPath(..) = f.node.ty.node {
if let Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) =
if let Some(&def::PathResolution { base_def: def, .. }) =
cx.tcx.def_map.borrow().get(&f.node.ty.id) {
if cx.tcx.has_attr(def_id, "_dom_struct_marker") {
if let def::Def::PrimTy(_) = def {
return None;
}
if cx.tcx.has_attr(def.def_id(), "_dom_struct_marker") {
// If the field is not the first, it's probably
// being misused (a)
if ctr > 0 {
Expand All @@ -66,23 +69,26 @@ impl LateLintPass for InheritancePass {
// We should not have both a reflector and a dom struct field
if let Some(sp) = reflector_span {
if dom_spans.len() > 0 {
cx.span_lint(INHERITANCE_INTEGRITY, cx.tcx.map.expect_item(id).span,
"This DOM struct has both Reflector and bare DOM struct members");
let mut db = cx.struct_span_lint(INHERITANCE_INTEGRITY,
cx.tcx.map.expect_item(id).span,
"This DOM struct has both Reflector \
and bare DOM struct members");
if cx.current_level(INHERITANCE_INTEGRITY) != Level::Allow {
let sess = cx.sess();
sess.span_note(sp, "Reflector found here");
db.span_note(sp, "Reflector found here");
for span in &dom_spans {
sess.span_note(*span, "Bare DOM struct found here");
db.span_note(*span, "Bare DOM struct found here");
}
}
}
// Nor should we have more than one dom struct field
} else if dom_spans.len() > 1 {
cx.span_lint(INHERITANCE_INTEGRITY, cx.tcx.map.expect_item(id).span,
"This DOM struct has multiple DOM struct members, only one is allowed");
let mut db = cx.struct_span_lint(INHERITANCE_INTEGRITY,
cx.tcx.map.expect_item(id).span,
"This DOM struct has multiple \
DOM struct members, only one is allowed");
if cx.current_level(INHERITANCE_INTEGRITY) != Level::Allow {
for span in &dom_spans {
cx.sess().span_note(*span, "Bare DOM struct found here");
db.span_note(*span, "Bare DOM struct found here");
}
}
} else if dom_spans.is_empty() {
Expand Down
12 changes: 8 additions & 4 deletions components/plugins/utils.rs
Expand Up @@ -25,7 +25,7 @@ pub fn match_ty_unwrap<'a>(ty: &'a ast::Ty, segments: &[&str]) -> Option<&'a [P<
// which will compare them in reverse until one of them runs out of segments
if seg.iter().rev().zip(segments.iter().rev()).all(|(a, b)| a.identifier.name.as_str() == *b) {
match seg.last() {
Some(&ast::PathSegment { parameters: ast::AngleBracketedParameters(ref a), .. }) => {
Some(&ast::PathSegment { parameters: ast::PathParameters::AngleBracketed(ref a), .. }) => {
Some(&a.types)
}
_ => None
Expand All @@ -45,12 +45,16 @@ pub fn match_lang_ty(cx: &LateContext, ty: &hir::Ty, value: &str) -> bool {
_ => return false,
}

let def_id = match cx.tcx.def_map.borrow().get(&ty.id) {
Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) => def_id,
let def = match cx.tcx.def_map.borrow().get(&ty.id) {
Some(&def::PathResolution { base_def: def, .. }) => def,
_ => return false,
};

match_lang_did(cx, def_id, value)
if let def::Def::PrimTy(_) = def {
return false;
}

match_lang_did(cx, def.def_id(), value)
}

pub fn match_lang_did(cx: &LateContext, did: DefId, value: &str) -> bool {
Expand Down
6 changes: 2 additions & 4 deletions components/script/dom/bindings/trace.rs
Expand Up @@ -71,10 +71,9 @@ use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use std::boxed::FnBox;
use std::cell::{Cell, UnsafeCell};
use std::collections::hash_state::HashState;
use std::collections::{HashMap, HashSet};
use std::ffi::CString;
use std::hash::{Hash, Hasher};
use std::hash::{BuildHasher, Hash};
use std::intrinsics::return_address;
use std::iter::{FromIterator, IntoIterator};
use std::mem;
Expand Down Expand Up @@ -235,8 +234,7 @@ impl<T: JSTraceable, U: JSTraceable> JSTraceable for Result<T, U> {
impl<K, V, S> JSTraceable for HashMap<K, V, S>
where K: Hash + Eq + JSTraceable,
V: JSTraceable,
S: HashState,
<S as HashState>::Hasher: Hasher,
S: BuildHasher
{
#[inline]
fn trace(&self, trc: *mut JSTracer) {
Expand Down
26 changes: 13 additions & 13 deletions components/servo/Cargo.lock

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

6 changes: 3 additions & 3 deletions components/util/mem.rs
Expand Up @@ -19,8 +19,8 @@ use range::Range;
use selectors::parser::{Combinator, CompoundSelector, PseudoElement, Selector, SimpleSelector};
use selectors::states::ElementState;
use std::cell::{Cell, RefCell};
use std::collections::{HashMap, LinkedList, hash_state};
use std::hash::Hash;
use std::collections::{HashMap, LinkedList};
use std::hash::{BuildHasher, Hash};
use std::mem::{size_of, transmute};
use std::rc::Rc;
use std::result::Result;
Expand Down Expand Up @@ -194,7 +194,7 @@ impl<T> HeapSizeOf for Vec<Rc<T>> {
}

impl<K: HeapSizeOf, V: HeapSizeOf, S> HeapSizeOf for HashMap<K, V, S>
where K: Eq + Hash, S: hash_state::HashState {
where K: Eq + Hash, S: BuildHasher {
fn heap_size_of_children(&self) -> usize {
//TODO(#6908) measure actual bucket memory usage instead of approximating
let size = self.capacity() * (size_of::<V>() + size_of::<K>());
Expand Down
26 changes: 13 additions & 13 deletions ports/cef/Cargo.lock

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

24 changes: 12 additions & 12 deletions ports/geckolib/Cargo.lock

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

0 comments on commit 9baa59a

Please sign in to comment.