Some tracing and comment cleanups

This commit is contained in:
Oli Scherer 2022-10-20 09:39:09 +00:00
parent 47c008e440
commit 44d1936d00
10 changed files with 23 additions and 56 deletions

View file

@ -388,6 +388,8 @@ impl<'hir> GenericArgs<'hir> {
}
#[inline]
/// This function returns the number of type and const generic params.
/// It should only be used for diagnostics.
pub fn num_generic_params(&self) -> usize {
self.args.iter().filter(|arg| !matches!(arg, GenericArg::Lifetime(_))).count()
}