diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-22 17:43:19 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-26 23:12:04 +0000 |
| commit | 374173cd996b27bfa40c09c5bad32134eda8a7d6 (patch) | |
| tree | 4af8869678988bad29ce558610c274591286940f /compiler/rustc_trait_selection/src | |
| parent | fbdef58414af2b3469bf4f0f83bb136945414b96 (diff) | |
| download | rust-374173cd996b27bfa40c09c5bad32134eda8a7d6.tar.gz rust-374173cd996b27bfa40c09c5bad32134eda8a7d6.zip | |
TypeWellFormedInEnv
Diffstat (limited to 'compiler/rustc_trait_selection/src')
9 files changed, 20 insertions, 16 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs index b42bbf91e90..6aca40b8dbd 100644 --- a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs +++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs @@ -395,7 +395,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> { ty::PredicateKind::ConstEquate(_, _) => { bug!("ConstEquate should not be emitted when `-Ztrait-solver=next` is active") } - ty::PredicateKind::TypeWellFormedFromEnv(..) => { + ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { bug!("TypeWellFormedFromEnv is only used for Chalk") } ty::PredicateKind::AliasRelate(lhs, rhs, direction) => self diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs index f8f1239d5b4..5c62ea64f99 100644 --- a/compiler/rustc_trait_selection/src/solve/fulfill.rs +++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs @@ -132,8 +132,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> { SelectionError::Unimplemented, ) } - ty::PredicateKind::ConstEquate(..) - | ty::PredicateKind::TypeWellFormedFromEnv(_) => { + ty::PredicateKind::ConstEquate(..) => { bug!("unexpected goal: {goal:?}") } }, diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 05e9793130f..fb6bf7211b9 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -836,7 +836,7 @@ impl<'tcx> AutoTraitFinder<'tcx> { // FIXME(generic_const_exprs): you can absolutely add this as a where clauses | ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..)) | ty::PredicateKind::Coerce(..) => {} - ty::PredicateKind::TypeWellFormedFromEnv(..) => { + ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { bug!("predicate should only exist in the environment: {bound_predicate:?}") } ty::PredicateKind::Ambiguous => return false, diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 557341f7ac8..f93d6b1ce88 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -1094,10 +1094,12 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { ty::PredicateKind::Ambiguous => span_bug!(span, "ambiguous"), - ty::PredicateKind::TypeWellFormedFromEnv(..) => span_bug!( - span, - "TypeWellFormedFromEnv predicate should only exist in the environment" - ), + ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { + span_bug!( + span, + "TypeWellFormedFromEnv predicate should only exist in the environment" + ) + } ty::PredicateKind::AliasRelate(..) => span_bug!( span, diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index 7c5260fc67b..f2f99eb60e4 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -366,7 +366,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> { ProcessResult::Changed(mk_pending(vec![obligation.with(infcx.tcx, pred)])) } ty::PredicateKind::Ambiguous => ProcessResult::Unchanged, - ty::PredicateKind::TypeWellFormedFromEnv(..) => { + ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { bug!("TypeWellFormedFromEnv is only used for Chalk") } ty::PredicateKind::AliasRelate(..) => { @@ -634,7 +634,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> { } } ty::PredicateKind::Ambiguous => ProcessResult::Unchanged, - ty::PredicateKind::TypeWellFormedFromEnv(..) => { + ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { bug!("TypeWellFormedFromEnv is only used for Chalk") } ty::PredicateKind::AliasRelate(..) => { diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs index 178cd3d65a2..78270b7d535 100644 --- a/compiler/rustc_trait_selection/src/traits/object_safety.rs +++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs @@ -310,7 +310,8 @@ fn predicate_references_self<'tcx>( | ty::ClauseKind::TypeOutlives(..) | ty::ClauseKind::RegionOutlives(..) // FIXME(generic_const_exprs): this can mention `Self` - | ty::ClauseKind::ConstEvaluatable(..) => None, + | ty::ClauseKind::ConstEvaluatable(..) + | ty::ClauseKind::TypeWellFormedFromEnv(_) => None, } } @@ -350,7 +351,8 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool { | ty::ClauseKind::Projection(_) | ty::ClauseKind::ConstArgHasType(_, _) | ty::ClauseKind::WellFormed(_) - | ty::ClauseKind::ConstEvaluatable(_) => false, + | ty::ClauseKind::ConstEvaluatable(_) + | ty::ClauseKind::TypeWellFormedFromEnv(_) => false, }) } diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs index 7d0dc740cf5..83d536c9ca5 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs @@ -134,7 +134,7 @@ pub fn compute_implied_outlives_bounds_inner<'tcx>( | ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::Ambiguous | ty::PredicateKind::AliasRelate(..) - | ty::PredicateKind::TypeWellFormedFromEnv(..) => {} + | ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {} // We need to search through *all* WellFormed predicates ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => { diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 5bc8fa45879..7406b47e327 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -967,7 +967,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } } } - ty::PredicateKind::TypeWellFormedFromEnv(..) => { + ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { bug!("TypeWellFormedFromEnv is only used for chalk") } ty::PredicateKind::AliasRelate(..) => { diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index 50c72947c26..8bb4288f80d 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -185,7 +185,7 @@ pub fn predicate_obligations<'tcx>( | ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::Ambiguous | ty::PredicateKind::AliasRelate(..) - | ty::PredicateKind::TypeWellFormedFromEnv(..) => { + | ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => { bug!("We should only wf check where clauses, unexpected predicate: {predicate:?}") } } @@ -1005,7 +1005,8 @@ pub(crate) fn required_region_bounds<'tcx>( | ty::ClauseKind::Projection(_) | ty::ClauseKind::ConstArgHasType(_, _) | ty::ClauseKind::WellFormed(_) - | ty::ClauseKind::ConstEvaluatable(_) => None, + | ty::ClauseKind::ConstEvaluatable(_) + | ty::ClauseKind::TypeWellFormedFromEnv(_) => None, } }) .collect() |
