diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-04 13:07:34 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-10 06:07:52 -0400 |
| commit | 30a2ecddb45f30dc62946770ef88df115f194b17 (patch) | |
| tree | 463a0bbe02a22d8efe1577c76871f13b61eae05a | |
| parent | 3da257a98d44efb5f1a7df2e4237935bcf0f2b92 (diff) | |
| download | rust-30a2ecddb45f30dc62946770ef88df115f194b17.tar.gz rust-30a2ecddb45f30dc62946770ef88df115f194b17.zip | |
Remove unnecessary StructurallyRelateAliases from CombineFields/TypeRelating
| -rw-r--r-- | compiler/rustc_infer/src/infer/at.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/type_relating.rs | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_infer/src/infer/at.rs b/compiler/rustc_infer/src/infer/at.rs index ee9f548c1d4..1b99effabc0 100644 --- a/compiler/rustc_infer/src/infer/at.rs +++ b/compiler/rustc_infer/src/infer/at.rs @@ -31,7 +31,7 @@ use rustc_middle::ty::{Const, ImplSubject}; use super::*; use crate::infer::relate::type_relating::TypeRelating; -use crate::infer::relate::{Relate, StructurallyRelateAliases, TypeRelation}; +use crate::infer::relate::{Relate, TypeRelation}; /// Whether we should define opaque types or just treat them opaquely. /// @@ -114,7 +114,6 @@ impl<'a, 'tcx> At<'a, 'tcx> { ToTrace::to_trace(self.cause, expected, actual), self.param_env, define_opaque_types, - StructurallyRelateAliases::No, ty::Contravariant, ); op.relate(expected, actual)?; @@ -136,7 +135,6 @@ impl<'a, 'tcx> At<'a, 'tcx> { ToTrace::to_trace(self.cause, expected, actual), self.param_env, define_opaque_types, - StructurallyRelateAliases::No, ty::Covariant, ); op.relate(expected, actual)?; @@ -177,7 +175,6 @@ impl<'a, 'tcx> At<'a, 'tcx> { trace, self.param_env, define_opaque_types, - StructurallyRelateAliases::No, ty::Invariant, ); op.relate(expected, actual)?; diff --git a/compiler/rustc_infer/src/infer/relate/type_relating.rs b/compiler/rustc_infer/src/infer/relate/type_relating.rs index d2dc4589103..6129faf3d50 100644 --- a/compiler/rustc_infer/src/infer/relate/type_relating.rs +++ b/compiler/rustc_infer/src/infer/relate/type_relating.rs @@ -21,7 +21,6 @@ pub(crate) struct TypeRelating<'infcx, 'tcx> { trace: TypeTrace<'tcx>, param_env: ty::ParamEnv<'tcx>, define_opaque_types: DefineOpaqueTypes, - structurally_relate_aliases: StructurallyRelateAliases, // Mutable fields. ambient_variance: ty::Variance, @@ -57,7 +56,6 @@ impl<'infcx, 'tcx> TypeRelating<'infcx, 'tcx> { trace: TypeTrace<'tcx>, param_env: ty::ParamEnv<'tcx>, define_opaque_types: DefineOpaqueTypes, - structurally_relate_aliases: StructurallyRelateAliases, ambient_variance: ty::Variance, ) -> TypeRelating<'infcx, 'tcx> { TypeRelating { @@ -65,7 +63,6 @@ impl<'infcx, 'tcx> TypeRelating<'infcx, 'tcx> { trace, param_env, define_opaque_types, - structurally_relate_aliases, ambient_variance, obligations: vec![], cache: Default::default(), @@ -353,7 +350,7 @@ impl<'tcx> PredicateEmittingRelation<InferCtxt<'tcx>> for TypeRelating<'_, 'tcx> } fn structurally_relate_aliases(&self) -> StructurallyRelateAliases { - self.structurally_relate_aliases + StructurallyRelateAliases::No } fn register_predicates( |
