Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
clean up some const error reporting around promoteds These are some error reporting simplifications enabled by https://github.com/rust-lang/rust/pull/80579. Further simplifications are possible but could be blocked on making `const_err` a hard error. r? ``````@oli-obk``````
This commit is contained in:
commit
046a414c19
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