Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes
This commit is contained in:
parent
84b9b6d16c
commit
4501ae89f1
18 changed files with 25 additions and 17 deletions
|
@ -1429,7 +1429,7 @@ impl<'v> RootCollector<'_, 'v> {
|
|||
match self.tcx.def_kind(id.owner_id) {
|
||||
DefKind::Enum | DefKind::Struct | DefKind::Union => {
|
||||
if self.strategy == MonoItemCollectionStrategy::Eager
|
||||
&& self.tcx.generics_of(id.owner_id).count() == 0
|
||||
&& self.tcx.generics_of(id.owner_id).is_empty()
|
||||
{
|
||||
debug!("RootCollector: ADT drop-glue for `{id:?}`",);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ fn unused_generic_params<'tcx>(
|
|||
debug!(?generics);
|
||||
|
||||
// Exit early when there are no parameters to be unused.
|
||||
if generics.count() == 0 {
|
||||
if generics.is_empty() {
|
||||
return UnusedGenericParams::new_all_used();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue