@@ -378,6 +378,8 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
378
378
goal : Goal < ' tcx , Self > ,
379
379
) -> QueryResult < ' tcx > {
380
380
let tcx = ecx. tcx ( ) ;
381
+ let metadata_def_id = tcx. require_lang_item ( LangItem :: Metadata , None ) ;
382
+ assert_eq ! ( metadata_def_id, goal. predicate. def_id( ) ) ;
381
383
ecx. probe_misc_candidate ( "builtin pointee" ) . enter ( |ecx| {
382
384
let metadata_ty = match goal. predicate . self_ty ( ) . kind ( ) {
383
385
ty:: Bool
@@ -422,30 +424,16 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
422
424
423
425
ty:: Adt ( def, args) if def. is_struct ( ) => match def. non_enum_variant ( ) . tail_opt ( ) {
424
426
None => tcx. types . unit ,
425
- Some ( field_def) => {
426
- let self_ty = field_def. ty ( tcx, args) ;
427
- // FIXME(-Znext-solver=coinductive): Should this be `GoalSource::ImplWhereBound`?
428
- ecx. add_goal (
429
- GoalSource :: Misc ,
430
- goal. with ( tcx, goal. predicate . with_self_ty ( tcx, self_ty) ) ,
431
- ) ;
432
- return ecx
433
- . evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes ) ;
427
+ Some ( tail_def) => {
428
+ let tail_ty = tail_def. ty ( tcx, args) ;
429
+ Ty :: new_projection ( tcx, metadata_def_id, [ tail_ty] )
434
430
}
435
431
} ,
436
432
ty:: Adt ( _, _) => tcx. types . unit ,
437
433
438
434
ty:: Tuple ( elements) => match elements. last ( ) {
439
435
None => tcx. types . unit ,
440
- Some ( & self_ty) => {
441
- // FIXME(-Znext-solver=coinductive): Should this be `GoalSource::ImplWhereBound`?
442
- ecx. add_goal (
443
- GoalSource :: Misc ,
444
- goal. with ( tcx, goal. predicate . with_self_ty ( tcx, self_ty) ) ,
445
- ) ;
446
- return ecx
447
- . evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes ) ;
448
- }
436
+ Some ( & tail_ty) => Ty :: new_projection ( tcx, metadata_def_id, [ tail_ty] ) ,
449
437
} ,
450
438
451
439
ty:: Infer (
0 commit comments