Skip to content

Commit 0d11be5

Browse files
committed
Auto merge of #143556 - jhpratt:rollup-nid39y2, r=jhpratt
Rollup of 9 pull requests Successful merges: - #143206 (Align attr fixes) - #143236 (Stabilize `mixed_integer_ops_unsigned_sub`) - #143344 (Port `#[path]` to the new attribute parsing infrastructure ) - #143359 (Link to 2024 edition page for `!` fallback changes) - #143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`) - #143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP) - #143535 (Remove duplicate word) - #143544 (compiler: rename BareFn to FnPtr) - #143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ca98d4d + 2992997 commit 0d11be5

File tree

71 files changed

+405
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+405
-272
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,6 +4474,7 @@ dependencies = [
44744474
"rustc_feature",
44754475
"rustc_fluent_macro",
44764476
"rustc_hir",
4477+
"rustc_index",
44774478
"rustc_macros",
44784479
"rustc_metadata",
44794480
"rustc_middle",

compiler/rustc_ast/src/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ impl Ty {
24222422
}
24232423

24242424
#[derive(Clone, Encodable, Decodable, Debug)]
2425-
pub struct BareFnTy {
2425+
pub struct FnPtrTy {
24262426
pub safety: Safety,
24272427
pub ext: Extern,
24282428
pub generic_params: ThinVec<GenericParam>,
@@ -2455,8 +2455,8 @@ pub enum TyKind {
24552455
///
24562456
/// Desugars into `Pin<&'a T>` or `Pin<&'a mut T>`.
24572457
PinnedRef(Option<Lifetime>, MutTy),
2458-
/// A bare function (e.g., `fn(usize) -> bool`).
2459-
BareFn(P<BareFnTy>),
2458+
/// A function pointer type (e.g., `fn(usize) -> bool`).
2459+
FnPtr(P<FnPtrTy>),
24602460
/// An unsafe existential lifetime binder (e.g., `unsafe<'a> &'a ()`).
24612461
UnsafeBinder(P<UnsafeBinderTy>),
24622462
/// The never type (`!`).

compiler/rustc_ast/src/util/classify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn type_trailing_braced_mac_call(mut ty: &ast::Ty) -> Option<&ast::MacCall> {
265265
ty = &binder.inner_ty;
266266
}
267267

268-
ast::TyKind::BareFn(fn_ty) => match &fn_ty.decl.output {
268+
ast::TyKind::FnPtr(fn_ty) => match &fn_ty.decl.output {
269269
ast::FnRetTy::Default(_) => break None,
270270
ast::FnRetTy::Ty(ret) => ty = ret,
271271
},

compiler/rustc_ast/src/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,8 @@ macro_rules! common_visitor_and_walkers {
10591059
TyKind::Tup(tuple_element_types) => {
10601060
walk_list!(vis, visit_ty, tuple_element_types);
10611061
}
1062-
TyKind::BareFn(function_declaration) => {
1063-
let BareFnTy { safety, ext: _, generic_params, decl, decl_span } =
1062+
TyKind::FnPtr(function_declaration) => {
1063+
let FnPtrTy { safety, ext: _, generic_params, decl, decl_span } =
10641064
&$($mut)? **function_declaration;
10651065
try_visit!(visit_safety(vis, safety));
10661066
try_visit!(visit_generic_params(vis, generic_params));

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,9 +1269,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12691269
let path = self.make_lang_item_qpath(LangItem::Pin, span, Some(args));
12701270
hir::TyKind::Path(path)
12711271
}
1272-
TyKind::BareFn(f) => {
1272+
TyKind::FnPtr(f) => {
12731273
let generic_params = self.lower_lifetime_binder(t.id, &f.generic_params);
1274-
hir::TyKind::BareFn(self.arena.alloc(hir::BareFnTy {
1274+
hir::TyKind::FnPtr(self.arena.alloc(hir::FnPtrTy {
12751275
generic_params,
12761276
safety: self.lower_safety(f.safety, hir::Safety::Safe),
12771277
abi: self.lower_extern(f.ext),

compiler/rustc_ast_passes/messages.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ ast_passes_auto_super_lifetime = auto traits cannot have super traits or lifetim
4848
4949
ast_passes_bad_c_variadic = only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
5050
51-
ast_passes_bare_fn_invalid_safety = function pointers cannot be declared with `safe` safety qualifier
52-
.suggestion = remove safe from this item
53-
5451
ast_passes_body_in_extern = incorrect `{$kind}` inside `extern` block
5552
.cannot_have = cannot have a body
5653
.invalid = the invalid body
@@ -135,6 +132,9 @@ ast_passes_fn_param_forbidden_self =
135132
ast_passes_fn_param_too_many =
136133
function can not have more than {$max_num_args} arguments
137134
135+
ast_passes_fn_ptr_invalid_safety = function pointers cannot be declared with `safe` safety qualifier
136+
.suggestion = remove safe from this item
137+
138138
ast_passes_fn_without_body =
139139
free function without a body
140140
.suggestion = provide a definition for the function

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,9 @@ impl<'a> AstValidator<'a> {
499499
}
500500
}
501501

502-
fn check_bare_fn_safety(&self, span: Span, safety: Safety) {
502+
fn check_fn_ptr_safety(&self, span: Span, safety: Safety) {
503503
if matches!(safety, Safety::Safe(_)) {
504-
self.dcx().emit_err(errors::InvalidSafetyOnBareFn { span });
504+
self.dcx().emit_err(errors::InvalidSafetyOnFnPtr { span });
505505
}
506506
}
507507

@@ -785,8 +785,8 @@ impl<'a> AstValidator<'a> {
785785

786786
fn visit_ty_common(&mut self, ty: &'a Ty) {
787787
match &ty.kind {
788-
TyKind::BareFn(bfty) => {
789-
self.check_bare_fn_safety(bfty.decl_span, bfty.safety);
788+
TyKind::FnPtr(bfty) => {
789+
self.check_fn_ptr_safety(bfty.decl_span, bfty.safety);
790790
self.check_fn_decl(&bfty.decl, SelfSemantic::No);
791791
Self::check_decl_no_pat(&bfty.decl, |span, _, _| {
792792
self.dcx().emit_err(errors::PatternFnPointer { span });

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ pub(crate) struct InvalidSafetyOnItem {
225225
}
226226

227227
#[derive(Diagnostic)]
228-
#[diag(ast_passes_bare_fn_invalid_safety)]
229-
pub(crate) struct InvalidSafetyOnBareFn {
228+
#[diag(ast_passes_fn_ptr_invalid_safety)]
229+
pub(crate) struct InvalidSafetyOnFnPtr {
230230
#[primary_span]
231231
pub span: Span,
232232
}

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
286286

287287
fn visit_ty(&mut self, ty: &'a ast::Ty) {
288288
match &ty.kind {
289-
ast::TyKind::BareFn(bare_fn_ty) => {
289+
ast::TyKind::FnPtr(fn_ptr_ty) => {
290290
// Function pointers cannot be `const`
291-
self.check_late_bound_lifetime_defs(&bare_fn_ty.generic_params);
291+
self.check_late_bound_lifetime_defs(&fn_ptr_ty.generic_params);
292292
}
293293
ast::TyKind::Never => {
294294
gate!(&self, never_type, ty.span, "the `!` type is experimental");

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ impl<'a> State<'a> {
12851285
self.print_type(typ);
12861286
self.pclose();
12871287
}
1288-
ast::TyKind::BareFn(f) => {
1288+
ast::TyKind::FnPtr(f) => {
12891289
self.print_ty_fn(f.ext, f.safety, &f.decl, None, &f.generic_params);
12901290
}
12911291
ast::TyKind::UnsafeBinder(f) => {

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub enum UsedBy {
149149
/// ## Attribute Processing
150150
/// While attributes are initially parsed by [`rustc_parse`] into [`ast::Attribute`], they still contain raw token streams
151151
/// because different attributes have different internal structures. This enum represents the final,
152-
/// fully parsed form of these attributes, where each variant contains contains all the information and
152+
/// fully parsed form of these attributes, where each variant contains all the information and
153153
/// structure relevant for the specific attribute.
154154
///
155155
/// Some attributes can be applied multiple times to the same item, and they are "collapsed" into a single
@@ -298,6 +298,9 @@ pub enum AttributeKind {
298298
/// Represents `#[rustc_pass_by_value]` (used by the `rustc_pass_by_value` lint).
299299
PassByValue(Span),
300300

301+
/// Represents `#[path]`
302+
Path(Symbol, Span),
303+
301304
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
302305
PubTransparent(Span),
303306

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl AttributeKind {
4040
NonExhaustive(..) => Yes,
4141
Optimize(..) => No,
4242
PassByValue(..) => Yes,
43+
Path(..) => No,
4344
PubTransparent(..) => Yes,
4445
Repr { .. } => No,
4546
RustcLayoutScalarValidRangeEnd(..) => Yes,

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub(crate) mod loop_match;
3737
pub(crate) mod must_use;
3838
pub(crate) mod no_implicit_prelude;
3939
pub(crate) mod non_exhaustive;
40+
pub(crate) mod path;
4041
pub(crate) mod repr;
4142
pub(crate) mod rustc_internal;
4243
pub(crate) mod semantics;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use rustc_attr_data_structures::AttributeKind;
2+
use rustc_feature::{AttributeTemplate, template};
3+
use rustc_span::{Symbol, sym};
4+
5+
use crate::attributes::{AttributeOrder, OnDuplicate, SingleAttributeParser};
6+
use crate::context::{AcceptContext, Stage};
7+
use crate::parser::ArgParser;
8+
9+
pub(crate) struct PathParser;
10+
11+
impl<S: Stage> SingleAttributeParser<S> for PathParser {
12+
const PATH: &[Symbol] = &[sym::path];
13+
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepLast;
14+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
15+
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "file");
16+
17+
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
18+
let Some(nv) = args.name_value() else {
19+
cx.expected_name_value(cx.attr_span, None);
20+
return None;
21+
};
22+
let Some(path) = nv.value_as_str() else {
23+
cx.expected_string_literal(nv.value_span, Some(nv.value_as_lit()));
24+
return None;
25+
};
26+
27+
Some(AttributeKind::Path(path, cx.attr_span))
28+
}
29+
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use crate::attributes::loop_match::{ConstContinueParser, LoopMatchParser};
2828
use crate::attributes::must_use::MustUseParser;
2929
use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser;
3030
use crate::attributes::non_exhaustive::NonExhaustiveParser;
31+
use crate::attributes::path::PathParser as PathAttributeParser;
3132
use crate::attributes::repr::{AlignParser, ReprParser};
3233
use crate::attributes::rustc_internal::{
3334
RustcLayoutScalarValidRangeEnd, RustcLayoutScalarValidRangeStart,
@@ -133,6 +134,7 @@ attribute_parsers!(
133134
Single<LinkSectionParser>,
134135
Single<MustUseParser>,
135136
Single<OptimizeParser>,
137+
Single<PathAttributeParser>,
136138
Single<RustcForceInlineParser>,
137139
Single<RustcLayoutScalarValidRangeEnd>,
138140
Single<RustcLayoutScalarValidRangeStart>,

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,12 @@ fn find_type_parameters(
414414
impl<'a, 'b> visit::Visitor<'a> for Visitor<'a, 'b> {
415415
fn visit_ty(&mut self, ty: &'a ast::Ty) {
416416
let stack_len = self.bound_generic_params_stack.len();
417-
if let ast::TyKind::BareFn(bare_fn) = &ty.kind
418-
&& !bare_fn.generic_params.is_empty()
417+
if let ast::TyKind::FnPtr(fn_ptr) = &ty.kind
418+
&& !fn_ptr.generic_params.is_empty()
419419
{
420420
// Given a field `x: for<'a> fn(T::SomeType<'a>)`, we wan't to account for `'a` so
421421
// that we generate `where for<'a> T::SomeType<'a>: ::core::clone::Clone`. #122622
422-
self.bound_generic_params_stack.extend(bare_fn.generic_params.iter().cloned());
422+
self.bound_generic_params_stack.extend(fn_ptr.generic_params.iter().cloned());
423423
}
424424

425425
if let ast::TyKind::Path(_, path) = &ty.kind

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_abi::{Align, ExternAbi};
44
use rustc_ast::expand::autodiff_attrs::{AutoDiffAttrs, DiffActivity, DiffMode};
55
use rustc_ast::{LitKind, MetaItem, MetaItemInner, attr};
66
use rustc_attr_data_structures::{
7-
AttributeKind, InlineAttr, InstructionSetAttr, OptimizeAttr, ReprAttr, UsedBy, find_attr,
7+
AttributeKind, InlineAttr, InstructionSetAttr, OptimizeAttr, UsedBy, find_attr,
88
};
99
use rustc_hir::def::DefKind;
1010
use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId};
@@ -109,14 +109,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
109109

110110
if let hir::Attribute::Parsed(p) = attr {
111111
match p {
112-
AttributeKind::Repr { reprs, first_span: _ } => {
113-
codegen_fn_attrs.alignment = reprs
114-
.iter()
115-
.filter_map(
116-
|(r, _)| if let ReprAttr::ReprAlign(x) = r { Some(*x) } else { None },
117-
)
118-
.max();
119-
}
120112
AttributeKind::Cold(_) => codegen_fn_attrs.flags |= CodegenFnAttrFlags::COLD,
121113
AttributeKind::ExportName { name, .. } => {
122114
codegen_fn_attrs.export_name = Some(*name);

compiler/rustc_hir/src/def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ pub enum LifetimeRes {
831831
/// Id of the introducing place. That can be:
832832
/// - an item's id, for the item's generic parameters;
833833
/// - a TraitRef's ref_id, identifying the `for<...>` binder;
834-
/// - a BareFn type's id.
834+
/// - a FnPtr type's id.
835835
///
836836
/// This information is used for impl-trait lifetime captures, to know when to or not to
837837
/// capture any given lifetime.

compiler/rustc_hir/src/hir.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,7 +3526,7 @@ impl PrimTy {
35263526
}
35273527

35283528
#[derive(Debug, Clone, Copy, HashStable_Generic)]
3529-
pub struct BareFnTy<'hir> {
3529+
pub struct FnPtrTy<'hir> {
35303530
pub safety: Safety,
35313531
pub abi: ExternAbi,
35323532
pub generic_params: &'hir [GenericParam<'hir>],
@@ -3645,8 +3645,8 @@ pub enum TyKind<'hir, Unambig = ()> {
36453645
Ptr(MutTy<'hir>),
36463646
/// A reference (i.e., `&'a T` or `&'a mut T`).
36473647
Ref(&'hir Lifetime, MutTy<'hir>),
3648-
/// A bare function (e.g., `fn(usize) -> bool`).
3649-
BareFn(&'hir BareFnTy<'hir>),
3648+
/// A function pointer (e.g., `fn(usize) -> bool`).
3649+
FnPtr(&'hir FnPtrTy<'hir>),
36503650
/// An unsafe binder type (e.g. `unsafe<'a> Foo<'a>`).
36513651
UnsafeBinder(&'hir UnsafeBinderTy<'hir>),
36523652
/// The never type (`!`).
@@ -4498,7 +4498,7 @@ pub enum ForeignItemKind<'hir> {
44984498
///
44994499
/// All argument idents are actually always present (i.e. `Some`), but
45004500
/// `&[Option<Ident>]` is used because of code paths shared with `TraitFn`
4501-
/// and `BareFnTy`. The sharing is due to all of these cases not allowing
4501+
/// and `FnPtrTy`. The sharing is due to all of these cases not allowing
45024502
/// arbitrary patterns for parameters.
45034503
Fn(FnSig<'hir>, &'hir [Option<Ident>], &'hir Generics<'hir>),
45044504
/// A foreign static item (`static ext: u8`).

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v, AmbigArg>) -
10011001
TyKind::Tup(tuple_element_types) => {
10021002
walk_list!(visitor, visit_ty_unambig, tuple_element_types);
10031003
}
1004-
TyKind::BareFn(ref function_declaration) => {
1004+
TyKind::FnPtr(ref function_declaration) => {
10051005
walk_list!(visitor, visit_generic_param, function_declaration.generic_params);
10061006
try_visit!(visitor.visit_fn_decl(function_declaration.decl));
10071007
}

compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn placeholder_type_error_diag<'cx, 'tcx>(
198198
let mut is_const_or_static = false;
199199

200200
if let Some(hir_ty) = hir_ty
201-
&& let hir::TyKind::BareFn(_) = hir_ty.kind
201+
&& let hir::TyKind::FnPtr(_) = hir_ty.kind
202202
{
203203
is_fn = true;
204204

compiler/rustc_hir_analysis/src/collect/generics_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
454454
type Result = ControlFlow<Span>;
455455
fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx, AmbigArg>) -> ControlFlow<Span> {
456456
match ty.kind {
457-
hir::TyKind::BareFn(..) => {
457+
hir::TyKind::FnPtr(..) => {
458458
self.outer_index.shift_in(1);
459459
let res = intravisit::walk_ty(self, ty);
460460
self.outer_index.shift_out(1);

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
704704
#[instrument(level = "debug", skip(self))]
705705
fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx, AmbigArg>) {
706706
match ty.kind {
707-
hir::TyKind::BareFn(c) => {
707+
hir::TyKind::FnPtr(c) => {
708708
let (mut bound_vars, binders): (FxIndexMap<LocalDefId, ResolvedArg>, Vec<_>) = c
709709
.generic_params
710710
.iter()
@@ -728,8 +728,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
728728
where_bound_origin: None,
729729
};
730730
self.with(scope, |this| {
731-
// a bare fn has no bounds, so everything
732-
// contained within is scoped within its binder.
731+
// a FnPtr has no bounds, so everything within is scoped within its binder
733732
intravisit::walk_ty(this, ty);
734733
});
735734
}
@@ -758,8 +757,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
758757
where_bound_origin: None,
759758
};
760759
self.with(scope, |this| {
761-
// a bare fn has no bounds, so everything
762-
// contained within is scoped within its binder.
760+
// everything within is scoped within its binder
763761
intravisit::walk_ty(this, ty);
764762
});
765763
}
@@ -1419,7 +1417,7 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
14191417
hir::Node::OpaqueTy(_) => "higher-ranked lifetime from outer `impl Trait`",
14201418
// Other items are fine.
14211419
hir::Node::Item(_) | hir::Node::TraitItem(_) | hir::Node::ImplItem(_) => return Ok(()),
1422-
hir::Node::Ty(hir::Ty { kind: hir::TyKind::BareFn(_), .. }) => {
1420+
hir::Node::Ty(hir::Ty { kind: hir::TyKind::FnPtr(_), .. }) => {
14231421
"higher-ranked lifetime from function pointer"
14241422
}
14251423
hir::Node::Ty(hir::Ty { kind: hir::TyKind::TraitObject(..), .. }) => {

compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
393393
let params = if let Some(generics) = node.generics() {
394394
generics.params
395395
} else if let hir::Node::Ty(ty) = node
396-
&& let hir::TyKind::BareFn(bare_fn) = ty.kind
396+
&& let hir::TyKind::FnPtr(fn_ptr) = ty.kind
397397
{
398-
bare_fn.generic_params
398+
fn_ptr.generic_params
399399
} else {
400400
&[]
401401
};

0 commit comments

Comments
 (0)