]> git.lizzy.rs Git - rust.git/commitdiff
Merge remote-tracking branch 'upstream/master' into rustup
authorPhilipp Krones <hello@philkrones.com>
Wed, 28 Sep 2022 12:27:32 +0000 (14:27 +0200)
committerPhilipp Krones <hello@philkrones.com>
Wed, 28 Sep 2022 12:27:32 +0000 (14:27 +0200)
68 files changed:
1  2 
clippy_dev/src/new_lint.rs
clippy_lints/src/default.rs
clippy_lints/src/default_union_representation.rs
clippy_lints/src/dereference.rs
clippy_lints/src/derive.rs
clippy_lints/src/disallowed_types.rs
clippy_lints/src/doc.rs
clippy_lints/src/enum_variants.rs
clippy_lints/src/equatable_if_let.rs
clippy_lints/src/escape.rs
clippy_lints/src/eta_reduction.rs
clippy_lints/src/exhaustive_items.rs
clippy_lints/src/functions/must_use.rs
clippy_lints/src/implicit_hasher.rs
clippy_lints/src/inherent_to_string.rs
clippy_lints/src/iter_not_returning_iterator.rs
clippy_lints/src/large_const_arrays.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/lib.register_all.rs
clippy_lints/src/lib.register_nursery.rs
clippy_lints/src/lib.rs
clippy_lints/src/lifetimes.rs
clippy_lints/src/loops/mut_range_bound.rs
clippy_lints/src/loops/utils.rs
clippy_lints/src/manual_async_fn.rs
clippy_lints/src/manual_non_exhaustive.rs
clippy_lints/src/matches/match_same_arms.rs
clippy_lints/src/matches/needless_match.rs
clippy_lints/src/matches/redundant_pattern_match.rs
clippy_lints/src/matches/single_match.rs
clippy_lints/src/methods/mod.rs
clippy_lints/src/methods/unnecessary_to_owned.rs
clippy_lints/src/missing_const_for_fn.rs
clippy_lints/src/missing_doc.rs
clippy_lints/src/missing_inline.rs
clippy_lints/src/mut_reference.rs
clippy_lints/src/needless_pass_by_value.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/non_copy_const.rs
clippy_lints/src/non_expressive_names.rs
clippy_lints/src/operators/assign_op_pattern.rs
clippy_lints/src/pass_by_ref_or_value.rs
clippy_lints/src/question_mark.rs
clippy_lints/src/redundant_pub_crate.rs
clippy_lints/src/transmute/transmute_undefined_repr.rs
clippy_lints/src/transmute/utils.rs
clippy_lints/src/types/borrowed_box.rs
clippy_lints/src/types/mod.rs
clippy_lints/src/types/redundant_allocation.rs
clippy_lints/src/types/vec_box.rs
clippy_lints/src/unwrap.rs
clippy_lints/src/upper_case_acronyms.rs
clippy_lints/src/use_self.rs
clippy_lints/src/utils/author.rs
clippy_lints/src/utils/internal_lints.rs
clippy_lints/src/wildcard_imports.rs
clippy_lints/src/zero_sized_map_values.rs
clippy_utils/src/lib.rs
clippy_utils/src/qualify_min_const_fn.rs
clippy_utils/src/sugg.rs
clippy_utils/src/ty.rs
clippy_utils/src/usage.rs
src/docs/arithmetic_side_effects.txt
tests/ui/needless_return.fixed
tests/ui/needless_return.rs
tests/ui/needless_return.stderr
tests/ui/never_loop.rs
tests/ui/never_loop.stderr

Simple merge
Simple merge
index 3905a6c2e211998f0cfb8a2fdd33948c03402d41,d559ad423df5f32f5ef8c3709487df507a92a028..741edc1319609004c4e9ed087025aae0f70c5856
@@@ -1,10 -1,10 +1,10 @@@
  use clippy_utils::diagnostics::span_lint_and_help;
  use rustc_hir::{self as hir, HirId, Item, ItemKind};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::ty::layout::LayoutOf;
  use rustc_session::{declare_lint_pass, declare_tool_lint};
  use rustc_span::sym;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  declare_clippy_lint! {
      /// ### What it does
Simple merge
Simple merge
index 28dbfbab2e19bd511908dc8b2f8da751a4d2932b,53451238d9acb54820e3abcefc7b6ef745f485ee..debcd75ae75b6cbe83495a7a9586d3dc25805d69
@@@ -1,9 -1,9 +1,7 @@@
  use clippy_utils::diagnostics::span_lint_and_then;
  
  use rustc_data_structures::fx::FxHashMap;
--use rustc_hir::{
-     def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, Ty, TyKind, UseKind,
 -    def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, TraitBoundModifier, Ty, TyKind, UseKind,
--};
++use rustc_hir::{def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, Ty, TyKind, UseKind};
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_session::{declare_tool_lint, impl_lint_pass};
  use rustc_span::Span;
index f48ba526d51e1693daf593a777ccf4956273128d,fa50a2d1a2c6e7218664c2895c442abf7800f449..fd143a9d77c1092165e7f2de1074bab2828cc9db
@@@ -237,7 -237,7 +237,15 @@@ impl<'tcx> LateLintPass<'tcx> for DocMa
                          panic_span: None,
                      };
                      fpu.visit_expr(body.value);
-                     lint_for_missing_headers(cx, item.def_id.def_id, item.span, sig, headers, Some(body_id), fpu.panic_span);
 -                    lint_for_missing_headers(cx, item.def_id, item.span, sig, headers, Some(body_id), fpu.panic_span);
++                    lint_for_missing_headers(
++                        cx,
++                        item.def_id.def_id,
++                        item.span,
++                        sig,
++                        headers,
++                        Some(body_id),
++                        fpu.panic_span,
++                    );
                  }
              },
              hir::ItemKind::Impl(impl_) => {
                  panic_span: None,
              };
              fpu.visit_expr(body.value);
-             lint_for_missing_headers(cx, item.def_id.def_id, item.span, sig, headers, Some(body_id), fpu.panic_span);
 -            lint_for_missing_headers(cx, item.def_id, item.span, sig, headers, Some(body_id), fpu.panic_span);
++            lint_for_missing_headers(
++                cx,
++                item.def_id.def_id,
++                item.span,
++                sig,
++                headers,
++                Some(body_id),
++                fpu.panic_span,
++            );
          }
      }
  }
Simple merge
index bce49165e5b18060f96430be8356f5fb979d14ac,7917d83c0b9e8a332d2438e6371d53019ff9c653..f5aa0dcf9a463c196e7e98c4de228431750fe806
@@@ -51,9 -51,7 +51,7 @@@ fn unary_pattern(pat: &Pat<'_>) -> boo
              false
          },
          PatKind::Struct(_, a, etc) => !etc && a.iter().all(|x| unary_pattern(x.pat)),
-         PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => {
-             !etc.as_opt_usize().is_some() && array_rec(a)
-         }
 -        PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => !etc.is_some() && array_rec(a),
++        PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => !etc.as_opt_usize().is_some() && array_rec(a),
          PatKind::Ref(x, _) | PatKind::Box(x) => unary_pattern(x),
          PatKind::Path(_) | PatKind::Lit(_) => true,
      }
index 8ccc969646ec5f4aa2b29d1459664c0b21ca34af,327865e4c858ab36e8166c5773aa505804a44cce..2e608fe527fdceee413e19f8b30da78b85f49a43
@@@ -1,6 -1,6 +1,7 @@@
  use clippy_utils::diagnostics::span_lint_hir;
  use rustc_hir::intravisit;
  use rustc_hir::{self, AssocItemKind, Body, FnDecl, HirId, HirIdSet, Impl, ItemKind, Node, Pat, PatKind};
++use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::mir::FakeReadCause;
@@@ -10,7 -10,7 +11,6 @@@ use rustc_session::{declare_tool_lint, 
  use rustc_span::source_map::Span;
  use rustc_span::symbol::kw;
  use rustc_target::spec::abi::Abi;
- use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
 -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  
  #[derive(Copy, Clone)]
  pub struct BoxedLocal {
@@@ -177,7 -177,7 +177,13 @@@ impl<'a, 'tcx> Delegate<'tcx> for Escap
          }
      }
  
-     fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
 -    fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
++    fn fake_read(
++        &mut self,
++        _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>,
++        _: FakeReadCause,
++        _: HirId,
++    ) {
++    }
  }
  
  impl<'a, 'tcx> EscapeDelegate<'a, 'tcx> {
Simple merge
Simple merge
index d6d33bda173817713ce8941edd67d25813c619a7,09b97bacd6520ead0e8cf0f04ad38f5af0264d7e..977c8ee594f4ccc34b55573a420200a078c6206b
@@@ -47,7 -47,7 +47,8 @@@ pub(super) fn check_impl_item<'tcx>(cx
          let attr = cx.tcx.get_attr(item.def_id.to_def_id(), sym::must_use);
          if let Some(attr) = attr {
              check_needless_must_use(cx, sig.decl, item.hir_id(), item.span, fn_header_span, attr);
-         } else if is_public && !is_proc_macro(cx.sess(), attrs) && trait_ref_of_method(cx, item.def_id.def_id).is_none() {
 -        } else if is_public && !is_proc_macro(cx.sess(), attrs) && trait_ref_of_method(cx, item.def_id).is_none() {
++        } else if is_public && !is_proc_macro(cx.sess(), attrs) && trait_ref_of_method(cx, item.def_id.def_id).is_none()
++        {
              check_must_use_candidate(
                  cx,
                  sig.decl,
index a920c3bba2aedaee0c9de062ba9cb5041f6d1fd3,067af79152fd210b151a3059538869f2c0518c30..93efe957b1dc27bf2f9d7c43594f1408b2cf73a6
@@@ -5,6 -5,6 +5,7 @@@ use rustc_errors::Diagnostic
  use rustc_hir as hir;
  use rustc_hir::intravisit::{walk_body, walk_expr, walk_inf, walk_ty, Visitor};
  use rustc_hir::{Body, Expr, ExprKind, GenericArg, Item, ItemKind, QPath, TyKind};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass, LintContext};
  use rustc_middle::hir::nested_filter;
  use rustc_middle::lint::in_external_macro;
@@@ -12,7 -12,7 +13,6 @@@ use rustc_middle::ty::{Ty, TypeckResult
  use rustc_session::{declare_lint_pass, declare_tool_lint};
  use rustc_span::source_map::Span;
  use rustc_span::symbol::sym;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  use if_chain::if_chain;
  
index d6eb53ae29b5afdbee434cb6042f59aedce9f8cd,984c5cd4e37c26ff9ae249534651731f15d8928c..76c83ab47d09561a9caf4ec22e161db2ce04ee18
@@@ -2,12 -2,12 +2,12 @@@ use clippy_utils::diagnostics::span_lin
  use if_chain::if_chain;
  use rustc_errors::Applicability;
  use rustc_hir::{Item, ItemKind};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::ty::layout::LayoutOf;
  use rustc_middle::ty::{self, ConstKind};
  use rustc_session::{declare_tool_lint, impl_lint_pass};
  use rustc_span::{BytePos, Pos, Span};
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  declare_clippy_lint! {
      /// ### What it does
index 7d15dd4cb216488caf619bd3c3afcf625459645e,e94292b9fac03a5abaac2cc0f62bfbf82ec6e216..3a563736fb077b7ae51d3016ff63c9c0c4434182
@@@ -210,7 -210,7 +210,8 @@@ fn check_trait_items(cx: &LateContext<'
          }
      }
  
-     if cx.access_levels.is_exported(visited_trait.def_id.def_id) && trait_items.iter().any(|i| is_named_self(cx, i, sym::len))
 -    if cx.access_levels.is_exported(visited_trait.def_id) && trait_items.iter().any(|i| is_named_self(cx, i, sym::len))
++    if cx.access_levels.is_exported(visited_trait.def_id.def_id)
++        && trait_items.iter().any(|i| is_named_self(cx, i, sym::len))
      {
          let mut current_and_super_traits = DefIdSet::default();
          fill_trait_set(visited_trait.def_id.to_def_id(), &mut current_and_super_traits, cx);
Simple merge
index f1783dd9ddef214d37d6617826474ed2daff253d,34835e22896cfe53d5e1c2a93c0ec1e75d5a0b6b..87be0052028fb2bbb2ebb859714f4639fae23801
@@@ -30,8 -31,9 +31,10 @@@ store.register_group(true, "clippy::nur
      LintId::of(strings::STRING_LIT_AS_BYTES),
      LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS),
      LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY),
+     LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
+     LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),
      LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR),
 +    LintId::of(unused_peekable::UNUSED_PEEKABLE),
      LintId::of(unused_rounding::UNUSED_ROUNDING),
      LintId::of(use_self::USE_SELF),
  ])
