Skip to content

Commit b8eace2

Browse files
committed
Fix hard lifetime error
``` error[E0478]: lifetime bound not satisfied --> compiler/rustc_infer/src/infer/nll_relate/mod.rs:794:8 | 794 | D: TypeRelatingDelegate<'cx, 'tcx>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: lifetime parameter instantiated with the lifetime `'tcx` as defined on the struc t at 792:29 --> compiler/rustc_infer/src/infer/nll_relate/mod.rs:792:29 | 792 | struct TypeGeneralizer<'cx, 'tcx, D> | ^^^^ note: but lifetime parameter must outlive the lifetime `'cx` as defined on the struct at 792:24 --> compiler/rustc_infer/src/infer/nll_relate/mod.rs:792:24 | 792 | struct TypeGeneralizer<'cx, 'tcx, D> | ^^^ ```
1 parent 8edda7e commit b8eace2

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_infer/src/infer/nll_relate

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
791791
/// [blog post]: https://is.gd/0hKvIr
792792
struct TypeGeneralizer<'cx, 'tcx, D>
793793
where
794+
'tcx: 'cx,
794795
D: TypeRelatingDelegate<'cx, 'tcx>,
795796
{
796797
_tcx: PhantomData<(&'cx (), &'tcx ())>,
@@ -813,9 +814,9 @@ where
813814
universe: ty::UniverseIndex,
814815
}
815816

816-
impl<D> TypeRelation<'tcx> for TypeGeneralizer<'me, 'tcx, D>
817+
impl<D> TypeRelation<'tcx> for TypeGeneralizer<'cx, 'tcx, D>
817818
where
818-
D: TypeRelatingDelegate<'me, 'tcx>,
819+
D: TypeRelatingDelegate<'cx, 'tcx>,
819820
{
820821
fn tcx(&self) -> TyCtxt<'tcx> {
821822
self.delegate.infcx().tcx

0 commit comments

Comments
 (0)