Skip to content

Commit 11ae334

Browse files
committed
Remove a function that doesn't actually do anything
1 parent f42e490 commit 11ae334

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

compiler/rustc_borrowck/src/type_check/relate_tys.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_infer::infer::NllRegionVariableOrigin;
33
use rustc_infer::traits::PredicateObligations;
44
use rustc_middle::mir::ConstraintCategory;
55
use rustc_middle::ty::relate::TypeRelation;
6-
use rustc_middle::ty::{self, Const, Ty};
6+
use rustc_middle::ty::{self, Ty};
77
use rustc_span::Span;
88
use rustc_trait_selection::traits::query::Fallible;
99

@@ -140,13 +140,6 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
140140
);
141141
}
142142

143-
// We don't have to worry about the equality of consts during borrow checking
144-
// as consts always have a static lifetime.
145-
// FIXME(oli-obk): is this really true? We can at least have HKL and with
146-
// inline consts we may have further lifetimes that may be unsound to treat as
147-
// 'static.
148-
fn const_equate(&mut self, _a: Const<'tcx>, _b: Const<'tcx>) {}
149-
150143
fn normalization() -> NormalizationStrategy {
151144
NormalizationStrategy::Eager
152145
}

compiler/rustc_infer/src/infer/canonical/query_response.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_middle::mir::ConstraintCategory;
2626
use rustc_middle::ty::fold::TypeFoldable;
2727
use rustc_middle::ty::relate::TypeRelation;
2828
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
29-
use rustc_middle::ty::{self, BoundVar, Const, ToPredicate, Ty, TyCtxt};
29+
use rustc_middle::ty::{self, BoundVar, ToPredicate, Ty, TyCtxt};
3030
use rustc_span::Span;
3131
use std::fmt::Debug;
3232
use std::iter;
@@ -728,10 +728,6 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
728728
});
729729
}
730730

731-
fn const_equate(&mut self, _a: Const<'tcx>, _b: Const<'tcx>) {
732-
span_bug!(self.cause.span(), "generic_const_exprs: unreachable `const_equate`");
733-
}
734-
735731
fn normalization() -> NormalizationStrategy {
736732
NormalizationStrategy::Eager
737733
}

compiler/rustc_infer/src/infer/nll_relate/mod.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ pub trait TypeRelatingDelegate<'tcx> {
9292
info: ty::VarianceDiagInfo<'tcx>,
9393
);
9494

95-
fn const_equate(&mut self, a: ty::Const<'tcx>, b: ty::Const<'tcx>);
9695
fn register_obligations(&mut self, obligations: Vec<PredicateObligation<'tcx>>);
9796

9897
/// Creates a new universe index. Used when instantiating placeholders.
@@ -812,8 +811,12 @@ impl<'tcx, D> ConstEquateRelation<'tcx> for TypeRelating<'_, 'tcx, D>
812811
where
813812
D: TypeRelatingDelegate<'tcx>,
814813
{
815-
fn const_equate_obligation(&mut self, a: ty::Const<'tcx>, b: ty::Const<'tcx>) {
816-
self.delegate.const_equate(a, b);
814+
fn const_equate_obligation(&mut self, _a: ty::Const<'tcx>, _b: ty::Const<'tcx>) {
815+
// We don't have to worry about the equality of consts during borrow checking
816+
// as consts always have a static lifetime.
817+
// FIXME(oli-obk): is this really true? We can at least have HKL and with
818+
// inline consts we may have further lifetimes that may be unsound to treat as
819+
// 'static.
817820
}
818821
}
819822

0 commit comments

Comments
 (0)