This commit is contained in:
Simon Sapin 2019-02-26 08:18:33 +01:00
parent 7bb7c9a1e3
commit 4464354e2e
10 changed files with 42 additions and 21 deletions

View file

@ -121,7 +121,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
) {
let item = match cx.tcx.hir().get_by_hir_id(id) {
hir::Node::Item(item) => item,
_ => cx.tcx.hir().expect_item_by_hir_id(cx.tcx.hir().get_parent_item(id)),
_ => cx
.tcx
.hir()
.expect_item_by_hir_id(cx.tcx.hir().get_parent_item(id)),
};
if item.attrs.iter().all(|a| !a.check_name("must_root")) {
for ref field in def.fields() {