move required_consts check to general post-mono-check function
This commit is contained in:
@@ -949,8 +949,10 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
use rustc_middle::mir::interpret::ErrorHandled;
|
||||
match self.infcx.try_const_eval_resolve(param_env, unevaluated, ty, None) {
|
||||
Ok(ct) => Some(ct),
|
||||
Err(ErrorHandled::Reported(e)) => Some(ty::Const::new_error(self.tcx(), e.into(), ty)),
|
||||
Err(ErrorHandled::TooGeneric) => None,
|
||||
Err(ErrorHandled::Reported(e, _)) => {
|
||||
Some(ty::Const::new_error(self.tcx(), e.into(), ty))
|
||||
}
|
||||
Err(ErrorHandled::TooGeneric(_)) => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user