@@ -1475,7 +1475,7 @@ impl<'tcx> InferCtxt<'tcx> {
14751475 param_env : ty:: ParamEnv < ' tcx > ,
14761476 unevaluated : ty:: UnevaluatedConst < ' tcx > ,
14771477 ty : Ty < ' tcx > ,
1478- span : Option < Span > ,
1478+ span : Span ,
14791479 ) -> Result < ty:: Const < ' tcx > , ErrorHandled > {
14801480 match self . const_eval_resolve ( param_env, unevaluated, span) {
14811481 Ok ( Some ( val) ) => Ok ( ty:: Const :: new_value ( self . tcx , val, ty) ) ,
@@ -1509,7 +1509,7 @@ impl<'tcx> InferCtxt<'tcx> {
15091509 & self ,
15101510 mut param_env : ty:: ParamEnv < ' tcx > ,
15111511 unevaluated : ty:: UnevaluatedConst < ' tcx > ,
1512- span : Option < Span > ,
1512+ span : Span ,
15131513 ) -> EvalToValTreeResult < ' tcx > {
15141514 let mut args = self . resolve_vars_if_possible ( unevaluated. args ) ;
15151515 debug ! ( ?args) ;
@@ -1521,12 +1521,9 @@ impl<'tcx> InferCtxt<'tcx> {
15211521 if let Some ( ct) = tcx. thir_abstract_const ( unevaluated. def ) ? {
15221522 let ct = tcx. expand_abstract_consts ( ct. instantiate ( tcx, args) ) ;
15231523 if let Err ( e) = ct. error_reported ( ) {
1524- return Err ( ErrorHandled :: Reported (
1525- e. into ( ) ,
1526- span. unwrap_or ( rustc_span:: DUMMY_SP ) ,
1527- ) ) ;
1524+ return Err ( ErrorHandled :: Reported ( e. into ( ) , span) ) ;
15281525 } else if ct. has_non_region_infer ( ) || ct. has_non_region_param ( ) {
1529- return Err ( ErrorHandled :: TooGeneric ( span. unwrap_or ( rustc_span :: DUMMY_SP ) ) ) ;
1526+ return Err ( ErrorHandled :: TooGeneric ( span) ) ;
15301527 } else {
15311528 args = replace_param_and_infer_args_with_placeholder ( tcx, args) ;
15321529 }
0 commit comments