@@ -573,7 +573,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
573573 self . require_type_is_sized_deferred (
574574 input,
575575 span,
576- traits :: SizedArgumentType ( None ) ,
576+ ObligationCauseCode :: SizedArgumentType ( None ) ,
577577 ) ;
578578 }
579579 }
@@ -591,7 +591,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
591591 self . require_type_is_sized_deferred (
592592 output,
593593 call. map_or ( expr. span , |e| e. span ) ,
594- traits :: SizedCallReturnType ,
594+ ObligationCauseCode :: SizedCallReturnType ,
595595 ) ;
596596 }
597597
@@ -1249,7 +1249,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12491249 }
12501250 } ) ;
12511251
1252- self . require_type_is_sized ( lhs_ty, lhs. span , traits :: AssignmentLhsSized ) ;
1252+ self . require_type_is_sized ( lhs_ty, lhs. span , ObligationCauseCode :: AssignmentLhsSized ) ;
12531253
12541254 if let Err ( guar) = ( lhs_ty, rhs_ty) . error_reported ( ) {
12551255 Ty :: new_error ( self . tcx , guar)
@@ -1471,7 +1471,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14711471 crate :: GatherLocalsVisitor :: new ( & fcx) . visit_body ( body) ;
14721472
14731473 let ty = fcx. check_expr_with_expectation ( body. value , expected) ;
1474- fcx. require_type_is_sized ( ty, body. value . span , traits :: ConstSized ) ;
1474+ fcx. require_type_is_sized ( ty, body. value . span , ObligationCauseCode :: ConstSized ) ;
14751475 fcx. write_ty ( block. hir_id , ty) ;
14761476 ty
14771477 }
@@ -1517,7 +1517,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15171517
15181518 let ty = Ty :: new_array_with_const_len ( tcx, t, count) ;
15191519
1520- self . register_wf_obligation ( ty. into ( ) , expr. span , traits :: WellFormed ( None ) ) ;
1520+ self . register_wf_obligation ( ty. into ( ) , expr. span , ObligationCauseCode :: WellFormed ( None ) ) ;
15211521
15221522 ty
15231523 }
@@ -1607,7 +1607,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16071607 if let Err ( guar) = tuple. error_reported ( ) {
16081608 Ty :: new_error ( self . tcx , guar)
16091609 } else {
1610- self . require_type_is_sized ( tuple, expr. span , traits:: TupleInitializerSized ) ;
1610+ self . require_type_is_sized (
1611+ tuple,
1612+ expr. span ,
1613+ ObligationCauseCode :: TupleInitializerSized ,
1614+ ) ;
16111615 tuple
16121616 }
16131617 }
@@ -1646,7 +1650,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16461650 base_expr,
16471651 ) ;
16481652
1649- self . require_type_is_sized ( adt_ty, expr. span , traits :: StructInitializerSized ) ;
1653+ self . require_type_is_sized ( adt_ty, expr. span , ObligationCauseCode :: StructInitializerSized ) ;
16501654 adt_ty
16511655 }
16521656
@@ -3079,7 +3083,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30793083 polarity : ty:: PredicatePolarity :: Positive ,
30803084 } ) ,
30813085 |derived| {
3082- traits :: ImplDerivedObligation ( Box :: new (
3086+ ObligationCauseCode :: ImplDerivedObligation ( Box :: new (
30833087 traits:: ImplDerivedObligationCause {
30843088 derived,
30853089 impl_or_alias_def_id : impl_def_id,
@@ -3177,7 +3181,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
31773181 fn check_expr_asm_operand ( & self , expr : & ' tcx hir:: Expr < ' tcx > , is_input : bool ) {
31783182 let needs = if is_input { Needs :: None } else { Needs :: MutPlace } ;
31793183 let ty = self . check_expr_with_needs ( expr, needs) ;
3180- self . require_type_is_sized ( ty, expr. span , traits :: InlineAsmSized ) ;
3184+ self . require_type_is_sized ( ty, expr. span , ObligationCauseCode :: InlineAsmSized ) ;
31813185
31823186 if !is_input && !expr. is_syntactic_place_expr ( ) {
31833187 self . dcx ( )
@@ -3348,7 +3352,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
33483352 let field_ty = self . field_ty ( expr. span , field, args) ;
33493353
33503354 // FIXME: DSTs with static alignment should be allowed
3351- self . require_type_is_sized ( field_ty, expr. span , traits:: MiscObligation ) ;
3355+ self . require_type_is_sized (
3356+ field_ty,
3357+ expr. span ,
3358+ ObligationCauseCode :: MiscObligation ,
3359+ ) ;
33523360
33533361 if field. vis . is_accessible_from ( sub_def_scope, self . tcx ) {
33543362 self . tcx . check_stability ( field. did , Some ( expr. hir_id ) , expr. span , None ) ;
@@ -3376,7 +3384,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
33763384 let field_ty = self . field_ty ( expr. span , field, args) ;
33773385
33783386 // FIXME: DSTs with static alignment should be allowed
3379- self . require_type_is_sized ( field_ty, expr. span , traits:: MiscObligation ) ;
3387+ self . require_type_is_sized (
3388+ field_ty,
3389+ expr. span ,
3390+ ObligationCauseCode :: MiscObligation ,
3391+ ) ;
33803392
33813393 if field. vis . is_accessible_from ( def_scope, self . tcx ) {
33823394 self . tcx . check_stability ( field. did , Some ( expr. hir_id ) , expr. span , None ) ;
@@ -3397,7 +3409,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
33973409 && field. name == sym:: integer ( index)
33983410 {
33993411 for ty in tys. iter ( ) . take ( index + 1 ) {
3400- self . require_type_is_sized ( ty, expr. span , traits:: MiscObligation ) ;
3412+ self . require_type_is_sized (
3413+ ty,
3414+ expr. span ,
3415+ ObligationCauseCode :: MiscObligation ,
3416+ ) ;
34013417 }
34023418 if let Some ( & field_ty) = tys. get ( index) {
34033419 field_indices. push ( ( FIRST_VARIANT , index. into ( ) ) ) ;
0 commit comments