aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/lints/unrooted_must_root.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-11-27 10:47:00 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-11-27 10:47:00 +0530
commitf13c72d68e1e7f49e241938bfd6e8a588c68e86b (patch)
tree5a4f80662d4c7b5b18adc49a325015e971380225 /components/plugins/lints/unrooted_must_root.rs
parentbc618b0d535e0e67a7ea845c026678113f000d64 (diff)
parentdc0e467945e7fb8eaf93f9e40e7ebcb2d5f52b0c (diff)
downloadservo-f13c72d68e1e7f49e241938bfd6e8a588c68e86b.tar.gz
servo-f13c72d68e1e7f49e241938bfd6e8a588c68e86b.zip
Auto merge of #8446 - servo:rustup_20151110, r=SimonSapin+Ms2ger+jdm+Manishearth
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08) <s>DO NOT r+ or try+ this</s> <s>It causes an OOM (https://github.com/rust-lang/rust/issues/29740) and can crash the OS. Probably will set our CI on fire. </s> <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446) <!-- Reviewable:end -->
Diffstat (limited to 'components/plugins/lints/unrooted_must_root.rs')
-rw-r--r--components/plugins/lints/unrooted_must_root.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs
index 5b6e16c99e9..7f4eacdbd62 100644
--- a/components/plugins/lints/unrooted_must_root.rs
+++ b/components/plugins/lints/unrooted_must_root.rs
@@ -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")
}