diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index af84e915f70..4a03e32dee8 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -373,28 +373,6 @@ pub fn eq_regions(this: &C, a: ty::Region, b: ty::Region) }) } -pub fn eq_opt_regions( - this: &C, - a: Option, - b: Option) -> cres> { - - match (a, b) { - (None, None) => Ok(None), - (Some(a), Some(b)) => eq_regions(this, a, b).then(|| Ok(Some(a))), - (_, _) => { - // If these two substitutions are for the same type (and - // they should be), then the type should either - // consistently have a region parameter or not have a - // region parameter. - this.infcx().tcx.sess.bug( - format!("substitution a had opt_region {} and \ - b had opt_region {}", - a.inf_str(this.infcx()), - b.inf_str(this.infcx()))); - } - } -} - pub fn super_fn_sigs(this: &C, a: &ty::FnSig, b: &ty::FnSig) -> cres { fn argvecs(this: &C, a_args: &[ty::t], b_args: &[ty::t]) -> cres > {