File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -854,16 +854,12 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
854
854
Some ( actual_e) => actual_e,
855
855
None => signal ! ( e, NonConstPath )
856
856
} ;
857
- let item_hint = if let UncheckedExprNoHint = ty_hint {
858
- match const_ty {
859
- Some ( ty) => match ast_ty_to_prim_ty ( tcx, ty) {
860
- Some ( ty) => UncheckedExprHint ( ty) ,
861
- None => UncheckedExprNoHint
862
- } ,
863
- None => UncheckedExprNoHint
864
- }
865
- } else {
866
- ty_hint
857
+ let item_hint = match const_ty {
858
+ Some ( ty) => match ast_ty_to_prim_ty ( tcx, ty) {
859
+ Some ( ty) => ty_hint. checked_or ( ty) ,
860
+ None => ty_hint. erase_hint ( ) ,
861
+ } ,
862
+ None => ty_hint. erase_hint ( ) ,
867
863
} ;
868
864
try!( eval_const_expr_partial ( tcx, const_expr, item_hint, fn_args) )
869
865
}
You can’t perform that action at this time.
0 commit comments