@@ -14,7 +14,7 @@ use rustc_span::source_map::{ExpnKind, Span};
1414use crate :: consts:: { constant, Constant } ;
1515use crate :: utils:: sugg:: Sugg ;
1616use crate :: utils:: {
17- get_item_name, get_parent_expr, implements_trait, in_constant, is_integer_const, iter_input_pats,
17+ get_item_name, get_parent_expr, higher , implements_trait, in_constant, is_integer_const, iter_input_pats,
1818 last_path_segment, match_qpath, match_trait_method, paths, snippet, snippet_opt, span_lint, span_lint_and_sugg,
1919 span_lint_and_then, span_lint_hir_and_then, walk_ptrs_ty, SpanlessEq ,
2020} ;
@@ -267,6 +267,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MiscLints {
267267 if let StmtKind :: Local ( ref local) = stmt. kind;
268268 if let PatKind :: Binding ( an, .., name, None ) = local. pat. kind;
269269 if let Some ( ref init) = local. init;
270+ if !higher:: is_from_for_desugar( local) ;
270271 then {
271272 if an == BindingAnnotation :: Ref || an == BindingAnnotation :: RefMut {
272273 let sugg_init = if init. span. from_expansion( ) {
0 commit comments