@@ -584,13 +584,9 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
584584
585585 DefiningTy :: FnDef ( _, substs) => substs,
586586
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.
592589 DefiningTy :: Const ( _) => {
593- assert ! ( identity_substs. is_empty( ) ) ;
594590 identity_substs
595591 }
596592 } ;
@@ -654,9 +650,8 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
654650 sig. inputs_and_output ( )
655651 }
656652
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).
660655 DefiningTy :: Const ( ty) => ty:: Binder :: dummy ( tcx. mk_type_list ( iter:: once ( ty) ) ) ,
661656 }
662657 }
0 commit comments