diff options
Diffstat (limited to 'compiler/rustc_hir')
| -rw-r--r-- | compiler/rustc_hir/src/def.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/intravisit.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 459fe5935e0..df010f87098 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -831,7 +831,7 @@ pub enum LifetimeRes { /// Id of the introducing place. That can be: /// - an item's id, for the item's generic parameters; /// - a TraitRef's ref_id, identifying the `for<...>` binder; - /// - a BareFn type's id. + /// - a FnPtr type's id. /// /// This information is used for impl-trait lifetime captures, to know when to or not to /// capture any given lifetime. diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 559a771931e..0f6f81d7964 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -3526,7 +3526,7 @@ impl PrimTy { } #[derive(Debug, Clone, Copy, HashStable_Generic)] -pub struct BareFnTy<'hir> { +pub struct FnPtrTy<'hir> { pub safety: Safety, pub abi: ExternAbi, pub generic_params: &'hir [GenericParam<'hir>], @@ -3645,8 +3645,8 @@ pub enum TyKind<'hir, Unambig = ()> { Ptr(MutTy<'hir>), /// A reference (i.e., `&'a T` or `&'a mut T`). Ref(&'hir Lifetime, MutTy<'hir>), - /// A bare function (e.g., `fn(usize) -> bool`). - BareFn(&'hir BareFnTy<'hir>), + /// A function pointer (e.g., `fn(usize) -> bool`). + FnPtr(&'hir FnPtrTy<'hir>), /// An unsafe binder type (e.g. `unsafe<'a> Foo<'a>`). UnsafeBinder(&'hir UnsafeBinderTy<'hir>), /// The never type (`!`). @@ -4498,7 +4498,7 @@ pub enum ForeignItemKind<'hir> { /// /// All argument idents are actually always present (i.e. `Some`), but /// `&[Option<Ident>]` is used because of code paths shared with `TraitFn` - /// and `BareFnTy`. The sharing is due to all of these cases not allowing + /// and `FnPtrTy`. The sharing is due to all of these cases not allowing /// arbitrary patterns for parameters. Fn(FnSig<'hir>, &'hir [Option<Ident>], &'hir Generics<'hir>), /// A foreign static item (`static ext: u8`). diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index a0bc318e2ca..1bb8f7ad894 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -1001,7 +1001,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v, AmbigArg>) - TyKind::Tup(tuple_element_types) => { walk_list!(visitor, visit_ty_unambig, tuple_element_types); } - TyKind::BareFn(ref function_declaration) => { + TyKind::FnPtr(ref function_declaration) => { walk_list!(visitor, visit_generic_param, function_declaration.generic_params); try_visit!(visitor.visit_fn_decl(function_declaration.decl)); } |
