Upgrade to rustc 1.6.0-nightly (d5fde83ae 2015-11-12)

… and libc 0.2 and many other dependencies
This commit is contained in:
Manish Goregaokar 2015-11-07 22:40:18 +05:30 committed by Josh Matthews
parent bc618b0d53
commit dc0e467945
59 changed files with 1092 additions and 978 deletions

View file

@ -24,13 +24,13 @@ impl LintPass for InheritancePass {
}
impl LateLintPass for InheritancePass {
fn check_struct_def(&mut self, cx: &LateContext, def: &hir::StructDef, _n: ast::Name,
fn check_struct_def(&mut self, cx: &LateContext, def: &hir::VariantData, _n: ast::Name,
_gen: &hir::Generics, id: ast::NodeId) {
// Lints are run post expansion, so it's fine to use
// #[_dom_struct_marker] here without also checking for #[dom_struct]
if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "_dom_struct_marker") {
// Find the reflector, if any
let reflector_span = def.fields.iter().enumerate()
let reflector_span = def.fields().iter().enumerate()
.find(|&(ctr, f)| {
if match_lang_ty(cx, &*f.node.ty, "reflector") {
if ctr > 0 {
@ -44,7 +44,7 @@ impl LateLintPass for InheritancePass {
})
.map(|(_, f)| f.span);
// Find all #[dom_struct] fields
let dom_spans: Vec<_> = def.fields.iter().enumerate().filter_map(|(ctr, f)| {
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, _), .. }) =
cx.tcx.def_map.borrow().get(&f.node.ty.id) {

View file

@ -25,12 +25,12 @@ impl LintPass for PrivatizePass {
impl LateLintPass for PrivatizePass {
fn check_struct_def(&mut self,
cx: &LateContext,
def: &hir::StructDef,
def: &hir::VariantData,
_n: ast::Name,
_gen: &hir::Generics,
id: ast::NodeId) {
if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "privatize") {
for field in &def.fields {
for field in def.fields() {
match field.node {
hir::StructField_ { kind: hir::NamedField(name, visibility), .. } if visibility == hir::Public => {
cx.span_lint(PRIVATIZE, field.span,

View file

@ -80,7 +80,7 @@ impl LateLintPass for UnrootedPass {
/// All structs containing #[must_root] types must be #[must_root] themselves
fn check_struct_def(&mut self,
cx: &LateContext,
def: &hir::StructDef,
def: &hir::VariantData,
_n: ast::Name,
_gen: &hir::Generics,
id: ast::NodeId) {
@ -89,7 +89,7 @@ impl LateLintPass for UnrootedPass {
_ => cx.tcx.map.expect_item(cx.tcx.map.get_parent(id)),
};
if item.attrs.iter().all(|a| !a.check_name("must_root")) {
for ref field in &def.fields {
for ref field in def.fields() {
if is_unrooted_ty(cx, cx.tcx.node_id_to_type(field.node.id), false) {
cx.span_lint(UNROOTED_MUST_ROOT, field.span,
"Type must be rooted, use #[must_root] on the struct definition to propagate")
@ -101,13 +101,13 @@ impl LateLintPass for UnrootedPass {
/// All enums containing #[must_root] types must be #[must_root] themselves
fn check_variant(&mut self, cx: &LateContext, var: &hir::Variant, _gen: &hir::Generics) {
let ref map = cx.tcx.map;
if map.expect_item(map.get_parent(var.node.id)).attrs.iter().all(|a| !a.check_name("must_root")) {
match var.node.kind {
hir::TupleVariantKind(ref vec) => {
if map.expect_item(map.get_parent(var.node.data.id())).attrs.iter().all(|a| !a.check_name("must_root")) {
match var.node.data {
hir::VariantData::Tuple(ref vec, _) => {
for ty in vec {
cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.id).map(|t| {
cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.node.id).map(|t| {
if is_unrooted_ty(cx, t, false) {
cx.span_lint(UNROOTED_MUST_ROOT, ty.ty.span,
cx.span_lint(UNROOTED_MUST_ROOT, ty.node.ty.span,
"Type must be rooted, use #[must_root] on \
the enum definition to propagate")
}