diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 21d3fb54e9d..f8233cac393 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -435,7 +435,7 @@ mod resolve { use super::InferenceTable; use crate::{ ConcreteConst, Const, ConstData, ConstValue, DebruijnIndex, GenericArg, InferenceVar, - Interner, Ty, TyVariableKind, VariableKind, + Interner, Lifetime, Ty, TyVariableKind, VariableKind, }; use chalk_ir::{ cast::Cast, @@ -524,5 +524,17 @@ fn fold_inference_const( }; Ok(result) } + + fn fold_inference_lifetime( + &mut self, + _var: InferenceVar, + _outer_binder: DebruijnIndex, + ) -> Fallible { + // fall back all lifetimes to 'static -- currently we don't deal + // with any lifetimes, but we can sometimes get some lifetime + // variables through Chalk's unification, and this at least makes + // sure we don't leak them outside of inference + Ok(crate::static_lifetime()) + } } }