Use options instead of errors if the errors are never needed
This commit is contained in:
parent
09b89efa70
commit
46cce98134
2 changed files with 11 additions and 13 deletions
|
@ -53,7 +53,7 @@ pub fn provide(providers: &mut Providers) {
|
|||
const_eval::eval_to_valtree(tcx, param_env, raw)
|
||||
};
|
||||
providers.try_destructure_mir_constant =
|
||||
|tcx, (cv, ty)| const_eval::try_destructure_mir_constant(tcx, cv, ty).ok();
|
||||
|tcx, (cv, ty)| const_eval::try_destructure_mir_constant(tcx, cv, ty);
|
||||
providers.valtree_to_const_val = |tcx, (ty, valtree)| {
|
||||
const_eval::valtree_to_const_value(tcx, ty::ParamEnv::empty().and(ty), valtree)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue