Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes

This commit is contained in:
Santiago Pastorino
2024-05-11 11:46:25 +02:00
parent 84b9b6d16c
commit 4501ae89f1
18 changed files with 25 additions and 17 deletions

View File

@@ -391,6 +391,14 @@ impl<'tcx> Generics {
}
false
}
pub fn is_empty(&'tcx self) -> bool {
self.count() == 0
}
pub fn is_own_empty(&'tcx self) -> bool {
self.own_params.is_empty()
}
}
/// Bounds on generics.