@@ -584,13 +584,9 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
584
584
585
585
DefiningTy :: FnDef ( _, substs) => substs,
586
586
587
- // When we encounter other sorts of constant
588
- // expressions, such as the `22` in `[foo; 22]`, we can
589
- // get the type `usize` here. For now, just return an
590
- // empty vector of substs in this case, since there are no
591
- // generics in scope in such expressions right now.
587
+ // When we encounter a constant body, just return whatever
588
+ // substitutions are in scope for that constant.
592
589
DefiningTy :: Const ( _) => {
593
- assert ! ( identity_substs. is_empty( ) ) ;
594
590
identity_substs
595
591
}
596
592
} ;
@@ -654,9 +650,8 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
654
650
sig. inputs_and_output ( )
655
651
}
656
652
657
- // This happens on things like `[foo; 22]`. Hence, no
658
- // inputs, one output, but it seems like we need a more
659
- // general way to handle this category of MIR.
653
+ // For a constant body, there are no inputs, and one
654
+ // "output" (the type of the constant).
660
655
DefiningTy :: Const ( ty) => ty:: Binder :: dummy ( tcx. mk_type_list ( iter:: once ( ty) ) ) ,
661
656
}
662
657
}
0 commit comments