Skip to content

Commit dd91585

Browse files
committed
Inline some hot functions
1 parent fb33834 commit dd91585

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

compiler/rustc_hir/src/hir.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4076,6 +4076,7 @@ impl FnDeclFlags {
40764076
}
40774077

40784078
/// Returns `true` if the given input contains a `#[splat]` attribute in `attrs`.
4079+
#[inline]
40794080
pub fn is_splatted_arg<'hir>(
40804081
&self,
40814082
input: &'hir Ty<'hir>,
@@ -4086,6 +4087,7 @@ impl FnDeclFlags {
40864087

40874088
/// Searches `inputs` and `attrs` for the index of the splatted argument. Returns `None` if
40884089
/// there is no splatted argument.
4090+
#[inline]
40894091
pub fn splatted_arg_index<'hir>(
40904092
&self,
40914093
inputs: &'hir [Ty<'hir>],
@@ -4156,6 +4158,7 @@ impl<'hir> FnDecl<'hir> {
41564158
}
41574159

41584160
/// Returns `true` if the given argument `index` contains a `#[splat]` attribute in `attrs`.
4161+
#[inline]
41594162
pub fn is_splatted_arg(
41604163
&self,
41614164
index: usize,
@@ -4166,13 +4169,17 @@ impl<'hir> FnDecl<'hir> {
41664169

41674170
/// Searches `self.inputs` and `attrs` for the index of the splatted argument. Returns `None`
41684171
/// if there is no splatted argument.
4172+
#[inline]
41694173
pub fn splatted_arg_index(
41704174
&self,
41714175
attrs: &'hir dyn Fn(HirId) -> &'hir [Attribute],
41724176
) -> Option<u16> {
41734177
self.fn_decl_kind.splatted_arg_index(self.inputs, attrs)
41744178
}
41754179

4180+
/// Returns a dummy FnDecl with the given span, no inputs, no output, and lifetime elision
4181+
/// allowed.
4182+
#[inline]
41764183
pub fn dummy(span: Span) -> Self {
41774184
Self {
41784185
inputs: &[],

0 commit comments

Comments
 (0)