@@ -23,7 +23,7 @@ pub fn provide(providers: &mut Providers<'_>) {
23
23
fn inferred_outlives_of < ' a , ' tcx > (
24
24
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
25
25
item_def_id : DefId ,
26
- ) -> Lrc < Vec < ty:: Predicate < ' tcx > > > {
26
+ ) -> & ' tcx [ ty:: Predicate < ' tcx > ] {
27
27
let id = tcx
28
28
. hir ( )
29
29
. as_local_hir_id ( item_def_id)
@@ -37,8 +37,8 @@ fn inferred_outlives_of<'a, 'tcx>(
37
37
let predicates = crate_map
38
38
. predicates
39
39
. get ( & item_def_id)
40
- . unwrap_or ( & crate_map . empty_predicate )
41
- . clone ( ) ;
40
+ . map ( |p| * p )
41
+ . unwrap_or ( & [ ] ) ;
42
42
43
43
if tcx. has_attr ( item_def_id, "rustc_outlives" ) {
44
44
let mut pred: Vec < String > = predicates
@@ -63,10 +63,10 @@ fn inferred_outlives_of<'a, 'tcx>(
63
63
predicates
64
64
}
65
65
66
- _ => Lrc :: new ( Vec :: new ( ) ) ,
66
+ _ => & [ ] ,
67
67
} ,
68
68
69
- _ => Lrc :: new ( Vec :: new ( ) ) ,
69
+ _ => & [ ] ,
70
70
}
71
71
}
72
72
@@ -96,7 +96,7 @@ fn inferred_outlives_crate<'tcx>(
96
96
let predicates = global_inferred_outlives
97
97
. iter ( )
98
98
. map ( |( & def_id, set) | {
99
- let vec : Vec < ty :: Predicate < ' tcx > > = set
99
+ let predicates = tcx . arena . alloc_from_iter ( set
100
100
. iter ( )
101
101
. filter_map (
102
102
|ty:: OutlivesPredicate ( kind1, region2) | match kind1. unpack ( ) {
@@ -115,14 +115,11 @@ fn inferred_outlives_crate<'tcx>(
115
115
None
116
116
}
117
117
} ,
118
- ) . collect ( ) ;
119
- ( def_id, Lrc :: new ( vec ) )
118
+ ) ) ;
119
+ ( def_id, & * predicates )
120
120
} ) . collect ( ) ;
121
121
122
- let empty_predicate = Lrc :: new ( Vec :: new ( ) ) ;
123
-
124
122
Lrc :: new ( ty:: CratePredicatesMap {
125
123
predicates,
126
- empty_predicate,
127
124
} )
128
125
}
0 commit comments