@@ -261,34 +261,33 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
261261 /// variable in the future by changing the way we detect global where-bounds.
262262 pub ( super ) fn canonicalize_input < P : TypeFoldable < I > > (
263263 delegate : & ' a D ,
264- input : QueryInput < I , P > ,
264+ Goal { param_env, predicate } : Goal < I , P > ,
265+ predefined_opaques_in_body : Vec < ( ty:: OpaqueTypeKey < I > , I :: Ty ) > ,
266+ pseudo_rigid_due_to_opaques : Vec < ( I :: Ty , ty:: PseudoRigidDueToOpaquesBound < I > ) > ,
265267 ) -> ( ThinVec < I :: GenericArg > , ty:: Canonical < I , QueryInput < I , P > > ) {
266268 // First canonicalize the `param_env` while keeping `'static`. This produces a
267269 // canonicalizer that can canonicalize the rest of the input without keeping `'static`.
268- let ( param_env, mut rest_canonicalizer) =
269- Self :: canonicalize_param_env ( delegate, input. goal . param_env ) ;
270+ let ( param_env, mut rest_canonicalizer) = Self :: canonicalize_param_env ( delegate, param_env) ;
270271
271- let predicate = input. goal . predicate ;
272272 let predicate = predicate. fold_with ( & mut rest_canonicalizer) ;
273273 let goal = Goal { param_env, predicate } ;
274274
275- let predefined_opaques_in_body = input. predefined_opaques_in_body ;
276275 let predefined_opaques_in_body =
277276 if predefined_opaques_in_body. has_type_flags ( NEEDS_CANONICAL ) {
278277 predefined_opaques_in_body. fold_with ( & mut rest_canonicalizer)
279278 } else {
280279 predefined_opaques_in_body
281280 } ;
281+ let predefined_opaques_in_body =
282+ delegate. cx ( ) . mk_predefined_opaques_in_body ( & predefined_opaques_in_body) ;
282283
283284 let pseudo_rigid_due_to_opaques = rest_canonicalizer
284- . filter_and_canonicalize_pseudo_rigids_due_to_opaques (
285- input. pseudo_rigid_due_to_opaques . to_vec ( ) ,
286- ) ;
285+ . filter_and_canonicalize_pseudo_rigids_due_to_opaques ( pseudo_rigid_due_to_opaques) ;
287286
288287 let value = QueryInput { goal, predefined_opaques_in_body, pseudo_rigid_due_to_opaques } ;
289-
290288 debug_assert ! ( !value. has_infer( ) , "unexpected infer in {value:?}" ) ;
291289 debug_assert ! ( !value. has_placeholders( ) , "unexpected placeholders in {value:?}" ) ;
290+
292291 let ( max_universe, variables, var_kinds) = rest_canonicalizer. finalize ( ) ;
293292 ( variables, Canonical { max_universe, var_kinds, value } )
294293 }
0 commit comments