diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-02-17 13:28:06 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-03-28 16:57:45 +0000 |
| commit | 1163aa7e72bc69b76cb68177fa4f83a66a6034cc (patch) | |
| tree | c3ffe7ad686652f0fb9643350bd3c2d1fc1d803e /compiler/rustc_trait_selection/src/traits | |
| parent | 86e1860495403ee0154608e51fe4b4d81203e15f (diff) | |
| download | rust-1163aa7e72bc69b76cb68177fa4f83a66a6034cc.tar.gz rust-1163aa7e72bc69b76cb68177fa4f83a66a6034cc.zip | |
Remove opaque type obligation and just register opaque types as they are encountered.
This also registers obligations for the hidden type immediately.
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
6 files changed, 0 insertions, 41 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index ee8b3a62453..ee9983ee8b8 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -865,7 +865,6 @@ impl<'tcx> AutoTraitFinder<'tcx> { | ty::PredicateKind::Subtype(..) | ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::Coerce(..) - | ty::PredicateKind::OpaqueType(..) | ty::PredicateKind::TypeWellFormedFromEnv(..) => {} }; } 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 218abdd573d..468c7a3c55b 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -797,10 +797,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { span, "TypeWellFormedFromEnv predicate should only exist in the environment" ), - - ty::PredicateKind::OpaqueType(..) => { - todo!("{:#?}", obligation); - } } } diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index d55d06ebbf4..1b862834467 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -413,9 +413,6 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> { ty::PredicateKind::TypeWellFormedFromEnv(..) => { bug!("TypeWellFormedFromEnv is only used for Chalk") } - ty::PredicateKind::OpaqueType(..) => { - todo!("{:#?}", obligation); - } }, Some(pred) => match pred { ty::PredicateKind::Trait(data) => { @@ -665,20 +662,6 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> { ty::PredicateKind::TypeWellFormedFromEnv(..) => { bug!("TypeWellFormedFromEnv is only used for Chalk") } - ty::PredicateKind::OpaqueType(a, b) => { - match self.selcx.infcx().handle_opaque_type( - a, - b, - &obligation.cause, - obligation.param_env, - ) { - Ok(value) => ProcessResult::Changed(mk_pending(value.obligations)), - Err(err) => ProcessResult::Error(FulfillmentErrorCode::CodeSubtypeError( - ExpectedFound::new(true, a, b), - err, - )), - } - } }, } } diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs index eab207600ab..6cceec86213 100644 --- a/compiler/rustc_trait_selection/src/traits/object_safety.rs +++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs @@ -313,7 +313,6 @@ fn predicate_references_self<'tcx>( | ty::PredicateKind::Coerce(..) | ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEquate(..) - | ty::PredicateKind::OpaqueType(..) | ty::PredicateKind::TypeWellFormedFromEnv(..) => None, } } @@ -345,7 +344,6 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool { | ty::PredicateKind::TypeOutlives(..) | ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEquate(..) - | ty::PredicateKind::OpaqueType(..) | ty::PredicateKind::TypeWellFormedFromEnv(..) => false, } }) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 76526df6461..42f17721f9b 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -673,19 +673,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ty::PredicateKind::TypeWellFormedFromEnv(..) => { bug!("TypeWellFormedFromEnv is only used for chalk") } - ty::PredicateKind::OpaqueType(a, b) => { - match self.infcx().handle_opaque_type( - a, - b, - &obligation.cause, - obligation.param_env, - ) { - Ok(res) => { - self.evaluate_predicates_recursively(previous_stack, res.obligations) - } - Err(_) => Ok(EvaluatedToErr), - } - } } }); diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index 2ac68cea544..b4ed5b95b10 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -148,10 +148,6 @@ pub fn predicate_obligations<'a, 'tcx>( wf.compute(c1.into()); wf.compute(c2.into()); } - ty::PredicateKind::OpaqueType(opaque, ty) => { - wf.compute(opaque.into()); - wf.compute(ty.into()); - } ty::PredicateKind::TypeWellFormedFromEnv(..) => { bug!("TypeWellFormedFromEnv is only used for Chalk") } |
