@@ -2409,9 +2409,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
24092409 . map ( |elem| self . lower_const_arg ( elem, * elem_ty) )
24102410 . collect :: < Vec < _ > > ( ) ;
24112411
2412- let valtree = ty:: ValTree :: from_branches ( tcx, elems) ;
2413-
2414- ty:: Const :: new_value ( tcx, valtree, ty)
2412+ ty:: Const :: new_value_from_branches ( tcx, elems, ty)
24152413 }
24162414
24172415 fn lower_const_arg_tuple_call (
@@ -2509,9 +2507,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
25092507 None
25102508 } ;
25112509
2512- let valtree = ty:: ValTree :: from_branches ( tcx, opt_discr_const. into_iter ( ) . chain ( fields) ) ;
2513- let adt_ty = Ty :: new_adt ( tcx, adt_def, adt_args) ;
2514- ty:: Const :: new_value ( tcx, valtree, adt_ty)
2510+ ty:: Const :: new_value_from_branches (
2511+ tcx,
2512+ opt_discr_const. into_iter ( ) . chain ( fields) ,
2513+ Ty :: new_adt ( tcx, adt_def, adt_args) ,
2514+ )
25152515 }
25162516
25172517 fn lower_const_arg_tup (
@@ -2537,8 +2537,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
25372537 . map ( |( expr, ty) | self . lower_const_arg ( expr, ty) )
25382538 . collect :: < Vec < _ > > ( ) ;
25392539
2540- let valtree = ty:: ValTree :: from_branches ( tcx, exprs) ;
2541- ty:: Const :: new_value ( tcx, valtree, ty)
2540+ ty:: Const :: new_value_from_branches ( tcx, exprs, ty)
25422541 }
25432542
25442543 fn lower_const_arg_struct (
@@ -2680,8 +2679,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
26802679 None
26812680 } ;
26822681
2683- let valtree = ty:: ValTree :: from_branches ( tcx, opt_discr_const. into_iter ( ) . chain ( fields) ) ;
2684- ty:: Const :: new_value ( tcx, valtree, ty)
2682+ ty:: Const :: new_value_from_branches ( tcx, opt_discr_const. into_iter ( ) . chain ( fields) , ty)
26852683 }
26862684
26872685 pub fn lower_path_for_struct_expr (
0 commit comments