Rollup merge of #55778 - nnethercote:LrcPreds, r=eddyb
Wrap some query results in `Lrc`. So that the frequent clones in `try_get` are cheaper.
This commit is contained in:
commit
97d0d8964e
14 changed files with 73 additions and 69 deletions
|
@ -1563,7 +1563,7 @@ impl Clean<Generics> for hir::Generics {
|
|||
}
|
||||
|
||||
impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics,
|
||||
&'a ty::GenericPredicates<'tcx>) {
|
||||
&'a Lrc<ty::GenericPredicates<'tcx>>) {
|
||||
fn clean(&self, cx: &DocContext) -> Generics {
|
||||
use self::WherePredicate as WP;
|
||||
|
||||
|
|
|
@ -156,8 +156,8 @@ fn trait_is_same_or_supertrait(cx: &DocContext, child: DefId,
|
|||
if child == trait_ {
|
||||
return true
|
||||
}
|
||||
let predicates = cx.tcx.super_predicates_of(child).predicates;
|
||||
predicates.iter().filter_map(|(pred, _)| {
|
||||
let predicates = cx.tcx.super_predicates_of(child);
|
||||
predicates.predicates.iter().filter_map(|(pred, _)| {
|
||||
if let ty::Predicate::Trait(ref pred) = *pred {
|
||||
if pred.skip_binder().trait_ref.self_ty().is_self() {
|
||||
Some(pred.def_id())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue