@@ -124,13 +124,13 @@ crate fn program_clauses_for<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefI
124
124
hir:: map:: Node :: NodeItem ( item) => match item. node {
125
125
hir:: ItemTrait ( ..) => program_clauses_for_trait ( tcx, def_id) ,
126
126
hir:: ItemImpl ( ..) => program_clauses_for_impl ( tcx, def_id) ,
127
- _ => Lrc :: new ( vec ! [ ] ) ,
127
+ _ => Lrc :: new ( tcx . mk_clauses ( iter :: empty :: < Clause > ( ) ) ) ,
128
128
}
129
129
hir:: map:: Node :: NodeImplItem ( item) => {
130
130
if let hir:: ImplItemKind :: Type ( ..) = item. node {
131
131
program_clauses_for_associated_type_value ( tcx, def_id)
132
132
} else {
133
- Lrc :: new ( vec ! [ ] )
133
+ Lrc :: new ( tcx . mk_clauses ( iter :: empty :: < Clause > ( ) ) )
134
134
}
135
135
} ,
136
136
@@ -247,7 +247,7 @@ fn program_clauses_for_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId
247
247
pub fn program_clauses_for_associated_type_value < ' a , ' tcx > (
248
248
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
249
249
item_id : DefId ,
250
- ) -> Lrc < Vec < Clause < ' tcx > > > {
250
+ ) -> Lrc < & ' tcx Slice < Clause < ' tcx > > > {
251
251
// Rule Normalize-From-Impl (see rustc guide)
252
252
//
253
253
// ```impl<P0..Pn> Trait<A1..An> for A0
@@ -289,9 +289,11 @@ pub fn program_clauses_for_associated_type_value<'a, 'tcx>(
289
289
// `Normalize(... -> T) :- ...`
290
290
let clause = ProgramClause {
291
291
goal : normalize_goal,
292
- hypotheses : where_clauses. into_iter ( ) . map ( |wc| wc. into ( ) ) . collect ( ) ,
292
+ hypotheses : tcx. mk_goals (
293
+ where_clauses. into_iter ( ) . map ( |wc| Goal :: from_poly_domain_goal ( wc, tcx) )
294
+ ) ,
293
295
} ;
294
- Lrc :: new ( vec ! [ Clause :: ForAll ( ty:: Binder :: dummy( clause) ) ] )
296
+ Lrc :: new ( tcx . mk_clauses ( iter :: once ( Clause :: ForAll ( ty:: Binder :: dummy ( clause) ) ) ) )
295
297
}
296
298
297
299
pub fn dump_program_clauses < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) {
0 commit comments