Skip to content

Commit

Permalink
Add check from_expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioC31 committed Apr 17, 2023
1 parent b20100c commit 059c439
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clippy_lints/src/redundant_type_annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ fn is_redundant_in_func_call<'tcx>(
impl LateLintPass<'_> for RedundantTypeAnnotations {
fn check_local<'tcx>(&mut self, cx: &LateContext<'tcx>, local: &'tcx rustc_hir::Local<'tcx>) {
// type annotation part
if let Some(ty) = &local.ty
if !local.span.from_expansion()
&& let Some(ty) = &local.ty
&& let hir::TyKind::Path(ty_path) = &ty.kind
&& let hir::QPath::Resolved(_, resolved_path_ty) = ty_path

Expand Down

0 comments on commit 059c439

Please sign in to comment.