@@ -573,7 +573,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
573
573
self . require_type_is_sized_deferred (
574
574
input,
575
575
span,
576
- traits :: SizedArgumentType ( None ) ,
576
+ ObligationCauseCode :: SizedArgumentType ( None ) ,
577
577
) ;
578
578
}
579
579
}
@@ -591,7 +591,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
591
591
self . require_type_is_sized_deferred (
592
592
output,
593
593
call. map_or ( expr. span , |e| e. span ) ,
594
- traits :: SizedCallReturnType ,
594
+ ObligationCauseCode :: SizedCallReturnType ,
595
595
) ;
596
596
}
597
597
@@ -1249,7 +1249,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1249
1249
}
1250
1250
} ) ;
1251
1251
1252
- self . require_type_is_sized ( lhs_ty, lhs. span , traits :: AssignmentLhsSized ) ;
1252
+ self . require_type_is_sized ( lhs_ty, lhs. span , ObligationCauseCode :: AssignmentLhsSized ) ;
1253
1253
1254
1254
if let Err ( guar) = ( lhs_ty, rhs_ty) . error_reported ( ) {
1255
1255
Ty :: new_error ( self . tcx , guar)
@@ -1471,7 +1471,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1471
1471
crate :: GatherLocalsVisitor :: new ( & fcx) . visit_body ( body) ;
1472
1472
1473
1473
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 ) ;
1475
1475
fcx. write_ty ( block. hir_id , ty) ;
1476
1476
ty
1477
1477
}
@@ -1517,7 +1517,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1517
1517
1518
1518
let ty = Ty :: new_array_with_const_len ( tcx, t, count) ;
1519
1519
1520
- self . register_wf_obligation ( ty. into ( ) , expr. span , traits :: WellFormed ( None ) ) ;
1520
+ self . register_wf_obligation ( ty. into ( ) , expr. span , ObligationCauseCode :: WellFormed ( None ) ) ;
1521
1521
1522
1522
ty
1523
1523
}
@@ -1607,7 +1607,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1607
1607
if let Err ( guar) = tuple. error_reported ( ) {
1608
1608
Ty :: new_error ( self . tcx , guar)
1609
1609
} 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
+ ) ;
1611
1615
tuple
1612
1616
}
1613
1617
}
@@ -1646,7 +1650,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1646
1650
base_expr,
1647
1651
) ;
1648
1652
1649
- self . require_type_is_sized ( adt_ty, expr. span , traits :: StructInitializerSized ) ;
1653
+ self . require_type_is_sized ( adt_ty, expr. span , ObligationCauseCode :: StructInitializerSized ) ;
1650
1654
adt_ty
1651
1655
}
1652
1656
@@ -3079,7 +3083,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3079
3083
polarity : ty:: PredicatePolarity :: Positive ,
3080
3084
} ) ,
3081
3085
|derived| {
3082
- traits :: ImplDerivedObligation ( Box :: new (
3086
+ ObligationCauseCode :: ImplDerivedObligation ( Box :: new (
3083
3087
traits:: ImplDerivedObligationCause {
3084
3088
derived,
3085
3089
impl_or_alias_def_id : impl_def_id,
@@ -3177,7 +3181,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3177
3181
fn check_expr_asm_operand ( & self , expr : & ' tcx hir:: Expr < ' tcx > , is_input : bool ) {
3178
3182
let needs = if is_input { Needs :: None } else { Needs :: MutPlace } ;
3179
3183
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 ) ;
3181
3185
3182
3186
if !is_input && !expr. is_syntactic_place_expr ( ) {
3183
3187
self . dcx ( )
@@ -3348,7 +3352,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3348
3352
let field_ty = self . field_ty ( expr. span , field, args) ;
3349
3353
3350
3354
// 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
+ ) ;
3352
3360
3353
3361
if field. vis . is_accessible_from ( sub_def_scope, self . tcx ) {
3354
3362
self . tcx . check_stability ( field. did , Some ( expr. hir_id ) , expr. span , None ) ;
@@ -3376,7 +3384,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3376
3384
let field_ty = self . field_ty ( expr. span , field, args) ;
3377
3385
3378
3386
// 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
+ ) ;
3380
3392
3381
3393
if field. vis . is_accessible_from ( def_scope, self . tcx ) {
3382
3394
self . tcx . check_stability ( field. did , Some ( expr. hir_id ) , expr. span , None ) ;
@@ -3397,7 +3409,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3397
3409
&& field. name == sym:: integer ( index)
3398
3410
{
3399
3411
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
+ ) ;
3401
3417
}
3402
3418
if let Some ( & field_ty) = tys. get ( index) {
3403
3419
field_indices. push ( ( FIRST_VARIANT , index. into ( ) ) ) ;
0 commit comments