remove TypeWellFormedFromEnv
This commit is contained in:
parent
c6fcbaae0f
commit
0c73b41cd6
@ -983,8 +983,7 @@ fn conv_object_ty_poly_trait_ref(
|
||||
ty::ClauseKind::RegionOutlives(_)
|
||||
| ty::ClauseKind::ConstArgHasType(..)
|
||||
| ty::ClauseKind::WellFormed(_)
|
||||
| ty::ClauseKind::ConstEvaluatable(_)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => {
|
||||
| ty::ClauseKind::ConstEvaluatable(_) => {
|
||||
bug!()
|
||||
}
|
||||
}
|
||||
|
@ -551,7 +551,6 @@ fn trait_predicate_kind<'tcx>(
|
||||
| ty::PredicateKind::ClosureKind(..)
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..))
|
||||
| ty::PredicateKind::ConstEquate(..)
|
||||
| ty::PredicateKind::Ambiguous
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => None,
|
||||
| ty::PredicateKind::Ambiguous => None,
|
||||
}
|
||||
}
|
||||
|
@ -53,8 +53,7 @@ pub(crate) fn explicit_predicates_of(
|
||||
| ty::ClauseKind::Projection(_)
|
||||
| ty::ClauseKind::ConstArgHasType(_, _)
|
||||
| ty::ClauseKind::WellFormed(_)
|
||||
| ty::ClauseKind::ConstEvaluatable(_)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => {}
|
||||
| ty::ClauseKind::ConstEvaluatable(_) => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -685,7 +685,7 @@ pub(in super::super) fn obligations_for_self_ty<'b>(
|
||||
// inference variable.
|
||||
| ty::PredicateKind::ClosureKind(..)
|
||||
| ty::PredicateKind::Ambiguous
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => None,
|
||||
=> None,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -847,8 +847,7 @@ fn assemble_inherent_candidates_from_param(&mut self, param_ty: ty::ParamTy) {
|
||||
| ty::ClauseKind::Projection(_)
|
||||
| ty::ClauseKind::ConstArgHasType(_, _)
|
||||
| ty::ClauseKind::WellFormed(_)
|
||||
| ty::ClauseKind::ConstEvaluatable(_)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => None,
|
||||
| ty::ClauseKind::ConstEvaluatable(_) => None,
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -31,8 +31,7 @@ pub fn explicit_outlives_bounds<'tcx>(
|
||||
| ty::ClauseKind::Projection(_)
|
||||
| ty::ClauseKind::ConstArgHasType(_, _)
|
||||
| ty::ClauseKind::WellFormed(_)
|
||||
| ty::ClauseKind::ConstEvaluatable(_)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => None,
|
||||
| ty::ClauseKind::ConstEvaluatable(_) => None,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -370,9 +370,6 @@ fn elaborate(&mut self, elaboratable: &O) {
|
||||
}),
|
||||
);
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
// Nothing to elaborate
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => {}
|
||||
ty::PredicateKind::AliasRelate(..) => {
|
||||
// No
|
||||
|
@ -1606,8 +1606,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
|
||||
// Ignore bounds that a user can't type
|
||||
| ClauseKind::WellFormed(..)
|
||||
// FIXME(generic_const_exprs): `ConstEvaluatable` can be written
|
||||
| ClauseKind::ConstEvaluatable(..)
|
||||
| ClauseKind::TypeWellFormedFromEnv(_) => continue,
|
||||
| ClauseKind::ConstEvaluatable(..) => continue,
|
||||
};
|
||||
if predicate.is_global() {
|
||||
cx.emit_spanned_lint(
|
||||
|
@ -287,9 +287,6 @@ fn add_predicate_atom(&mut self, atom: ty::PredicateKind<'_>) {
|
||||
self.add_const(expected);
|
||||
self.add_const(found);
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(ty)) => {
|
||||
self.add_ty(ty);
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => {}
|
||||
ty::PredicateKind::AliasRelate(t1, t2, _) => {
|
||||
self.add_term(t1);
|
||||
|
@ -554,8 +554,7 @@ pub fn allow_normalization(self) -> bool {
|
||||
| PredicateKind::Coerce(_)
|
||||
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(_))
|
||||
| PredicateKind::ConstEquate(_, _)
|
||||
| PredicateKind::Ambiguous
|
||||
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(_)) => true,
|
||||
| PredicateKind::Ambiguous => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -661,11 +660,6 @@ pub enum ClauseKind<'tcx> {
|
||||
|
||||
/// Constant initializer must evaluate successfully.
|
||||
ConstEvaluatable(ty::Const<'tcx>),
|
||||
|
||||
/// Represents a type found in the environment that we can use for implied bounds.
|
||||
///
|
||||
/// Only used for Chalk.
|
||||
TypeWellFormedFromEnv(Ty<'tcx>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)]
|
||||
@ -1424,8 +1418,7 @@ pub fn to_opt_poly_trait_pred(self) -> Option<PolyTraitPredicate<'tcx>> {
|
||||
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
|
||||
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
|
||||
| PredicateKind::ConstEquate(..)
|
||||
| PredicateKind::Ambiguous
|
||||
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(..)) => None,
|
||||
| PredicateKind::Ambiguous => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1445,8 +1438,7 @@ pub fn to_opt_poly_projection_pred(self) -> Option<PolyProjectionPredicate<'tcx>
|
||||
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
|
||||
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
|
||||
| PredicateKind::ConstEquate(..)
|
||||
| PredicateKind::Ambiguous
|
||||
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(..)) => None,
|
||||
| PredicateKind::Ambiguous => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1466,8 +1458,7 @@ pub fn to_opt_type_outlives(self) -> Option<PolyTypeOutlivesPredicate<'tcx>> {
|
||||
| PredicateKind::ClosureKind(..)
|
||||
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
|
||||
| PredicateKind::ConstEquate(..)
|
||||
| PredicateKind::Ambiguous
|
||||
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(..)) => None,
|
||||
| PredicateKind::Ambiguous => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2888,9 +2888,6 @@ pub struct PrintClosureAsImpl<'tcx> {
|
||||
ty::ClauseKind::ConstEvaluatable(ct) => {
|
||||
p!("the constant `", print(ct), "` can be evaluated")
|
||||
}
|
||||
ty::ClauseKind::TypeWellFormedFromEnv(ty) => {
|
||||
p!("the type `", print(ty), "` is found in the environment")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,9 +189,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
ty::ClauseKind::ConstEvaluatable(ct) => {
|
||||
write!(f, "ConstEvaluatable({ct:?})")
|
||||
}
|
||||
ty::ClauseKind::TypeWellFormedFromEnv(ty) => {
|
||||
write!(f, "TypeWellFormedFromEnv({:?})", ty)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,6 @@ fn visit_clause(&mut self, clause: ty::Clause<'tcx>) -> ControlFlow<V::BreakTy>
|
||||
}
|
||||
ty::ClauseKind::ConstEvaluatable(ct) => ct.visit_with(self),
|
||||
ty::ClauseKind::WellFormed(arg) => arg.visit_with(self),
|
||||
ty::ClauseKind::TypeWellFormedFromEnv(_) => bug!("unexpected clause: {clause}"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -435,9 +435,6 @@ fn compute_goal(&mut self, goal: Goal<'tcx, ty::Predicate<'tcx>>) -> QueryResult
|
||||
ty::PredicateKind::ConstEquate(_, _) => {
|
||||
bug!("ConstEquate should not be emitted when `-Ztrait-solver=next` is active")
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
bug!("TypeWellFormedFromEnv is only used for Chalk")
|
||||
}
|
||||
ty::PredicateKind::AliasRelate(lhs, rhs, direction) => self
|
||||
.compute_alias_relate_goal(Goal {
|
||||
param_env,
|
||||
|
@ -836,9 +836,6 @@ fn evaluate_nested_obligations(
|
||||
// FIXME(generic_const_exprs): you can absolutely add this as a where clauses
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..))
|
||||
| ty::PredicateKind::Coerce(..) => {}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
bug!("predicate should only exist in the environment: {bound_predicate:?}")
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => return false,
|
||||
};
|
||||
}
|
||||
|
@ -1094,13 +1094,6 @@ fn report_selection_error(
|
||||
|
||||
ty::PredicateKind::Ambiguous => span_bug!(span, "ambiguous"),
|
||||
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
span_bug!(
|
||||
span,
|
||||
"TypeWellFormedFromEnv predicate should only exist in the environment"
|
||||
)
|
||||
}
|
||||
|
||||
ty::PredicateKind::AliasRelate(..) => span_bug!(
|
||||
span,
|
||||
"AliasRelate predicate should never be the predicate cause of a SelectionError"
|
||||
|
@ -359,9 +359,6 @@ fn process_obligation(
|
||||
ProcessResult::Changed(mk_pending(vec![obligation.with(infcx.tcx, pred)]))
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => ProcessResult::Unchanged,
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
bug!("TypeWellFormedFromEnv is only used for Chalk")
|
||||
}
|
||||
ty::PredicateKind::AliasRelate(..) => {
|
||||
bug!("AliasRelate is only used for new solver")
|
||||
}
|
||||
@ -627,9 +624,6 @@ fn process_obligation(
|
||||
}
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => ProcessResult::Unchanged,
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
bug!("TypeWellFormedFromEnv is only used for Chalk")
|
||||
}
|
||||
ty::PredicateKind::AliasRelate(..) => {
|
||||
bug!("AliasRelate is only used for new solver")
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ fn predicate_references_self<'tcx>(
|
||||
| ty::ClauseKind::RegionOutlives(..)
|
||||
// FIXME(generic_const_exprs): this can mention `Self`
|
||||
| ty::ClauseKind::ConstEvaluatable(..)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => None,
|
||||
=> None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,8 +351,7 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
||||
| ty::ClauseKind::Projection(_)
|
||||
| ty::ClauseKind::ConstArgHasType(_, _)
|
||||
| ty::ClauseKind::WellFormed(_)
|
||||
| ty::ClauseKind::ConstEvaluatable(_)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => false,
|
||||
| ty::ClauseKind::ConstEvaluatable(_) => false,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ pub fn compute_implied_outlives_bounds_inner<'tcx>(
|
||||
| ty::PredicateKind::ConstEquate(..)
|
||||
| ty::PredicateKind::Ambiguous
|
||||
| ty::PredicateKind::AliasRelate(..)
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {}
|
||||
=> {}
|
||||
|
||||
// We need to search through *all* WellFormed predicates
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => {
|
||||
|
@ -972,9 +972,6 @@ fn evaluate_predicate_recursively<'o>(
|
||||
}
|
||||
}
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
bug!("TypeWellFormedFromEnv is only used for chalk")
|
||||
}
|
||||
ty::PredicateKind::AliasRelate(..) => {
|
||||
bug!("AliasRelate is only used for new solver")
|
||||
}
|
||||
|
@ -184,8 +184,7 @@ pub fn predicate_obligations<'tcx>(
|
||||
| ty::PredicateKind::Coerce(..)
|
||||
| ty::PredicateKind::ConstEquate(..)
|
||||
| ty::PredicateKind::Ambiguous
|
||||
| ty::PredicateKind::AliasRelate(..)
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
|
||||
| ty::PredicateKind::AliasRelate(..) => {
|
||||
bug!("We should only wf check where clauses, unexpected predicate: {predicate:?}")
|
||||
}
|
||||
}
|
||||
@ -1005,8 +1004,7 @@ pub(crate) fn required_region_bounds<'tcx>(
|
||||
| ty::ClauseKind::Projection(_)
|
||||
| ty::ClauseKind::ConstArgHasType(_, _)
|
||||
| ty::ClauseKind::WellFormed(_)
|
||||
| ty::ClauseKind::ConstEvaluatable(_)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(_) => None,
|
||||
| ty::ClauseKind::ConstEvaluatable(_) => None,
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
|
@ -69,7 +69,6 @@ fn not_outlives_predicate(p: ty::Predicate<'_>) -> bool {
|
||||
| ty::PredicateKind::Coerce(..)
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..))
|
||||
| ty::PredicateKind::ConstEquate(..)
|
||||
| ty::PredicateKind::Ambiguous
|
||||
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => true,
|
||||
| ty::PredicateKind::Ambiguous => true,
|
||||
}
|
||||
}
|
||||
|
@ -342,8 +342,7 @@ pub(crate) fn clean_predicate<'tcx>(
|
||||
// FIXME(generic_const_exprs): should this do something?
|
||||
ty::ClauseKind::ConstEvaluatable(..)
|
||||
| ty::ClauseKind::WellFormed(..)
|
||||
| ty::ClauseKind::ConstArgHasType(..)
|
||||
| ty::ClauseKind::TypeWellFormedFromEnv(..) => None,
|
||||
| ty::ClauseKind::ConstArgHasType(..) => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user