Auto merge of #11269 - y21:issue11268, r=Centri3

[`unnecessary_mut_passed`]: don't lint in macro expansions

Fixes #11268

changelog: [`unnecessary_mut_passed`]: don't lint in macro expansions
This commit is contained in:
bors 2023-08-01 05:15:09 +00:00
commit 588c1abb76
3 changed files with 23 additions and 5 deletions

View file

@ -37,6 +37,11 @@ declare_lint_pass!(UnnecessaryMutPassed => [UNNECESSARY_MUT_PASSED]);
impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
if e.span.from_expansion() {
// Issue #11268
return;
}
match e.kind {
ExprKind::Call(fn_expr, arguments) => {
if let ExprKind::Path(ref path) = fn_expr.kind {