rename Unevaluated to UnevaluatedConst
This commit is contained in:
parent
efb908991b
commit
a705e65605
35 changed files with 121 additions and 91 deletions
|
@ -1,6 +1,6 @@
|
|||
use rustc_errors::{fluent, ErrorGuaranteed, Handler, IntoDiagnostic};
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_middle::ty::{PolyTraitRef, Ty, Unevaluated};
|
||||
use rustc_middle::ty::{self, PolyTraitRef, Ty};
|
||||
use rustc_session::Limit;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
|
@ -18,7 +18,7 @@ pub struct DumpVTableEntries<'a> {
|
|||
pub struct UnableToConstructConstantValue<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub unevaluated: Unevaluated<'a>,
|
||||
pub unevaluated: ty::UnevaluatedConst<'a>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
|
|
@ -138,7 +138,7 @@ impl<'tcx> ConstUnifyCtxt<'tcx> {
|
|||
#[instrument(skip(tcx), level = "debug")]
|
||||
pub fn try_unify_abstract_consts<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
(a, b): (ty::Unevaluated<'tcx>, ty::Unevaluated<'tcx>),
|
||||
(a, b): (ty::UnevaluatedConst<'tcx>, ty::UnevaluatedConst<'tcx>),
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
) -> bool {
|
||||
(|| {
|
||||
|
@ -161,7 +161,7 @@ pub fn try_unify_abstract_consts<'tcx>(
|
|||
#[instrument(skip(infcx), level = "debug")]
|
||||
pub fn is_const_evaluatable<'cx, 'tcx>(
|
||||
infcx: &InferCtxt<'cx, 'tcx>,
|
||||
uv: ty::Unevaluated<'tcx>,
|
||||
uv: ty::UnevaluatedConst<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
span: Span,
|
||||
) -> Result<(), NotConstEvaluatable> {
|
||||
|
|
|
@ -840,7 +840,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeVisitable<'tcx>>(
|
|||
|
||||
fn visit_ty_unevaluated(
|
||||
&mut self,
|
||||
uv: ty::Unevaluated<'tcx>,
|
||||
uv: ty::UnevaluatedConst<'tcx>,
|
||||
) -> ControlFlow<Self::BreakTy> {
|
||||
// Constants can only influence object safety if they reference `Self`.
|
||||
// This is only possible for unevaluated constants, so we walk these here.
|
||||
|
|
|
@ -2141,7 +2141,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
|
|||
let identity_substs =
|
||||
crate::traits::InternalSubsts::identity_for_item(tcx, assoc_ty.item.def_id);
|
||||
let did = ty::WithOptConstParam::unknown(assoc_ty.item.def_id);
|
||||
let kind = ty::ConstKind::Unevaluated(ty::Unevaluated::new(did, identity_substs));
|
||||
let kind = ty::ConstKind::Unevaluated(ty::UnevaluatedConst::new(did, identity_substs));
|
||||
ty.map_bound(|ty| tcx.mk_const(ty::ConstS { ty, kind }).into())
|
||||
} else {
|
||||
ty.map_bound(|ty| ty.into())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue