clean up some const error reporting around promoteds
This commit is contained in:
parent
4d0dd02ee0
commit
48f9dbfd59
18 changed files with 66 additions and 144 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue