Updated source to match with recent rustc master toolchain changes

This commit is contained in:
Félix Fischer 2019-03-29 01:47:09 -03:00 committed by flip1995
parent bbb7963735
commit 491f72442e
No known key found for this signature in database
GPG key ID: 693086869D506637
3 changed files with 5 additions and 3 deletions

View file

@ -39,9 +39,10 @@ impl LintPass for EnumGlobUse {
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod, _: Span, _: HirId) {
let map = cx.tcx.hir();
// only check top level `use` statements
for item in &m.item_ids {
self.lint_item(cx, cx.tcx.hir().expect_item(item.id));
self.lint_item(cx, map.expect_item(map.hir_to_node_id(item.id)));
}
}
}

View file

@ -356,7 +356,8 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
self.collect_anonymous_lifetimes(path, ty);
},
TyKind::Def(item, _) => {
if let ItemKind::Existential(ref exist_ty) = self.cx.tcx.hir().expect_item(item.id).node {
let map = self.cx.tcx.hir();
if let ItemKind::Existential(ref exist_ty) = map.expect_item(map.hir_to_node_id(item.id)).node {
for bound in &exist_ty.bounds {
if let GenericBound::Outlives(_) = *bound {
self.record(&None);

View file

@ -93,7 +93,7 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
ls.register_early_pass(Some(sess), true, false, pass);
}
for pass in late_lint_passes {
ls.register_late_pass(Some(sess), true, pass);
ls.register_late_pass(Some(sess), true, false, pass);
}
for (name, (to, deprecated_name)) in lint_groups {