Skip to content

Commit

Permalink
Remove unnecessary StructurallyRelateAliases from CombineFields/TypeR…
Browse files Browse the repository at this point in the history
…elating
  • Loading branch information
compiler-errors committed Oct 10, 2024
1 parent 3da257a commit 30a2ecd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions compiler/rustc_infer/src/infer/at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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)?;
Expand All @@ -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)?;
Expand Down Expand Up @@ -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)?;
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_infer/src/infer/relate/type_relating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -57,15 +56,13 @@ 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 {
infcx,
trace,
param_env,
define_opaque_types,
structurally_relate_aliases,
ambient_variance,
obligations: vec![],
cache: Default::default(),
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 30a2ecd

Please sign in to comment.