1
Fork 0

clean up some const error reporting around promoteds

This commit is contained in:
Ralf Jung 2021-01-24 12:50:30 +01:00
parent 4d0dd02ee0
commit 48f9dbfd59
18 changed files with 66 additions and 144 deletions

View file

@ -30,12 +30,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
.tcx()
.const_eval_resolve(ty::ParamEnv::reveal_all(), def, substs, promoted, None)
.map_err(|err| {
if promoted.is_none() {
self.cx
.tcx()
.sess
.span_err(constant.span, "erroneous constant encountered");
}
self.cx.tcx().sess.span_err(constant.span, "erroneous constant encountered");
err
}),
ty::ConstKind::Value(value) => Ok(value),