index c3db194c4ad85cfbfdb6b39b0a4fd71707a37853,e5a87df51174992781650f20f7bff46daee588f1..fde8aa9f92173d69f960fd5bd65568a062b5b362
@@@ -31,6 -32,6 +31,7 @@@ extern crate rustc_data_structures
  extern crate rustc_driver;
  extern crate rustc_errors;
  extern crate rustc_hir;
++extern crate rustc_hir_analysis;
  extern crate rustc_hir_pretty;
  extern crate rustc_index;
  extern crate rustc_infer;
@@@ -43,7 -44,7 +44,6 @@@ extern crate rustc_session
  extern crate rustc_span;
  extern crate rustc_target;
  extern crate rustc_trait_selection;
- extern crate rustc_hir_analysis;
 -extern crate rustc_typeck;
  
  #[macro_use]
  extern crate clippy_utils;
@@@ -531,15 -530,15 +529,15 @@@ pub fn register_plugins(store: &mut rus
      {
          store.register_early_pass(|| Box::new(utils::internal_lints::ClippyLintsInternal));
          store.register_early_pass(|| Box::new(utils::internal_lints::ProduceIce));
 -        store.register_late_pass(|| Box::new(utils::internal_lints::CollapsibleCalls));
 -        store.register_late_pass(|| Box::new(utils::internal_lints::CompilerLintFunctions::new()));
 -        store.register_late_pass(|| Box::new(utils::internal_lints::IfChainStyle));
 -        store.register_late_pass(|| Box::new(utils::internal_lints::InvalidPaths));
 -        store.register_late_pass(|| Box::<utils::internal_lints::InterningDefinedSymbol>::default());
 -        store.register_late_pass(|| Box::<utils::internal_lints::LintWithoutLintPass>::default());
 -        store.register_late_pass(|| Box::new(utils::internal_lints::MatchTypeOnDiagItem));
 -        store.register_late_pass(|| Box::new(utils::internal_lints::OuterExpnDataPass));
 -        store.register_late_pass(|| Box::new(utils::internal_lints::MsrvAttrImpl));
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::CollapsibleCalls));
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::CompilerLintFunctions::new()));
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::IfChainStyle));
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::InvalidPaths));
-         store.register_late_pass(|_| Box::new(utils::internal_lints::InterningDefinedSymbol::default()));
-         store.register_late_pass(|_| Box::new(utils::internal_lints::LintWithoutLintPass::default()));
++        store.register_late_pass(|_| Box::<utils::internal_lints::InterningDefinedSymbol>::default());
++        store.register_late_pass(|_| Box::<utils::internal_lints::LintWithoutLintPass>::default());
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::MatchTypeOnDiagItem));
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::OuterExpnDataPass));
 +        store.register_late_pass(|_| Box::new(utils::internal_lints::MsrvAttrImpl));
      }
  
      let arithmetic_side_effects_allowed = conf.arithmetic_side_effects_allowed.clone();
              msrv,
          ))
      });
-     store.register_late_pass(|_| Box::new(shadow::Shadow::default()));
 -    store.register_late_pass(|| Box::<shadow::Shadow>::default());
 -    store.register_late_pass(|| Box::new(unit_types::UnitTypes));
 -    store.register_late_pass(|| Box::new(loops::Loops));
 -    store.register_late_pass(|| Box::<main_recursion::MainRecursion>::default());
 -    store.register_late_pass(|| Box::new(lifetimes::Lifetimes));
 -    store.register_late_pass(|| Box::new(entry::HashMapPass));
 -    store.register_late_pass(|| Box::new(minmax::MinMaxPass));
 -    store.register_late_pass(|| Box::new(zero_div_zero::ZeroDiv));
 -    store.register_late_pass(|| Box::new(mutex_atomic::Mutex));
 -    store.register_late_pass(|| Box::new(needless_update::NeedlessUpdate));
 -    store.register_late_pass(|| Box::new(needless_borrowed_ref::NeedlessBorrowedRef));
 -    store.register_late_pass(|| Box::new(borrow_deref_ref::BorrowDerefRef));
 -    store.register_late_pass(|| Box::new(no_effect::NoEffect));
 -    store.register_late_pass(|| Box::new(temporary_assignment::TemporaryAssignment));
 -    store.register_late_pass(move || Box::new(transmute::Transmute::new(msrv)));
++    store.register_late_pass(|_| Box::<shadow::Shadow>::default());
 +    store.register_late_pass(|_| Box::new(unit_types::UnitTypes));
 +    store.register_late_pass(|_| Box::new(loops::Loops));
