Skip to content

Commit 8bd67dd

Browse files
authored
Rollup merge of rust-lang#106906 - matthiaskrgr:clone, r=Nilstrieb
remove redundant clones
2 parents 5321ad5 + 665d4ea commit 8bd67dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_lint/src/internal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
187187
},
188188
None => cx.emit_spanned_lint(USAGE_OF_TY_TYKIND, path.span, TykindDiag),
189189
}
190-
} else if !ty.span.from_expansion() && path.segments.len() > 1 && let Some(t) = is_ty_or_ty_ctxt(cx, &path) {
190+
} else if !ty.span.from_expansion() && path.segments.len() > 1 && let Some(ty) = is_ty_or_ty_ctxt(cx, &path) {
191191
cx.emit_spanned_lint(USAGE_OF_QUALIFIED_TY, path.span, TyQualified {
192-
ty: t.clone(),
192+
ty,
193193
suggestion: path.span,
194194
});
195195
}

compiler/rustc_lint/src/pass_by_value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'tcx> LateLintPass<'tcx> for PassByValue {
3232
cx.emit_spanned_lint(
3333
PASS_BY_VALUE,
3434
ty.span,
35-
PassByValueDiag { ty: t.clone(), suggestion: ty.span },
35+
PassByValueDiag { ty: t, suggestion: ty.span },
3636
);
3737
}
3838
}

0 commit comments

Comments
 (0)