mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Unroll while_capturing_lifetimes into lower_opaque_impl_trait
This commit is contained in:
parent
0f11a0cd24
commit
84a24a1b3c
@ -1376,11 +1376,21 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
let hir_bounds = if origin == hir::OpaqueTyOrigin::TyAlias {
|
||||
lower_bounds(lctx)
|
||||
} else {
|
||||
lctx.while_capturing_lifetimes(
|
||||
opaque_ty_def_id,
|
||||
&mut collected_lifetimes,
|
||||
lower_bounds,
|
||||
)
|
||||
let lifetime_stash = std::mem::replace(
|
||||
&mut lctx.captured_lifetimes,
|
||||
Some(LifetimeCaptureContext {
|
||||
parent_def_id: opaque_ty_def_id,
|
||||
captures: std::mem::take(&mut collected_lifetimes),
|
||||
binders_to_ignore: Default::default(),
|
||||
}),
|
||||
);
|
||||
|
||||
let ret = lower_bounds(lctx);
|
||||
|
||||
let ctxt = std::mem::replace(&mut lctx.captured_lifetimes, lifetime_stash).unwrap();
|
||||
collected_lifetimes = ctxt.captures;
|
||||
|
||||
ret
|
||||
};
|
||||
debug!(?collected_lifetimes);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user