Rollup merge of #136164 - celinval:chores-fnkind, r=oli-obk

Refactor FnKind variant to hold &Fn

Pulling the change suggested in #128045 to reduce the impact of changing `Fn` item.

r? `@oli-obk`
This commit is contained in:
León Orell Valerian Liehr 2025-01-29 03:12:22 +01:00 committed by GitHub
commit a4eff9d322

View file

@ -1,5 +1,5 @@
use rustc_ast::visit::FnKind;
use rustc_ast::{NodeId, WherePredicateKind};
use rustc_ast::{Fn, NodeId, WherePredicateKind};
use rustc_data_structures::fx::FxHashMap;
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_session::declare_lint_pass;
@ -39,7 +39,7 @@ declare_lint_pass!(MultipleBoundLocations => [MULTIPLE_BOUND_LOCATIONS]);
impl EarlyLintPass for MultipleBoundLocations {
fn check_fn(&mut self, cx: &EarlyContext<'_>, kind: FnKind<'_>, _: Span, _: NodeId) {
if let FnKind::Fn(_, _, _, _, generics, _) = kind
if let FnKind::Fn(_, _, _, Fn { generics, .. }) = kind
&& !generics.params.is_empty()
&& !generics.where_clause.predicates.is_empty()
{