Skip to content

Commit bbf98df

Browse files
authored
Rollup merge of rust-lang#97080 - lcnr:relate-sus, r=oli-obk
remove the `RelateResultCompare` trait it's unused
2 parents b2af261 + 0ea7301 commit bbf98df

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

compiler/rustc_infer/src/infer/combine.rs

-15
Original file line numberDiff line numberDiff line change
@@ -776,21 +776,6 @@ pub trait ConstEquateRelation<'tcx>: TypeRelation<'tcx> {
776776
fn const_equate_obligation(&mut self, a: ty::Const<'tcx>, b: ty::Const<'tcx>);
777777
}
778778

779-
pub trait RelateResultCompare<'tcx, T> {
780-
fn compare<F>(&self, t: T, f: F) -> RelateResult<'tcx, T>
781-
where
782-
F: FnOnce() -> TypeError<'tcx>;
783-
}
784-
785-
impl<'tcx, T: Clone + PartialEq> RelateResultCompare<'tcx, T> for RelateResult<'tcx, T> {
786-
fn compare<F>(&self, t: T, f: F) -> RelateResult<'tcx, T>
787-
where
788-
F: FnOnce() -> TypeError<'tcx>,
789-
{
790-
self.clone().and_then(|s| if s == t { self.clone() } else { Err(f()) })
791-
}
792-
}
793-
794779
pub fn const_unification_error<'tcx>(
795780
a_is_expected: bool,
796781
(a, b): (ty::Const<'tcx>, ty::Const<'tcx>),

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ where
859859

860860
delegate: &'me mut D,
861861

862-
/// After we generalize this type, we are going to relative it to
862+
/// After we generalize this type, we are going to relate it to
863863
/// some other type. What will be the variance at this point?
864864
ambient_variance: ty::Variance,
865865

0 commit comments

Comments
 (0)