-     store.register_late_pass(|_| Box::new(main_recursion::MainRecursion::default()));
++    store.register_late_pass(|_| Box::<main_recursion::MainRecursion>::default());
 +    store.register_late_pass(|_| Box::new(lifetimes::Lifetimes));
 +    store.register_late_pass(|_| Box::new(entry::HashMapPass));
 +    store.register_late_pass(|_| Box::new(minmax::MinMaxPass));
 +    store.register_late_pass(|_| Box::new(zero_div_zero::ZeroDiv));
 +    store.register_late_pass(|_| Box::new(mutex_atomic::Mutex));
 +    store.register_late_pass(|_| Box::new(needless_update::NeedlessUpdate));
 +    store.register_late_pass(|_| Box::new(needless_borrowed_ref::NeedlessBorrowedRef));
 +    store.register_late_pass(|_| Box::new(borrow_deref_ref::BorrowDerefRef));
 +    store.register_late_pass(|_| Box::new(no_effect::NoEffect));
 +    store.register_late_pass(|_| Box::new(temporary_assignment::TemporaryAssignment));
 +    store.register_late_pass(move |_| Box::new(transmute::Transmute::new(msrv)));
      let cognitive_complexity_threshold = conf.cognitive_complexity_threshold;
 -    store.register_late_pass(move || {
 +    store.register_late_pass(move |_| {
          Box::new(cognitive_complexity::CognitiveComplexity::new(
              cognitive_complexity_threshold,
          ))
      });
      let too_large_for_stack = conf.too_large_for_stack;
 -    store.register_late_pass(move || Box::new(escape::BoxedLocal { too_large_for_stack }));
 -    store.register_late_pass(move || Box::new(vec::UselessVec { too_large_for_stack }));
 -    store.register_late_pass(|| Box::new(panic_unimplemented::PanicUnimplemented));
 -    store.register_late_pass(|| Box::new(strings::StringLitAsBytes));
 -    store.register_late_pass(|| Box::new(derive::Derive));
 -    store.register_late_pass(|| Box::new(derivable_impls::DerivableImpls));
 -    store.register_late_pass(|| Box::new(drop_forget_ref::DropForgetRef));
 -    store.register_late_pass(|| Box::new(empty_enum::EmptyEnum));
 -    store.register_late_pass(|| Box::new(invalid_upcast_comparisons::InvalidUpcastComparisons));
 -    store.register_late_pass(|| Box::new(regex::Regex));
 -    store.register_late_pass(|| Box::new(copies::CopyAndPaste));
 -    store.register_late_pass(|| Box::new(copy_iterator::CopyIterator));
 -    store.register_late_pass(|| Box::new(format::UselessFormat));
 -    store.register_late_pass(|| Box::new(swap::Swap));
 -    store.register_late_pass(|| Box::new(overflow_check_conditional::OverflowCheckConditional));
 -    store.register_late_pass(|| Box::<new_without_default::NewWithoutDefault>::default());
 +    store.register_late_pass(move |_| Box::new(escape::BoxedLocal { too_large_for_stack }));
 +    store.register_late_pass(move |_| Box::new(vec::UselessVec { too_large_for_stack }));
 +    store.register_late_pass(|_| Box::new(panic_unimplemented::PanicUnimplemented));
 +    store.register_late_pass(|_| Box::new(strings::StringLitAsBytes));
 +    store.register_late_pass(|_| Box::new(derive::Derive));
 +    store.register_late_pass(|_| Box::new(derivable_impls::DerivableImpls));
 +    store.register_late_pass(|_| Box::new(drop_forget_ref::DropForgetRef));
 +    store.register_late_pass(|_| Box::new(empty_enum::EmptyEnum));
 +    store.register_late_pass(|_| Box::new(invalid_upcast_comparisons::InvalidUpcastComparisons));
 +    store.register_late_pass(|_| Box::new(regex::Regex));
 +    store.register_late_pass(|_| Box::new(copies::CopyAndPaste));
 +    store.register_late_pass(|_| Box::new(copy_iterator::CopyIterator));
 +    store.register_late_pass(|_| Box::new(format::UselessFormat));
 +    store.register_late_pass(|_| Box::new(swap::Swap));
 +    store.register_late_pass(|_| Box::new(overflow_check_conditional::OverflowCheckConditional));
-     store.register_late_pass(|_| Box::new(new_without_default::NewWithoutDefault::default()));
++    store.register_late_pass(|_| Box::<new_without_default::NewWithoutDefault>::default());
      let disallowed_names = conf.disallowed_names.iter().cloned().collect::<FxHashSet<_>>();
 -    store.register_late_pass(move || Box::new(disallowed_names::DisallowedNames::new(disallowed_names.clone())));
 +    store.register_late_pass(move |_| Box::new(disallowed_names::DisallowedNames::new(disallowed_names.clone())));
      let too_many_arguments_threshold = conf.too_many_arguments_threshold;
      let too_many_lines_threshold = conf.too_many_lines_threshold;
      let large_error_threshold = conf.large_error_threshold;
          conf.avoid_breaking_exported_api,
          &sess.target,
      );
 -    store.register_late_pass(move || Box::new(pass_by_ref_or_value));
 -    store.register_late_pass(|| Box::new(ref_option_ref::RefOptionRef));
 -    store.register_late_pass(|| Box::new(infinite_iter::InfiniteIter));
 -    store.register_late_pass(|| Box::new(inline_fn_without_body::InlineFnWithoutBody));
 -    store.register_late_pass(|| Box::<useless_conversion::UselessConversion>::default());
 -    store.register_late_pass(|| Box::new(implicit_hasher::ImplicitHasher));
 -    store.register_late_pass(|| Box::new(fallible_impl_from::FallibleImplFrom));
 -    store.register_late_pass(|| Box::new(question_mark::QuestionMark));
 +    store.register_late_pass(move |_| Box::new(pass_by_ref_or_value));
 +    store.register_late_pass(|_| Box::new(ref_option_ref::RefOptionRef));
 +    store.register_late_pass(|_| Box::new(infinite_iter::InfiniteIter));
 +    store.register_late_pass(|_| Box::new(inline_fn_without_body::InlineFnWithoutBody));
-     store.register_late_pass(|_| Box::new(useless_conversion::UselessConversion::default()));
++    store.register_late_pass(|_| Box::<useless_conversion::UselessConversion>::default());
 +    store.register_late_pass(|_| Box::new(implicit_hasher::ImplicitHasher));
 +    store.register_late_pass(|_| Box::new(fallible_impl_from::FallibleImplFrom));
 +    store.register_late_pass(|_| Box::new(question_mark::QuestionMark));
      store.register_early_pass(|| Box::new(suspicious_operation_groupings::SuspiciousOperationGroupings));
 -    store.register_late_pass(|| Box::new(suspicious_trait_impl::SuspiciousImpl));
 -    store.register_late_pass(|| Box::new(map_unit_fn::MapUnit));
 -    store.register_late_pass(|| Box::new(inherent_impl::MultipleInherentImpl));
 -    store.register_late_pass(|| Box::new(neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd));
 -    store.register_late_pass(|| Box::new(unwrap::Unwrap));
 -    store.register_late_pass(|| Box::new(indexing_slicing::IndexingSlicing));
 -    store.register_late_pass(|| Box::new(non_copy_const::NonCopyConst));
 -    store.register_late_pass(|| Box::new(ptr_offset_with_cast::PtrOffsetWithCast));
 -    store.register_late_pass(|| Box::new(redundant_clone::RedundantClone));
 -    store.register_late_pass(|| Box::new(slow_vector_initialization::SlowVectorInit));
 -    store.register_late_pass(move || Box::new(unnecessary_wraps::UnnecessaryWraps::new(avoid_breaking_exported_api)));
 -    store.register_late_pass(|| Box::new(assertions_on_constants::AssertionsOnConstants));
 -    store.register_late_pass(|| Box::new(assertions_on_result_states::AssertionsOnResultStates));
 -    store.register_late_pass(|| Box::new(inherent_to_string::InherentToString));
 +    store.register_late_pass(|_| Box::new(suspicious_trait_impl::SuspiciousImpl));
 +    store.register_late_pass(|_| Box::new(map_unit_fn::MapUnit));
 +    store.register_late_pass(|_| Box::new(inherent_impl::MultipleInherentImpl));
 +    store.register_late_pass(|_| Box::new(neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd));
 +    store.register_late_pass(|_| Box::new(unwrap::Unwrap));
 +    store.register_late_pass(|_| Box::new(indexing_slicing::IndexingSlicing));
 +    store.register_late_pass(|_| Box::new(non_copy_const::NonCopyConst));
 +    store.register_late_pass(|_| Box::new(ptr_offset_with_cast::PtrOffsetWithCast));
 +    store.register_late_pass(|_| Box::new(redundant_clone::RedundantClone));
 +    store.register_late_pass(|_| Box::new(slow_vector_initialization::SlowVectorInit));
 +    store.register_late_pass(move |_| Box::new(unnecessary_wraps::UnnecessaryWraps::new(avoid_breaking_exported_api)));
 +    store.register_late_pass(|_| Box::new(assertions_on_constants::AssertionsOnConstants));
 +    store.register_late_pass(|_| Box::new(assertions_on_result_states::AssertionsOnResultStates));
 +    store.register_late_pass(|_| Box::new(inherent_to_string::InherentToString));
      let max_trait_bounds = conf.max_trait_bounds;
 -    store.register_late_pass(move || Box::new(trait_bounds::TraitBounds::new(max_trait_bounds)));
 -    store.register_late_pass(|| Box::new(comparison_chain::ComparisonChain));
 -    store.register_late_pass(|| Box::new(mut_key::MutableKeyType));
 +    store.register_late_pass(move |_| Box::new(trait_bounds::TraitBounds::new(max_trait_bounds)));
 +    store.register_late_pass(|_| Box::new(comparison_chain::ComparisonChain));
 +    store.register_late_pass(|_| Box::new(mut_key::MutableKeyType));
      store.register_early_pass(|| Box::new(reference::DerefAddrOf));
      store.register_early_pass(|| Box::new(double_parens::DoubleParens));
 -    store.register_late_pass(|| Box::new(format_impl::FormatImpl::new()));
 +    store.register_late_pass(|_| Box::new(format_impl::FormatImpl::new()));
      store.register_early_pass(|| Box::new(unsafe_removed_from_name::UnsafeNameRemoval));
      store.register_early_pass(|| Box::new(else_if_without_else::ElseIfWithoutElse));
      store.register_early_pass(|| Box::new(int_plus_one::IntPlusOne));
              upper_case_acronyms_aggressive,
          ))
      });
-     store.register_late_pass(|_| Box::new(default::Default::default()));
 -    store.register_late_pass(|| Box::<default::Default>::default());
 -    store.register_late_pass(move || Box::new(unused_self::UnusedSelf::new(avoid_breaking_exported_api)));
 -    store.register_late_pass(|| Box::new(mutable_debug_assertion::DebugAssertWithMutCall));
 -    store.register_late_pass(|| Box::new(exit::Exit));
 -    store.register_late_pass(|| Box::new(to_digit_is_some::ToDigitIsSome));
++    store.register_late_pass(|_| Box::<default::Default>::default());
 +    store.register_late_pass(move |_| Box::new(unused_self::UnusedSelf::new(avoid_breaking_exported_api)));
 +    store.register_late_pass(|_| Box::new(mutable_debug_assertion::DebugAssertWithMutCall));
 +    store.register_late_pass(|_| Box::new(exit::Exit));
 +    store.register_late_pass(|_| Box::new(to_digit_is_some::ToDigitIsSome));
      let array_size_threshold = conf.array_size_threshold;
 -    store.register_late_pass(move || Box::new(large_stack_arrays::LargeStackArrays::new(array_size_threshold)));
 -    store.register_late_pass(move || Box::new(large_const_arrays::LargeConstArrays::new(array_size_threshold)));
 -    store.register_late_pass(|| Box::new(floating_point_arithmetic::FloatingPointArithmetic));
 +    store.register_late_pass(move |_| Box::new(large_stack_arrays::LargeStackArrays::new(array_size_threshold)));
 +    store.register_late_pass(move |_| Box::new(large_const_arrays::LargeConstArrays::new(array_size_threshold)));
 +    store.register_late_pass(|_| Box::new(floating_point_arithmetic::FloatingPointArithmetic));
      store.register_early_pass(|| Box::new(as_conversions::AsConversions));
 -    store.register_late_pass(|| Box::new(let_underscore::LetUnderscore));
 +    store.register_late_pass(|_| Box::new(let_underscore::LetUnderscore));
      store.register_early_pass(|| Box::new(single_component_path_imports::SingleComponentPathImports));
      let max_fn_params_bools = conf.max_fn_params_bools;
      let max_struct_bools = conf.max_struct_bools;
      });
      store.register_early_pass(|| Box::new(option_env_unwrap::OptionEnvUnwrap));
      let warn_on_all_wildcard_imports = conf.warn_on_all_wildcard_imports;
 -    store.register_late_pass(move || Box::new(wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports)));
 -    store.register_late_pass(|| Box::<redundant_pub_crate::RedundantPubCrate>::default());
 -    store.register_late_pass(|| Box::new(unnamed_address::UnnamedAddress));
 -    store.register_late_pass(move || Box::new(dereference::Dereferencing::new(msrv)));
 -    store.register_late_pass(|| Box::new(option_if_let_else::OptionIfLetElse));
 -    store.register_late_pass(|| Box::new(future_not_send::FutureNotSend));
 -    store.register_late_pass(|| Box::new(if_let_mutex::IfLetMutex));
 -    store.register_late_pass(|| Box::new(if_not_else::IfNotElse));
 -    store.register_late_pass(|| Box::new(equatable_if_let::PatternEquality));
 -    store.register_late_pass(|| Box::new(manual_async_fn::ManualAsyncFn));
 -    store.register_late_pass(|| Box::new(panic_in_result_fn::PanicInResultFn));
 +    store.register_late_pass(move |_| Box::new(wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports)));
