Skip to content

Commit b559103

Browse files
committed
Add check from_expansion
1 parent 8c97cfc commit b559103

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_lints/src/redundant_type_annotations.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ fn is_redundant_in_func_call<'tcx>(
102102
impl LateLintPass<'_> for RedundantTypeAnnotations {
103103
fn check_local<'tcx>(&mut self, cx: &LateContext<'tcx>, local: &'tcx rustc_hir::Local<'tcx>) {
104104
// type annotation part
105-
if let Some(ty) = &local.ty
105+
if !local.span.from_expansion()
106+
&& let Some(ty) = &local.ty
106107
&& let hir::TyKind::Path(ty_path) = &ty.kind
107108
&& let hir::QPath::Resolved(_, resolved_path_ty) = ty_path
108109

0 commit comments

Comments
 (0)