diff options
| author | lcnr <rust@lcnr.de> | 2022-05-16 15:41:05 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-05-16 15:41:05 +0200 |
| commit | 0ea7301fa34719f1dd26b8e0dfaeeab73c67599a (patch) | |
| tree | d2c78d73f74d307bcddb0d3a32e816168f5a38d1 | |
| parent | 9ad4bde042cfaf56f7579160c60ebd8550a720ab (diff) | |
| download | rust-0ea7301fa34719f1dd26b8e0dfaeeab73c67599a.tar.gz rust-0ea7301fa34719f1dd26b8e0dfaeeab73c67599a.zip | |
remove the `RelateResultCompare` trait
| -rw-r--r-- | compiler/rustc_infer/src/infer/combine.rs | 15 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/nll_relate/mod.rs | 2 |
2 files changed, 1 insertions, 16 deletions
diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index aa3f0600ccc..534106ac446 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -776,21 +776,6 @@ pub trait ConstEquateRelation<'tcx>: TypeRelation<'tcx> { fn const_equate_obligation(&mut self, a: ty::Const<'tcx>, b: ty::Const<'tcx>); } -pub trait RelateResultCompare<'tcx, T> { - fn compare<F>(&self, t: T, f: F) -> RelateResult<'tcx, T> - where - F: FnOnce() -> TypeError<'tcx>; -} - -impl<'tcx, T: Clone + PartialEq> RelateResultCompare<'tcx, T> for RelateResult<'tcx, T> { - fn compare<F>(&self, t: T, f: F) -> RelateResult<'tcx, T> - where - F: FnOnce() -> TypeError<'tcx>, - { - self.clone().and_then(|s| if s == t { self.clone() } else { Err(f()) }) - } -} - pub fn const_unification_error<'tcx>( a_is_expected: bool, (a, b): (ty::Const<'tcx>, ty::Const<'tcx>), diff --git a/compiler/rustc_infer/src/infer/nll_relate/mod.rs b/compiler/rustc_infer/src/infer/nll_relate/mod.rs index 94a795f613e..6592e0ae8ec 100644 --- a/compiler/rustc_infer/src/infer/nll_relate/mod.rs +++ b/compiler/rustc_infer/src/infer/nll_relate/mod.rs @@ -859,7 +859,7 @@ where delegate: &'me mut D, - /// After we generalize this type, we are going to relative it to + /// After we generalize this type, we are going to relate it to /// some other type. What will be the variance at this point? ambient_variance: ty::Variance, |