-     store.register_late_pass(|_| Box::new(redundant_pub_crate::RedundantPubCrate::default()));
++    store.register_late_pass(|_| Box::<redundant_pub_crate::RedundantPubCrate>::default());
 +    store.register_late_pass(|_| Box::new(unnamed_address::UnnamedAddress));
 +    store.register_late_pass(move |_| Box::new(dereference::Dereferencing::new(msrv)));
 +    store.register_late_pass(|_| Box::new(option_if_let_else::OptionIfLetElse));
 +    store.register_late_pass(|_| Box::new(future_not_send::FutureNotSend));
 +    store.register_late_pass(|_| Box::new(if_let_mutex::IfLetMutex));
 +    store.register_late_pass(|_| Box::new(if_not_else::IfNotElse));
 +    store.register_late_pass(|_| Box::new(equatable_if_let::PatternEquality));
 +    store.register_late_pass(|_| Box::new(manual_async_fn::ManualAsyncFn));
 +    store.register_late_pass(|_| Box::new(panic_in_result_fn::PanicInResultFn));
      let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
      store.register_early_pass(move || {
          Box::new(non_expressive_names::NonExpressiveNames {
      });
      let macro_matcher = conf.standard_macro_braces.iter().cloned().collect::<FxHashSet<_>>();
      store.register_early_pass(move || Box::new(nonstandard_macro_braces::MacroBraces::new(&macro_matcher)));
-     store.register_late_pass(|_| Box::new(macro_use::MacroUseImports::default()));
 -    store.register_late_pass(|| Box::<macro_use::MacroUseImports>::default());
 -    store.register_late_pass(|| Box::new(pattern_type_mismatch::PatternTypeMismatch));
 -    store.register_late_pass(|| Box::new(unwrap_in_result::UnwrapInResult));
 -    store.register_late_pass(|| Box::new(semicolon_if_nothing_returned::SemicolonIfNothingReturned));
 -    store.register_late_pass(|| Box::new(async_yields_async::AsyncYieldsAsync));
++    store.register_late_pass(|_| Box::<macro_use::MacroUseImports>::default());
 +    store.register_late_pass(|_| Box::new(pattern_type_mismatch::PatternTypeMismatch));
 +    store.register_late_pass(|_| Box::new(unwrap_in_result::UnwrapInResult));
 +    store.register_late_pass(|_| Box::new(semicolon_if_nothing_returned::SemicolonIfNothingReturned));
 +    store.register_late_pass(|_| Box::new(async_yields_async::AsyncYieldsAsync));
      let disallowed_methods = conf.disallowed_methods.clone();
 -    store.register_late_pass(move || Box::new(disallowed_methods::DisallowedMethods::new(disallowed_methods.clone())));
 +    store.register_late_pass(move |_| Box::new(disallowed_methods::DisallowedMethods::new(disallowed_methods.clone())));
      store.register_early_pass(|| Box::new(asm_syntax::InlineAsmX86AttSyntax));
      store.register_early_pass(|| Box::new(asm_syntax::InlineAsmX86IntelSyntax));
 -    store.register_late_pass(|| Box::new(empty_drop::EmptyDrop));
 -    store.register_late_pass(|| Box::new(strings::StrToString));
 -    store.register_late_pass(|| Box::new(strings::StringToString));
 -    store.register_late_pass(|| Box::new(zero_sized_map_values::ZeroSizedMapValues));
 -    store.register_late_pass(|| Box::<vec_init_then_push::VecInitThenPush>::default());
 -    store.register_late_pass(|| Box::new(redundant_slicing::RedundantSlicing));
 -    store.register_late_pass(|| Box::new(from_str_radix_10::FromStrRadix10));
 -    store.register_late_pass(move || Box::new(if_then_some_else_none::IfThenSomeElseNone::new(msrv)));
 -    store.register_late_pass(|| Box::new(bool_assert_comparison::BoolAssertComparison));
 +    store.register_late_pass(|_| Box::new(empty_drop::EmptyDrop));
 +    store.register_late_pass(|_| Box::new(strings::StrToString));
 +    store.register_late_pass(|_| Box::new(strings::StringToString));
 +    store.register_late_pass(|_| Box::new(zero_sized_map_values::ZeroSizedMapValues));
-     store.register_late_pass(|_| Box::new(vec_init_then_push::VecInitThenPush::default()));
++    store.register_late_pass(|_| Box::<vec_init_then_push::VecInitThenPush>::default());
 +    store.register_late_pass(|_| Box::new(redundant_slicing::RedundantSlicing));
 +    store.register_late_pass(|_| Box::new(from_str_radix_10::FromStrRadix10));
 +    store.register_late_pass(move |_| Box::new(if_then_some_else_none::IfThenSomeElseNone::new(msrv)));
 +    store.register_late_pass(|_| Box::new(bool_assert_comparison::BoolAssertComparison));
      store.register_early_pass(move || Box::new(module_style::ModStyle));
 -    store.register_late_pass(|| Box::new(unused_async::UnusedAsync));
 +    store.register_late_pass(|_| Box::new(unused_async::UnusedAsync));
      let disallowed_types = conf.disallowed_types.clone();
 -    store.register_late_pass(move || Box::new(disallowed_types::DisallowedTypes::new(disallowed_types.clone())));
 +    store.register_late_pass(move |_| Box::new(disallowed_types::DisallowedTypes::new(disallowed_types.clone())));
      let import_renames = conf.enforced_import_renames.clone();
 -    store.register_late_pass(move || {
 +    store.register_late_pass(move |_| {
          Box::new(missing_enforced_import_rename::ImportRename::new(
              import_renames.clone(),
          ))
              enable_raw_pointer_heuristic_for_send,
          ))
      });
 -    store.register_late_pass(move || Box::new(undocumented_unsafe_blocks::UndocumentedUnsafeBlocks));
 -    store.register_late_pass(move || Box::new(format_args::FormatArgs::new(msrv)));
 -    store.register_late_pass(|| Box::new(trailing_empty_array::TrailingEmptyArray));
 +    store.register_late_pass(move |_| Box::new(undocumented_unsafe_blocks::UndocumentedUnsafeBlocks));
-     store.register_late_pass(move |_| Box::new(format_args::FormatArgs));
++    store.register_late_pass(move |_| Box::new(format_args::FormatArgs::new(msrv)));
 +    store.register_late_pass(|_| Box::new(trailing_empty_array::TrailingEmptyArray));
      store.register_early_pass(|| Box::new(octal_escapes::OctalEscapes));
 -    store.register_late_pass(|| Box::new(needless_late_init::NeedlessLateInit));
 -    store.register_late_pass(|| Box::new(return_self_not_must_use::ReturnSelfNotMustUse));
 -    store.register_late_pass(|| Box::new(init_numbered_fields::NumberedFields));
 +    store.register_late_pass(|_| Box::new(needless_late_init::NeedlessLateInit));
 +    store.register_late_pass(|_| Box::new(return_self_not_must_use::ReturnSelfNotMustUse));
 +    store.register_late_pass(|_| Box::new(init_numbered_fields::NumberedFields));
      store.register_early_pass(|| Box::new(single_char_lifetime_names::SingleCharLifetimeNames));
 -    store.register_late_pass(move || Box::new(manual_bits::ManualBits::new(msrv)));
 -    store.register_late_pass(|| Box::new(default_union_representation::DefaultUnionRepresentation));
 +    store.register_late_pass(move |_| Box::new(manual_bits::ManualBits::new(msrv)));
 +    store.register_late_pass(|_| Box::new(default_union_representation::DefaultUnionRepresentation));
      store.register_early_pass(|| Box::new(doc_link_with_quotes::DocLinkWithQuotes));
-     store.register_late_pass(|_| Box::new(only_used_in_recursion::OnlyUsedInRecursion::default()));
 -    store.register_late_pass(|| Box::<only_used_in_recursion::OnlyUsedInRecursion>::default());
++    store.register_late_pass(|_| Box::<only_used_in_recursion::OnlyUsedInRecursion>::default());
      let allow_dbg_in_tests = conf.allow_dbg_in_tests;
 -    store.register_late_pass(move || Box::new(dbg_macro::DbgMacro::new(allow_dbg_in_tests)));
 +    store.register_late_pass(move |_| Box::new(dbg_macro::DbgMacro::new(allow_dbg_in_tests)));
      let cargo_ignore_publish = conf.cargo_ignore_publish;
 -    store.register_late_pass(move || {
 +    store.register_late_pass(move |_| {
          Box::new(cargo::Cargo {
              ignore_publish: cargo_ignore_publish,
          })
      });
-     store.register_late_pass(|_| Box::new(write::Write::default()));
 -    store.register_late_pass(|| Box::<write::Write>::default());
++    store.register_late_pass(|_| Box::<write::Write>::default());
      store.register_early_pass(|| Box::new(crate_in_macro_def::CrateInMacroDef));
      store.register_early_pass(|| Box::new(empty_structs_with_brackets::EmptyStructsWithBrackets));
 -    store.register_late_pass(|| Box::new(unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings));
 +    store.register_late_pass(|_| Box::new(unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings));
      store.register_early_pass(|| Box::new(pub_use::PubUse));
 -    store.register_late_pass(|| Box::new(format_push_string::FormatPushString));
 +    store.register_late_pass(|_| Box::new(format_push_string::FormatPushString));
      let max_include_file_size = conf.max_include_file_size;
 -    store.register_late_pass(move || Box::new(large_include_file::LargeIncludeFile::new(max_include_file_size)));
 -    store.register_late_pass(|| Box::new(strings::TrimSplitWhitespace));
 -    store.register_late_pass(|| Box::new(rc_clone_in_vec_init::RcCloneInVecInit));
 +    store.register_late_pass(move |_| Box::new(large_include_file::LargeIncludeFile::new(max_include_file_size)));
 +    store.register_late_pass(|_| Box::new(strings::TrimSplitWhitespace));
 +    store.register_late_pass(|_| Box::new(rc_clone_in_vec_init::RcCloneInVecInit));
-     store.register_early_pass(|| Box::new(duplicate_mod::DuplicateMod::default()));
+     store.register_early_pass(|| Box::<duplicate_mod::DuplicateMod>::default());
      store.register_early_pass(|| Box::new(unused_rounding::UnusedRounding));
      store.register_early_pass(move || Box::new(almost_complete_letter_range::AlmostCompleteLetterRange::new(msrv)));
 -    store.register_late_pass(|| Box::new(swap_ptr_to_ref::SwapPtrToRef));
 -    store.register_late_pass(|| Box::new(mismatching_type_param_order::TypeParamMismatch));
 -    store.register_late_pass(|| Box::new(read_zero_byte_vec::ReadZeroByteVec));
 -    store.register_late_pass(|| Box::new(default_instead_of_iter_empty::DefaultIterEmpty));
 -    store.register_late_pass(move || Box::new(manual_rem_euclid::ManualRemEuclid::new(msrv)));
 -    store.register_late_pass(move || Box::new(manual_retain::ManualRetain::new(msrv)));
 +    store.register_late_pass(|_| Box::new(swap_ptr_to_ref::SwapPtrToRef));
 +    store.register_late_pass(|_| Box::new(mismatching_type_param_order::TypeParamMismatch));
 +    store.register_late_pass(|_| Box::new(read_zero_byte_vec::ReadZeroByteVec));
 +    store.register_late_pass(|_| Box::new(default_instead_of_iter_empty::DefaultIterEmpty));
 +    store.register_late_pass(move |_| Box::new(manual_rem_euclid::ManualRemEuclid::new(msrv)));
 +    store.register_late_pass(move |_| Box::new(manual_retain::ManualRetain::new(msrv)));
      let verbose_bit_mask_threshold = conf.verbose_bit_mask_threshold;
 -    store.register_late_pass(move || Box::new(operators::Operators::new(verbose_bit_mask_threshold)));
 -    store.register_late_pass(|| Box::new(invalid_utf8_in_unchecked::InvalidUtf8InUnchecked));
 -    store.register_late_pass(|| Box::<std_instead_of_core::StdReexports>::default());
 -    store.register_late_pass(|| Box::new(manual_instant_elapsed::ManualInstantElapsed));
 -    store.register_late_pass(|| Box::new(partialeq_to_none::PartialeqToNone));
 -    store.register_late_pass(|| Box::new(manual_string_new::ManualStringNew));
 -    store.register_late_pass(|| Box::new(unused_peekable::UnusedPeekable));
 +    store.register_late_pass(move |_| Box::new(operators::Operators::new(verbose_bit_mask_threshold)));
 +    store.register_late_pass(|_| Box::new(invalid_utf8_in_unchecked::InvalidUtf8InUnchecked));
-     store.register_late_pass(|_| Box::new(std_instead_of_core::StdReexports::default()));
++    store.register_late_pass(|_| Box::<std_instead_of_core::StdReexports>::default());
 +    store.register_late_pass(|_| Box::new(manual_instant_elapsed::ManualInstantElapsed));
 +    store.register_late_pass(|_| Box::new(partialeq_to_none::PartialeqToNone));
 +    store.register_late_pass(|_| Box::new(manual_string_new::ManualStringNew));
 +    store.register_late_pass(|_| Box::new(unused_peekable::UnusedPeekable));
      store.register_early_pass(|| Box::new(multi_assignments::MultiAssignments));
 -    store.register_late_pass(|| Box::new(bool_to_int_with_if::BoolToIntWithIf));
 -    store.register_late_pass(|| Box::new(box_default::BoxDefault));
 +    store.register_late_pass(|_| Box::new(bool_to_int_with_if::BoolToIntWithIf));
++    store.register_late_pass(|_| Box::new(box_default::BoxDefault));
      // add lints here, do not remove this comment, it's used in `new_lint`
  }
  
index 399a03187d9937083403655ffd51b7e8b1077e64,d9cf92a9d5ba1115f6cac46a8bfa680c44e17886..aef253303a8f490c913afb282d710d0967bd4b3e
@@@ -9,8 -9,8 +9,8 @@@ use rustc_hir::intravisit::
  use rustc_hir::FnRetTy::Return;
  use rustc_hir::{
      BareFnTy, BodyId, FnDecl, GenericArg, GenericBound, GenericParam, GenericParamKind, Generics, Impl, ImplItem,
--    ImplItemKind, Item, ItemKind, LangItem, Lifetime, LifetimeName, ParamName, PolyTraitRef, PredicateOrigin,
-     TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
 -    TraitBoundModifier, TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
++    ImplItemKind, Item, ItemKind, LangItem, Lifetime, LifetimeName, ParamName, PolyTraitRef, PredicateOrigin, TraitFn,
++    TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
  };
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::hir::nested_filter as middle_nested_filter;
index 6d585c2e45de6ba52d213a8330ef61dbbe4f2d2b,fce2d54639cbf22af7ae546a0153ec48793b7978..0ee42b61c9a509f7197c4d6f2d63a7b2d41e4a34
@@@ -4,11 -4,11 +4,11 @@@ use clippy_utils::{get_enclosing_block
  use if_chain::if_chain;
  use rustc_hir::intravisit::{self, Visitor};
  use rustc_hir::{BindingAnnotation, Expr, ExprKind, HirId, Node, PatKind};
++use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::LateContext;
  use rustc_middle::{mir::FakeReadCause, ty};
  use rustc_span::source_map::Span;
- use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
 -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  
  pub(super) fn check(cx: &LateContext<'_>, arg: &Expr<'_>, body: &Expr<'_>) {
      if_chain! {
@@@ -114,7 -114,7 +114,13 @@@ impl<'tcx> Delegate<'tcx> for MutatePai
          }
      }
  
-     fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
 -    fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
++    fn fake_read(
++        &mut self,
++        _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>,
++        _: FakeReadCause,
++        _: HirId,
++    ) {
++    }
  }
  
  impl MutatePairDelegate<'_, '_> {
index f1f58db80b306e52537cde492ce943ba131a02f9,b332e8a923ba7b647e89f8d323a79111ed1f0746..b6f4cf7bbb37f149eccda55bbc0ef40b2f08def9
@@@ -5,12 -5,12 +5,12 @@@ use rustc_ast::ast::{LitIntType, LitKin
  use rustc_errors::Applicability;
  use rustc_hir::intravisit::{walk_expr, walk_local, walk_pat, walk_stmt, Visitor};
  use rustc_hir::{BinOpKind, BorrowKind, Expr, ExprKind, HirId, HirIdMap, Local, Mutability, Pat, PatKind, Stmt};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::LateContext;
  use rustc_middle::hir::nested_filter;
  use rustc_middle::ty::{self, Ty};
  use rustc_span::source_map::Spanned;
  use rustc_span::symbol::{sym, Symbol};
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  use std::iter::Iterator;
  
  #[derive(Debug, PartialEq, Eq)]
Simple merge
index 58ea43e69d9b1fa2f6ddbd3674d673b4735e5a85,634eef82e532ae50304b9f1dd76316ee0acc6748..9cbffbe61f15243ec917430e446f7bba10325a5c
@@@ -9,9 -9,9 +9,9 @@@ use clippy_utils::
  use rustc_errors::Applicability;
  use rustc_hir::LangItem::OptionNone;
  use rustc_hir::{Arm, BindingAnnotation, ByRef, Expr, ExprKind, FnRetTy, Guard, Node, Pat, PatKind, Path, QPath};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::LateContext;
  use rustc_span::sym;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  pub(crate) fn check_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr: &Expr<'_>) {
      if arms.len() > 1 && expr_ty_matches_p_ty(cx, ex, expr) && check_all_arms(cx, ex, arms) {
index c89784065b8be775d4ba7fc6fd967dc0b77d9f2d,343b1d058b44eca72578d9d1e09e11eeb860d70c..11495cca97ddce8f083e1e734a270d105d2cc286
@@@ -8,7 -8,7 +8,7 @@@ use clippy_utils::{higher, is_lang_ctor
  use if_chain::if_chain;
  use rustc_ast::ast::LitKind;
  use rustc_errors::Applicability;
- use rustc_hir::LangItem::{self, OptionSome, OptionNone, PollPending, PollReady, ResultOk, ResultErr};
 -use rustc_hir::LangItem::{OptionNone, PollPending};
++use rustc_hir::LangItem::{self, OptionNone, OptionSome, PollPending, PollReady, ResultErr, ResultOk};
  use rustc_hir::{Arm, Expr, ExprKind, Node, Pat, PatKind, QPath, UnOp};
  use rustc_lint::LateContext;
  use rustc_middle::ty::{self, subst::GenericArgKind, DefIdTree, Ty};
@@@ -267,36 -266,6 +266,37 @@@ pub(super) fn check_match<'tcx>(cx: &La
      }
  }
  
-   Lang(LangItem),
-   Diag(Symbol, Symbol),
 +#[derive(Clone, Copy)]
 +enum Item {
-                 let variant = ty.ty_adt_def()
++    Lang(LangItem),
++    Diag(Symbol, Symbol),
 +}
 +
 +fn is_pat_variant(cx: &LateContext<'_>, pat: &Pat<'_>, path: &QPath<'_>, expected_item: Item) -> bool {
 +    let Some(id) = cx.typeck_results().qpath_res(path, pat.hir_id).opt_def_id() else { return false };
 +
 +    match expected_item {
 +        Item::Lang(expected_lang_item) => {
 +            let expected_id = cx.tcx.lang_items().require(expected_lang_item).unwrap();
 +            cx.tcx.parent(id) == expected_id
 +        },
 +        Item::Diag(expected_ty, expected_variant) => {
 +            let ty = cx.typeck_results().pat_ty(pat);
 +
 +            if is_type_diagnostic_item(cx, ty, expected_ty) {
-                 return variant.name == expected_variant
++                let variant = ty
++                    .ty_adt_def()
 +                    .expect("struct pattern type is not an ADT")
 +                    .variant_of_res(cx.qpath_res(path, pat.hir_id));
 +
-         }
++                return variant.name == expected_variant;
 +            }
 +
 +            false
++        },
 +    }
 +}
 +
  #[expect(clippy::too_many_arguments)]
  fn find_good_method_for_match<'a>(
      cx: &LateContext<'_>,
      should_be_left: &'a str,
      should_be_right: &'a str,
  ) -> Option<&'a str> {
 -    let left_id = cx
 -        .typeck_results()
 -        .qpath_res(path_left, arms[0].pat.hir_id)
 -        .opt_def_id()?;
 -    let right_id = cx
 -        .typeck_results()
 -        .qpath_res(path_right, arms[1].pat.hir_id)
 -        .opt_def_id()?;
 -    let body_node_pair = if match_def_path(cx, left_id, expected_left) && match_def_path(cx, right_id, expected_right) {
 +    let pat_left = arms[0].pat;
 +    let pat_right = arms[1].pat;
 +
-     let body_node_pair = if (
-         is_pat_variant(cx, pat_left, path_left, expected_item_left)
-     ) && (
-         is_pat_variant(cx, pat_right, path_right, expected_item_right)
-     ) {
++    let body_node_pair = if (is_pat_variant(cx, pat_left, path_left, expected_item_left))
++        && (is_pat_variant(cx, pat_right, path_right, expected_item_right))
++    {
          (&arms[0].body.kind, &arms[1].body.kind)
-     } else if (
-         is_pat_variant(cx, pat_left, path_left, expected_item_right)
-     ) && (
-         is_pat_variant(cx, pat_right, path_right, expected_item_left)
-     ) {
 -    } else if match_def_path(cx, right_id, expected_left) && match_def_path(cx, right_id, expected_right) {
++    } else if (is_pat_variant(cx, pat_left, path_left, expected_item_right))
++        && (is_pat_variant(cx, pat_right, path_right, expected_item_left))
++    {
          (&arms[1].body.kind, &arms[0].body.kind)
      } else {
          return None;
index 428a354ec6b1ea4f2651423d299310d63ed7dd57,c43f822e3a386fdc1185bb3ccb2dab5b6b06e8fc..cfcf9596c50d3f32638475a2f06277916257195e
@@@ -109,13 -109,13 +109,13 @@@ use if_chain::if_chain
  use rustc_hir as hir;
  use rustc_hir::def::Res;
  use rustc_hir::{Expr, ExprKind, PrimTy, QPath, TraitItem, TraitItemKind};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass, LintContext};
  use rustc_middle::lint::in_external_macro;
  use rustc_middle::ty::{self, TraitRef, Ty};
  use rustc_semver::RustcVersion;
  use rustc_session::{declare_tool_lint, impl_lint_pass};
  use rustc_span::{sym, Span};
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  declare_clippy_lint! {
      /// ### What it does
@@@ -3255,53 -3255,48 +3255,48 @@@ impl<'tcx> LateLintPass<'tcx> for Metho
          let self_ty = cx.tcx.type_of(item.def_id);
  
          let implements_trait = matches!(item.kind, hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }));
-         if_chain! {
-             if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind;
-             if let Some(first_arg) = iter_input_pats(sig.decl, cx.tcx.hir().body(id)).next();
-             let method_sig = cx.tcx.fn_sig(impl_item.def_id.def_id);
+         if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind {
+             let method_sig = cx.tcx.fn_sig(impl_item.def_id);
              let method_sig = cx.tcx.erase_late_bound_regions(method_sig);
-             let first_arg_ty = method_sig.inputs().iter().next();
-             // check conventions w.r.t. conversion method names and predicates
-             if let Some(first_arg_ty) = first_arg_ty;
-             then {
-                 // if this impl block implements a trait, lint in trait definition instead
-                 if !implements_trait && cx.access_levels.is_exported(impl_item.def_id.def_id) {
-                     // check missing trait implementations
-                     for method_config in &TRAIT_METHODS {
-                         if name == method_config.method_name &&
-                             sig.decl.inputs.len() == method_config.param_count &&
-                             method_config.output_type.matches(&sig.decl.output) &&
-                             method_config.self_kind.matches(cx, self_ty, *first_arg_ty) &&
-                             fn_header_equals(method_config.fn_header, sig.header) &&
-                             method_config.lifetime_param_cond(impl_item)
-                         {
-                             span_lint_and_help(
-                                 cx,
-                                 SHOULD_IMPLEMENT_TRAIT,
-                                 impl_item.span,
-                                 &format!(
-                                     "method `{}` can be confused for the standard trait method `{}::{}`",
-                                     method_config.method_name,
-                                     method_config.trait_name,
-                                     method_config.method_name
-                                 ),
-                                 None,
-                                 &format!(
-                                     "consider implementing the trait `{}` or choosing a less ambiguous method name",
-                                     method_config.trait_name
-                                 )
-                             );
-                         }
+             let first_arg_ty_opt = method_sig.inputs().iter().next().copied();
+             // if this impl block implements a trait, lint in trait definition instead
 -            if !implements_trait && cx.access_levels.is_exported(impl_item.def_id) {
++            if !implements_trait && cx.access_levels.is_exported(impl_item.def_id.def_id) {
+                 // check missing trait implementations
+                 for method_config in &TRAIT_METHODS {
+                     if name == method_config.method_name
+                         && sig.decl.inputs.len() == method_config.param_count
+                         && method_config.output_type.matches(&sig.decl.output)
+                         // in case there is no first arg, since we already have checked the number of arguments
+                         // it's should be always true
+                         && first_arg_ty_opt.map_or(true, |first_arg_ty| method_config
+                             .self_kind.matches(cx, self_ty, first_arg_ty)
+                             )
+                         && fn_header_equals(method_config.fn_header, sig.header)
+                         && method_config.lifetime_param_cond(impl_item)
+                     {
+                         span_lint_and_help(
+                             cx,
+                             SHOULD_IMPLEMENT_TRAIT,
+                             impl_item.span,
+                             &format!(
+                                 "method `{}` can be confused for the standard trait method `{}::{}`",
+                                 method_config.method_name, method_config.trait_name, method_config.method_name
+                             ),
+                             None,
+                             &format!(
+                                 "consider implementing the trait `{}` or choosing a less ambiguous method name",
+                                 method_config.trait_name
+                             ),
+                         );
                      }
                  }
+             }
  
-                 if sig.decl.implicit_self.has_implicit_self()
+             if sig.decl.implicit_self.has_implicit_self()
                      && !(self.avoid_breaking_exported_api
-                         && cx.access_levels.is_exported(impl_item.def_id.def_id))
 -                    && cx.access_levels.is_exported(impl_item.def_id))
++                    && cx.access_levels.is_exported(impl_item.def_id.def_id))
+                     && let Some(first_arg) = iter_input_pats(sig.decl, cx.tcx.hir().body(id)).next()
+                     && let Some(first_arg_ty) = first_arg_ty_opt
                  {
                      wrong_self_convention::check(
                          cx,
index 559f32a563ed90f0b77355f686d2c636a5db86ab,d27831327acf84cd4504a870e2deae2d81647001..9ab0d614114699400375b7073a5dde46c326327c
@@@ -8,6 -9,6 +8,7 @@@ use clippy_utils::{fn_def_id, get_paren
  use clippy_utils::{meets_msrv, msrvs};
  use rustc_errors::Applicability;
  use rustc_hir::{def_id::DefId, BorrowKind, Expr, ExprKind, ItemKind, LangItem, Node};
++use rustc_hir_analysis::check::{FnCtxt, Inherited};
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::LateContext;
  use rustc_middle::mir::Mutability;
@@@ -18,7 -19,7 +19,6 @@@ use rustc_middle::ty::{self, ParamTy, P
  use rustc_semver::RustcVersion;
  use rustc_span::{sym, Symbol};
  use rustc_trait_selection::traits::{query::evaluate_obligation::InferCtxtExt as _, Obligation, ObligationCause};
- use rustc_hir_analysis::check::{FnCtxt, Inherited};
 -use rustc_typeck::check::{FnCtxt, Inherited};
  use std::cmp::max;
  
  use super::UNNECESSARY_TO_OWNED;
index 00376f0d79022396d63edfa9890ab913da680474,bc304c081b9062ec2f121665a81db06a6a20d48b..71cc0d0a81cd2dd8bc909dd8780c79f857b919a0
@@@ -8,12 -8,12 +8,12 @@@ use rustc_hir as hir
  use rustc_hir::def_id::CRATE_DEF_ID;
  use rustc_hir::intravisit::FnKind;
  use rustc_hir::{Body, Constness, FnDecl, GenericParamKind, HirId};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::lint::in_external_macro;
  use rustc_semver::RustcVersion;
  use rustc_session::{declare_tool_lint, impl_lint_pass};
  use rustc_span::Span;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  declare_clippy_lint! {
      /// ### What it does
Simple merge
Simple merge
Simple merge
index 4f46872439c3c5d867d8e98787bd31849c881b45,924d4f91970e648109a51ef271115d416ecd895f..178c973981b1b5da2f4e15e198cad7c9c6c1f075
@@@ -12,6 -12,6 +12,7 @@@ use rustc_hir::
      BindingAnnotation, Body, FnDecl, GenericArg, HirId, Impl, ItemKind, Mutability, Node, PatKind, QPath, TyKind,
  };
  use rustc_hir::{HirIdMap, HirIdSet};
++use rustc_hir_analysis::expr_use_visitor as euv;
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::mir::FakeReadCause;
@@@ -22,7 -22,7 +23,6 @@@ use rustc_span::{sym, Span, DUMMY_SP}
  use rustc_target::spec::abi::Abi;
  use rustc_trait_selection::traits;
  use rustc_trait_selection::traits::misc::can_type_implement_copy;
- use rustc_hir_analysis::expr_use_visitor as euv;
 -use rustc_typeck::expr_use_visitor as euv;
  use std::borrow::Cow;
  
  declare_clippy_lint! {
@@@ -341,5 -342,5 +342,11 @@@ impl<'tcx> euv::Delegate<'tcx> for Move
  
      fn mutate(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId) {}
  
-     fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
 -    fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
++    fn fake_read(
++        &mut self,
++        _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>,
++        _: FakeReadCause,
++        _: HirId,
++    ) {
++    }
  }
index 48ff737dae7bc764e354b8019bceb3cba97d26c8,ea76ce2c57357c7183e70cdfb97042674c5e0e1b..2c839d029c6f7a5bd482145e1cc5257af862e76b
@@@ -13,6 -13,6 +13,7 @@@ use rustc_hir::def_id::DefId
  use rustc_hir::{
      BodyId, Expr, ExprKind, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Node, TraitItem, TraitItemKind, UnOp,
  };
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass, Lint};
  use rustc_middle::mir;
  use rustc_middle::mir::interpret::{ConstValue, ErrorHandled};
@@@ -20,7 -20,7 +21,6 @@@ use rustc_middle::ty::adjustment::Adjus
  use rustc_middle::ty::{self, Ty};
  use rustc_session::{declare_lint_pass, declare_tool_lint};
  use rustc_span::{sym, InnerSpan, Span, DUMMY_SP};
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  // FIXME: this is a correctness problem but there's no suitable
  // warn-by-default category.
index f134c6c4cdba5c884b918e5446f0b532579a1e4f,cb5abfb809e2353fb48522d8537d17fee333b76a..2d5d5d143ffaff88d452ecd05cb79c9571dae343
@@@ -7,11 -7,11 +7,11 @@@ use if_chain::if_chain
  use rustc_errors::Applicability;
  use rustc_hir as hir;
  use rustc_hir::intravisit::{walk_expr, Visitor};
++use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  use rustc_lint::LateContext;
  use rustc_middle::mir::FakeReadCause;
  use rustc_middle::ty::BorrowKind;
  use rustc_trait_selection::infer::TyCtxtInferExt;
- use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
 -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  
  use super::ASSIGN_OP_PATTERN;
  
Simple merge
index fdf847bf44593514cfc701881d56bcc2bfecdd4f,74927570b40ebe579ec00b3df789f8a7d5820e1f..b567d92230bb1cbe4085a444dbb6843b7b7a81bc
@@@ -1,8 -1,8 +1,11 @@@
  use rustc_hir::Expr;
++use rustc_hir_analysis::check::{
++    cast::{self, CastCheckResult},
++    FnCtxt, Inherited,
++};
  use rustc_lint::LateContext;
  use rustc_middle::ty::{cast::CastKind, Ty};
  use rustc_span::DUMMY_SP;
- use rustc_hir_analysis::check::{cast::{self, CastCheckResult}, FnCtxt, Inherited};
 -use rustc_typeck::check::{cast::CastCheck, FnCtxt, Inherited};
  
  // check if the component types of the transmuted collection and the result have different ABI,
  // size or alignment
index aca55817c52503bb102ff69c7ad0b78e66c5e2cb,353a6f6b899ea3e743ed57982b8acd130d185e14..b81d2c1cbc484b30131e14c02d85954c827effe5
@@@ -352,8 -352,8 +352,10 @@@ impl<'tcx> LateLintPass<'tcx> for Type
      fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) {
          match item.kind {
              ImplItemKind::Const(ty, _) => {
--                let is_in_trait_impl = if let Some(hir::Node::Item(item)) =
-                     cx.tcx.hir().find_by_def_id(cx.tcx.hir().get_parent_item(item.hir_id()).def_id)
 -                    cx.tcx.hir().find_by_def_id(cx.tcx.hir().get_parent_item(item.hir_id()))
++                let is_in_trait_impl = if let Some(hir::Node::Item(item)) = cx
++                    .tcx
++                    .hir()
++                    .find_by_def_id(cx.tcx.hir().get_parent_item(item.hir_id()).def_id)
                  {
                      matches!(item.kind, ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }))
                  } else {
index d81c5c83845d852f759d6ef551eb9f6c9551f22a,b95f0213e0cdb65ae661b78da976149be6f3bad6..ecb67200539089276fd008fabd402e02c335ae2b
@@@ -3,9 -3,9 +3,9 @@@ use clippy_utils::source::{snippet, sni
  use clippy_utils::{path_def_id, qpath_generic_tys};
  use rustc_errors::Applicability;
  use rustc_hir::{self as hir, def_id::DefId, QPath, TyKind};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::LateContext;
  use rustc_span::symbol::sym;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  use super::{utils, REDUNDANT_ALLOCATION};
  
index 236f9955722d02726eb04e82050c0d550772deda,b2f536ca7815b7e155f4dfc5a4052dceebdb97ce..6c329d8cdf196a9b4311f6c242b0fc5a1c153372
@@@ -4,11 -4,11 +4,11 @@@ use clippy_utils::source::snippet
  use if_chain::if_chain;
  use rustc_errors::Applicability;
  use rustc_hir::{self as hir, def_id::DefId, GenericArg, QPath, TyKind};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::LateContext;
  use rustc_middle::ty::layout::LayoutOf;
  use rustc_middle::ty::TypeVisitable;
  use rustc_span::symbol::sym;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  use super::VEC_BOX;
  
Simple merge
index 6a767967ef4093068e2b2f12d39590676765cd51,44ab9bca79596bd8763d52e5c6d9fd3fbad9d7af..fadf49990acda7c4c7746263c00a38997da6168a
@@@ -12,11 -12,11 +12,11 @@@ use rustc_hir::
      Expr, ExprKind, FnRetTy, FnSig, GenericArg, HirId, Impl, ImplItemKind, Item, ItemKind, Pat, PatKind, Path, QPath,
      TyKind,
  };
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_semver::RustcVersion;
  use rustc_session::{declare_tool_lint, impl_lint_pass};
  use rustc_span::Span;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  declare_clippy_lint! {
      /// ### What it does
Simple merge
index 78c036186f506d7cc7a5fbb6d8415564f22a64b4,5332779c1c051984319292324981d99eb555fc11..bc3f920a087aeeeb8b096fc1f48a1557903b5522
@@@ -23,6 -23,6 +23,7 @@@ use rustc_hir::
      BinOpKind, Block, Closure, Expr, ExprKind, HirId, Item, Local, MutTy, Mutability, Node, Path, Stmt, StmtKind, Ty,
      TyKind, UnOp,
  };
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};
  use rustc_middle::hir::nested_filter;
  use rustc_middle::mir::interpret::ConstValue;
@@@ -32,7 -32,7 +33,6 @@@ use rustc_session::{declare_lint_pass, 
  use rustc_span::source_map::Spanned;
  use rustc_span::symbol::Symbol;
  use rustc_span::{sym, BytePos, Span};
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  use std::borrow::{Borrow, Cow};
  
Simple merge
index 703ba2ef4b054d106ec3d6810e8964659cbd0d47,8dc43c0e29436d369b05d50d0880da07477352b3..6cf2a955fd5c638b4eba415bbc29e6a629d51cf0
@@@ -2,12 -2,12 +2,12 @@@ use clippy_utils::diagnostics::span_lin
  use clippy_utils::ty::{is_normalizable, is_type_diagnostic_item};
  use if_chain::if_chain;
  use rustc_hir::{self as hir, HirId, ItemKind, Node};
++use rustc_hir_analysis::hir_ty_to_ty;
  use rustc_lint::{LateContext, LateLintPass};
  use rustc_middle::ty::layout::LayoutOf as _;
  use rustc_middle::ty::{Adt, Ty, TypeVisitable};
  use rustc_session::{declare_lint_pass, declare_tool_lint};
  use rustc_span::sym;
- use rustc_hir_analysis::hir_ty_to_ty;
 -use rustc_typeck::hir_ty_to_ty;
  
  declare_clippy_lint! {
      /// ### What it does
@@@ -69,10 -69,10 +69,7 @@@ impl LateLintPass<'_> for ZeroSizedMapV
  
  fn in_trait_impl(cx: &LateContext<'_>, hir_id: HirId) -> bool {
      let parent_id = cx.tcx.hir().get_parent_item(hir_id);
--    let second_parent_id = cx
--        .tcx
--        .hir()
-         .get_parent_item(parent_id.into()).def_id;
 -        .get_parent_item(cx.tcx.hir().local_def_id_to_hir_id(parent_id));
++    let second_parent_id = cx.tcx.hir().get_parent_item(parent_id.into()).def_id;
      if let Some(Node::Item(item)) = cx.tcx.hir().find_by_def_id(second_parent_id) {
          if let ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }) = item.kind {
              return true;
index 627d6b51944a6d5026576321558bb157a1c5029b,f3c3fd73f3939c517f4a15f13c0712610dd73302..c2c52d08a3c127ed13626d00ac303a8da4171cd7
@@@ -23,6 -24,6 +23,7 @@@ extern crate rustc_attr
  extern crate rustc_data_structures;
  extern crate rustc_errors;
  extern crate rustc_hir;
++extern crate rustc_hir_analysis;
  extern crate rustc_infer;
  extern crate rustc_lexer;
  extern crate rustc_lint;
@@@ -32,7 -33,7 +33,6 @@@ extern crate rustc_session
  extern crate rustc_span;
  extern crate rustc_target;
  extern crate rustc_trait_selection;
- extern crate rustc_hir_analysis;
 -extern crate rustc_typeck;
  
  #[macro_use]
  pub mod sym_helper;
@@@ -1386,8 -1387,8 +1386,8 @@@ pub fn is_integer_literal(expr: &Expr<'
  /// Examples of coercions can be found in the Nomicon at
  /// <https://doc.rust-lang.org/nomicon/coercions.html>.
  ///
- /// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_hir_analysis::check::coercion` for more
 -/// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_typeck::check::coercion` for more
--/// information on adjustments and coercions.
++/// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_hir_analysis::check::coercion` for
++/// more information on adjustments and coercions.
  pub fn is_adjusted(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
      cx.typeck_results().adjustments().get(e.hir_id).is_some()
  }
index f7ce7191772684399ec2badf558302c68c0d4493,efa7aaa40ee2ca0223d3c5a338365d6a0cd99bab..5a0721486e33f2531ee3e7ac50b28f2ac038de90
@@@ -367,21 -362,10 +366,23 @@@ fn is_const_fn(tcx: TyCtxt<'_>, def_id
                  // Checking MSRV is manually necessary because `rustc` has no such concept. This entire
                  // function could be removed if `rustc` provided a MSRV-aware version of `is_const_fn`.
                  // as a part of an unimplemented MSRV check https://github.com/rust-lang/rust/issues/65262.
-                 // HACK(nilstrieb): CURRENT_RUSTC_VERSION can return versions like 1.66.0-dev. `rustc-semver` doesn't accept
-                 //                  the `-dev` version number so we have to strip it off.
 +
++                // HACK(nilstrieb): CURRENT_RUSTC_VERSION can return versions like 1.66.0-dev. `rustc-semver`
++                // doesn't accept                  the `-dev` version number so we have to strip it
++                // off.
 +                let short_version = since
 +                    .as_str()
 +                    .split('-')
 +                    .next()
 +                    .expect("rustc_attr::StabilityLevel::Stable::since` is empty");
 +
 +                let since = rustc_span::Symbol::intern(short_version);
 +
                  crate::meets_msrv(
                      msrv,
--                    RustcVersion::parse(since.as_str())
-                         .unwrap_or_else(|err| panic!("`rustc_attr::StabilityLevel::Stable::since` is ill-formatted: `{since}`, {err:?}")),
 -                        .expect("`rustc_attr::StabilityLevel::Stable::since` is ill-formatted"),
++                    RustcVersion::parse(since.as_str()).unwrap_or_else(|err| {
++                        panic!("`rustc_attr::StabilityLevel::Stable::since` is ill-formatted: `{since}`, {err:?}")
++                    }),
                  )
              } else {
                  // Unstable const fn with the feature enabled.
index e53c40e95760be06f4a4ca0193bfb288624856ba,00a2409996adc64fc13be63b8673c11b79e25832..ef836e84829bf1944e9c6052c7f6522660f6e253
@@@ -10,13 -10,13 +10,13 @@@ use rustc_ast_pretty::pprust::token_kin
  use rustc_errors::Applicability;
  use rustc_hir as hir;
  use rustc_hir::{Closure, ExprKind, HirId, MutTy, TyKind};
++use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::{EarlyContext, LateContext, LintContext};
  use rustc_middle::hir::place::ProjectionKind;
  use rustc_middle::mir::{FakeReadCause, Mutability};
  use rustc_middle::ty;
  use rustc_span::source_map::{BytePos, CharPos, Pos, Span, SyntaxContext};
- use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
 -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  use std::borrow::Cow;
  use std::fmt::{Display, Write as _};
  use std::ops::{Add, Neg, Not, Sub};
@@@ -1056,7 -1054,7 +1054,13 @@@ impl<'tcx> Delegate<'tcx> for DerefDele
  
      fn mutate(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {}
  
-     fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
 -    fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
++    fn fake_read(
++        &mut self,
++        _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>,
++        _: FakeReadCause,
++        _: HirId,
++    ) {
++    }
  }
  
  #[cfg(test)]
index 56343880320db987130415b432ec9481086822ca,b3eb6d0554484658e9367c59d2c9edd676782efc..934470bd135bf18f8a1d4983b32374d13e8ffb8f
@@@ -12,11 -12,11 +12,11 @@@ use rustc_hir::{Expr, FnDecl, LangItem
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::LateContext;
  use rustc_middle::mir::interpret::{ConstValue, Scalar};
- use rustc_middle::ty::{GenericArg, GenericArgKind};
 -use rustc_middle::ty::subst::{GenericArg, GenericArgKind, Subst};
  use rustc_middle::ty::{
      self, AdtDef, Binder, BoundRegion, DefIdTree, FnSig, IntTy, ParamEnv, Predicate, PredicateKind, ProjectionTy,
      Region, RegionKind, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, UintTy, VariantDef, VariantDiscr,
  };
++use rustc_middle::ty::{GenericArg, GenericArgKind};
  use rustc_span::symbol::Ident;
  use rustc_span::{sym, Span, Symbol, DUMMY_SP};
  use rustc_target::abi::{Size, VariantIdx};
index 76bfec75726dfc7fcf942de82491e56e6e0d411b,3af5dfb62f97e112fb6b8268f3e9f3b263375a78..3221b82aed4196d3f1cf8ab7e75297b30bf278ee
@@@ -4,12 -4,12 +4,12 @@@ use rustc_hir as hir
  use rustc_hir::intravisit::{self, Visitor};
  use rustc_hir::HirIdSet;
  use rustc_hir::{Expr, ExprKind, HirId, Node};
++use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  use rustc_infer::infer::TyCtxtInferExt;
  use rustc_lint::LateContext;
  use rustc_middle::hir::nested_filter;
  use rustc_middle::mir::FakeReadCause;
  use rustc_middle::ty;
- use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
 -use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
  
  /// Returns a set of mutated local variable IDs, or `None` if mutations could not be determined.
  pub fn mutated_variables<'tcx>(expr: &'tcx Expr<'_>, cx: &LateContext<'tcx>) -> Option<HirIdSet> {
@@@ -73,7 -73,7 +73,13 @@@ impl<'tcx> Delegate<'tcx> for MutVarsDe
          self.update(cmt);
      }
  
-     fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
 -    fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
++    fn fake_read(
++        &mut self,
++        _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>,
++        _: FakeReadCause,
++        _: HirId,
++    ) {
++    }
  }
  
  pub struct ParamBindingIdCollector {
index 6c7d51a4989e0b34f54d89c444399be3f502e8f2,4ae8bce88ad5ff7a5bda7c789ad86d8c770f607f..b8c0872522ee12e9068b40288ff835bca1002b94
@@@ -30,4 -30,4 +30,4 @@@ let _n = Decimal::MAX + Decimal::MAX
  ```
  
  ### Allowed types
--Custom allowed types can be specified through the "arithmetic-side-effects-allowed" filter.
++Custom allowed types can be specified through the "arithmetic-side-effects-allowed" filter.
Simple merge
Simple merge
index cadee6e00dff25669a6e0d46b86263054efc0dc7,45090dbe2064ef00480363d08329291e5200497b..047fb6c2311a2153e6db1cc8c69df5867d485782
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:27:5
 +  --> $DIR/needless_return.rs:26:5
     |
  LL |     return true;
-    |     ^^^^^^^^^^^^ help: remove `return`: `true`
+    |     ^^^^^^^^^^^
     |
     = note: `-D clippy::needless-return` implied by `-D warnings`
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:31:5
 +  --> $DIR/needless_return.rs:30:5
     |
  LL |     return true;
-    |     ^^^^^^^^^^^^ help: remove `return`: `true`
+    |     ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:36:9
 +  --> $DIR/needless_return.rs:35:9
     |
  LL |         return true;
-    |         ^^^^^^^^^^^^ help: remove `return`: `true`
+    |         ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:38:9
 +  --> $DIR/needless_return.rs:37:9
     |
  LL |         return false;
-    |         ^^^^^^^^^^^^^ help: remove `return`: `false`
+    |         ^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:44:17
 +  --> $DIR/needless_return.rs:43:17
     |
  LL |         true => return false,
-    |                 ^^^^^^^^^^^^ help: remove `return`: `false`
+    |                 ^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:46:13
 +  --> $DIR/needless_return.rs:45:13
     |
  LL |             return true;
-    |             ^^^^^^^^^^^^ help: remove `return`: `true`
+    |             ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:53:9
 +  --> $DIR/needless_return.rs:52:9
     |
  LL |         return true;
-    |         ^^^^^^^^^^^^ help: remove `return`: `true`
+    |         ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:55:16
 +  --> $DIR/needless_return.rs:54:16
     |
  LL |     let _ = || return true;
-    |                ^^^^^^^^^^^ help: remove `return`: `true`
+    |                ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:59:5
 +  --> $DIR/needless_return.rs:58:5
     |
  LL |     return the_answer!();
-    |     ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `the_answer!()`
+    |     ^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:63:5
 +  --> $DIR/needless_return.rs:62:5
     |
  LL |     return;
-    |     ^^^^^^^ help: remove `return`
+    |     ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:68:9
 +  --> $DIR/needless_return.rs:67:9
     |
  LL |         return;
-    |         ^^^^^^^ help: remove `return`
+    |         ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:70:9
 +  --> $DIR/needless_return.rs:69:9
     |
  LL |         return;
-    |         ^^^^^^^ help: remove `return`
+    |         ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:77:14
 +  --> $DIR/needless_return.rs:76:14
     |
  LL |         _ => return,
-    |              ^^^^^^ help: replace `return` with a unit value: `()`
+    |              ^^^^^^
+    |
+    = help: replace `return` with a unit value
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:86:13
 +  --> $DIR/needless_return.rs:85:13
     |
  LL |             return;
-    |             ^^^^^^^ help: remove `return`
+    |             ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:88:14
 +  --> $DIR/needless_return.rs:87:14
     |
  LL |         _ => return,
-    |              ^^^^^^ help: replace `return` with a unit value: `()`
+    |              ^^^^^^
+    |
+    = help: replace `return` with a unit value
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:101:9
 +  --> $DIR/needless_return.rs:100:9
     |
  LL |         return String::from("test");
-    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::from("test")`
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:103:9
 +  --> $DIR/needless_return.rs:102:9
     |
  LL |         return String::new();
-    |         ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
+    |         ^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:125:32
 +  --> $DIR/needless_return.rs:124:32
     |
  LL |         bar.unwrap_or_else(|_| return)
-    |                                ^^^^^^ help: replace `return` with an empty block: `{}`
+    |                                ^^^^^^
+    |
+    = help: replace `return` with an empty block
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:130:13
 +  --> $DIR/needless_return.rs:129:13
     |
  LL |             return;
-    |             ^^^^^^^ help: remove `return`
+    |             ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:132:20
 +  --> $DIR/needless_return.rs:131:20
     |
  LL |         let _ = || return;
-    |                    ^^^^^^ help: replace `return` with an empty block: `{}`
+    |                    ^^^^^^
+    |
+    = help: replace `return` with an empty block
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:138:32
 +  --> $DIR/needless_return.rs:137:32
     |
  LL |         res.unwrap_or_else(|_| return Foo)
-    |                                ^^^^^^^^^^ help: remove `return`: `Foo`
+    |                                ^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:147:5
 +  --> $DIR/needless_return.rs:146:5
     |
  LL |     return true;
-    |     ^^^^^^^^^^^^ help: remove `return`: `true`
+    |     ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:151:5
 +  --> $DIR/needless_return.rs:150:5
     |
  LL |     return true;
-    |     ^^^^^^^^^^^^ help: remove `return`: `true`
+    |     ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:156:9
 +  --> $DIR/needless_return.rs:155:9
     |
  LL |         return true;
-    |         ^^^^^^^^^^^^ help: remove `return`: `true`
+    |         ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:158:9
 +  --> $DIR/needless_return.rs:157:9
     |
  LL |         return false;
-    |         ^^^^^^^^^^^^^ help: remove `return`: `false`
+    |         ^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:164:17
 +  --> $DIR/needless_return.rs:163:17
     |
  LL |         true => return false,
-    |                 ^^^^^^^^^^^^ help: remove `return`: `false`
+    |                 ^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:166:13
 +  --> $DIR/needless_return.rs:165:13
     |
  LL |             return true;
-    |             ^^^^^^^^^^^^ help: remove `return`: `true`
+    |             ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:173:9
 +  --> $DIR/needless_return.rs:172:9
     |
  LL |         return true;
-    |         ^^^^^^^^^^^^ help: remove `return`: `true`
+    |         ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:175:16
 +  --> $DIR/needless_return.rs:174:16
     |
  LL |     let _ = || return true;
-    |                ^^^^^^^^^^^ help: remove `return`: `true`
+    |                ^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:179:5
 +  --> $DIR/needless_return.rs:178:5
     |
  LL |     return the_answer!();
-    |     ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `the_answer!()`
+    |     ^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:183:5
 +  --> $DIR/needless_return.rs:182:5
     |
  LL |     return;
-    |     ^^^^^^^ help: remove `return`
+    |     ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:188:9
 +  --> $DIR/needless_return.rs:187:9
     |
  LL |         return;
-    |         ^^^^^^^ help: remove `return`
+    |         ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:190:9
 +  --> $DIR/needless_return.rs:189:9
     |
  LL |         return;
-    |         ^^^^^^^ help: remove `return`
+    |         ^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:197:14
 +  --> $DIR/needless_return.rs:196:14
     |
  LL |         _ => return,
-    |              ^^^^^^ help: replace `return` with a unit value: `()`
+    |              ^^^^^^
+    |
+    = help: replace `return` with a unit value
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:210:9
 +  --> $DIR/needless_return.rs:209:9
     |
  LL |         return String::from("test");
-    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::from("test")`
+    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:212:9
 +  --> $DIR/needless_return.rs:211:9
     |
  LL |         return String::new();
-    |         ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
+    |         ^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
  error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:228:5
 +  --> $DIR/needless_return.rs:227:5
     |
  LL |     return format!("Hello {}", "world!");
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `format!("Hello {}", "world!")`
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:239:9
++  --> $DIR/needless_return.rs:238:9
+    |
+ LL |         return true;
+    |         ^^^^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:241:9
++  --> $DIR/needless_return.rs:240:9
+    |
+ LL |         return false;
+    |         ^^^^^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:248:13
++  --> $DIR/needless_return.rs:247:13
+    |
+ LL |             return 10;
+    |             ^^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:251:13
++  --> $DIR/needless_return.rs:250:13
+    |
+ LL |             return 100;
+    |             ^^^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:259:9
++  --> $DIR/needless_return.rs:258:9
+    |
+ LL |         return 0;
+    |         ^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:266:13
++  --> $DIR/needless_return.rs:265:13
+    |
+ LL |             return *(x as *const isize);
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
+ error: unneeded `return` statement
 -  --> $DIR/needless_return.rs:268:13
++  --> $DIR/needless_return.rs:267:13
+    |
+ LL |             return !*(x as *const isize);
+    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |
+    = help: remove `return`
  
- error: aborting due to 37 previous errors
+ error: aborting due to 44 previous errors
  
Simple merge
index f49b23924efe8b5c52fb807098bf3fd5760c570b,1709e7512eb653942eebc06dfa0585abdb59055a..3033f019244a8409befc6706f4887f2b9a99f48e
@@@ -101,5 -101,18 +101,18 @@@ LL | |             break 'label
  LL | |         }
     | |_________^
  
- error: aborting due to 9 previous errors
+ error: this loop never actually loops
 -  --> $DIR/never_loop.rs:224:13
++  --> $DIR/never_loop.rs:223:13
+    |
+ LL |       let _ = loop {
+    |  _____________^
+ LL | |         let Some(x) = x else {
+ LL | |             return;
+ LL | |         };
+ LL | |
+ LL | |         break x;
+ LL | |     };
+    | |_____^
+ error: aborting due to 10 previous errors