Put is_from_proc_macro last

This commit is contained in:
Red Rapious 2023-08-23 13:46:12 +02:00
parent e9a222beb5
commit f3c5877302

View file

@ -112,8 +112,8 @@ impl<'tcx> LateLintPass<'tcx> for ReserveAfterInitialization {
if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind
&& let ExprKind::MethodCall(name, self_arg, [space_hint], _) = expr.kind
&& path_to_local_id(self_arg, searcher.local_id)
&& !is_from_proc_macro(cx, expr)
&& name.ident.as_str() == "reserve"
&& !is_from_proc_macro(cx, expr)
{
self.searcher = Some(VecReserveSearcher {
err_span: searcher.err_span.to(stmt.span),