This commit is contained in:
Matthias Krüger 2020-03-15 23:41:20 +01:00
parent d8bcdac9de
commit ba0884bee3
30 changed files with 58 additions and 58 deletions

View File

@ -256,7 +256,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ExprVisitor<'a, 'tcx> {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -66,7 +66,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
}
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -457,7 +457,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
_ => walk_expr(self, e),
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -491,7 +491,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -156,7 +156,7 @@ impl<'tcx> Visitor<'tcx> for CCHelper {
_ => {},
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -148,7 +148,7 @@ impl_lint_pass!(DocMarkdown => [DOC_MARKDOWN, MISSING_SAFETY_DOC, MISSING_ERRORS
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DocMarkdown {
fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate<'_>) {
check_attrs(cx, &self.valid_idents, &krate.attrs);
check_attrs(cx, &self.valid_idents, &krate.item.attrs);
}
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {

View File

@ -181,7 +181,7 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for InsertVisitor<'a, 'tcx, 'b> {
walk_expr(self, expr);
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -92,7 +92,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
}
// TODO: Replace with Map::is_argument(..) when it's fixed
fn is_argument(map: &rustc::hir::map::Map<'_>, id: HirId) -> bool {
fn is_argument(map: rustc::hir::map::Map<'_>, id: HirId) -> bool {
match map.find(id) {
Some(Node::Binding(_)) => (),
_ => return false,
@ -136,7 +136,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
fn mutate(&mut self, cmt: &Place<'tcx>) {
if cmt.projections.is_empty() {
let map = &self.cx.tcx.hir();
if is_argument(map, cmt.hir_id) {
if is_argument(*map, cmt.hir_id) {
// Skip closure arguments
let parent_id = map.get_parent_node(cmt.hir_id);
if let Some(Node::Expr(..)) = map.find(map.get_parent_node(parent_id)) {

View File

@ -158,7 +158,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
fn visit_block(&mut self, _: &'tcx Block<'_>) {
// don't continue over blocks, LateLintPass already does that
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -341,7 +341,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -85,7 +85,7 @@ fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_it
intravisit::walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -561,7 +561,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
intravisit::walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}
@ -624,7 +624,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
}
}
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}

View File

@ -158,7 +158,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> {
}
intravisit::walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}

View File

@ -407,7 +407,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
}
walk_ty(self, ty);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -479,7 +479,7 @@ impl<'tcx> Visitor<'tcx> for LifetimeChecker {
walk_generic_param(self, param)
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -522,7 +522,7 @@ impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -1712,7 +1712,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LocalUsedVisitor<'a, 'tcx> {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -1885,7 +1885,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
}
self.prefer_mutable = old;
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -1942,7 +1942,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarUsedAfterLoopVisitor<'a, 'tcx> {
}
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -2084,7 +2084,7 @@ impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
}
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -2176,8 +2176,8 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
}
}
@ -2312,7 +2312,7 @@ impl<'tcx> Visitor<'tcx> for LoopNestVisitor {
walk_pat(self, pat)
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -2398,7 +2398,7 @@ impl<'a, 'tcx> Visitor<'tcx> for HasBreakOrReturnVisitor {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -2449,7 +2449,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarCollectorVisitor<'a, 'tcx> {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -1545,7 +1545,7 @@ fn lint_or_fun_call<'a, 'tcx>(
}
}
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}
@ -3453,7 +3453,7 @@ fn contains_return(expr: &hir::Expr<'_>) -> bool {
}
}
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}

View File

@ -99,8 +99,8 @@ impl<'a, 'tcx> Visitor<'tcx> for UnwrapVisitor<'a, 'tcx> {
walk_path(self, path);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.cx.tcx.hir())
}
}
@ -121,8 +121,8 @@ impl<'a, 'tcx> Visitor<'tcx> for MapExprVisitor<'a, 'tcx> {
walk_path(self, path);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.cx.tcx.hir())
}
}

View File

@ -136,7 +136,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReturnVisitor<'a, 'tcx> {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -125,7 +125,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
}
fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate<'_>) {
self.check_missing_docs_attrs(cx, &krate.attrs, krate.span, "crate");
self.check_missing_docs_attrs(cx, &krate.item.attrs, krate.item.span, "crate");
}
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item<'_>) {

View File

@ -108,7 +108,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for MutVisitor<'a, 'tcx> {
intravisit::walk_ty(self, ty);
}
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}

View File

@ -155,7 +155,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MutArgVisitor<'a, 'tcx> {
walk_expr(self, expr)
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
}
}

View File

@ -318,7 +318,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VectorInitializationVisitor<'a, 'tcx> {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -197,7 +197,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BinaryExprVisitor {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -1554,7 +1554,7 @@ impl<'tcx> Visitor<'tcx> for TypeComplexityVisitor {
walk_ty(self, ty);
self.nest -= sub_nest;
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -2309,7 +2309,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ImplicitHasherTypeVisitor<'a, 'tcx> {
walk_ty(self, t);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -2386,8 +2386,8 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 't
walk_expr(self, e);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
}
}

View File

@ -107,7 +107,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnusedSelfVisitor<'a, 'tcx> {
walk_path(self, path);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
}
}

View File

@ -185,8 +185,8 @@ impl<'a, 'tcx> Visitor<'tcx> for UnwrappableVariablesVisitor<'a, 'tcx> {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
}
}

View File

@ -113,7 +113,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TraitImplTyVisitor<'a, 'tcx> {
walk_ty(self, t)
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -275,7 +275,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.cx.tcx.hir())
}
}

View File

@ -689,7 +689,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -299,8 +299,8 @@ impl<'a, 'tcx> Visitor<'tcx> for LintCollector<'a, 'tcx> {
self.output.insert(path.segments[0].ident.name);
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.cx.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.cx.tcx.hir())
}
}

View File

@ -479,7 +479,7 @@ impl<'tcx> Visitor<'tcx> for ContainsName {
self.result = true;
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
@ -1355,7 +1355,7 @@ pub fn is_must_use_func_call(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool
}
pub fn is_no_std_crate(krate: &Crate<'_>) -> bool {
krate.attrs.iter().any(|attr| {
krate.item.attrs.iter().any(|attr| {
if let ast::AttrKind::Normal(ref attr) = attr.kind {
attr.path == symbol::sym::no_std
} else {

View File

@ -78,7 +78,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PtrCloneVisitor<'a, 'tcx> {
walk_expr(self, expr);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View File

@ -93,7 +93,7 @@ impl<'tcx> Visitor<'tcx> for UsedVisitor {
}
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}