This commit is contained in:
parent
af2ed1b518
commit
1f130fbff8
1 changed files with 19 additions and 14 deletions
|
@ -185,21 +185,26 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
// match x { _ => () } // fake read of `x`
|
// match x { _ => () } // fake read of `x`
|
||||||
// };
|
// };
|
||||||
// ```
|
// ```
|
||||||
for (thir_place, cause, hir_id) in fake_reads.into_iter() {
|
//
|
||||||
let place_builder =
|
// FIXME(RFC2229, rust#85435): Remove feature gate once diagnostics are
|
||||||
unpack!(block = this.as_place_builder(block, &this.thir[*thir_place]));
|
// improved and unsafe checking works properly in closure bodies again.
|
||||||
|
if this.tcx.features().capture_disjoint_fields {
|
||||||
|
for (thir_place, cause, hir_id) in fake_reads.into_iter() {
|
||||||
|
let place_builder =
|
||||||
|
unpack!(block = this.as_place_builder(block, &this.thir[*thir_place]));
|
||||||
|
|
||||||
if let Ok(place_builder_resolved) =
|
if let Ok(place_builder_resolved) =
|
||||||
place_builder.try_upvars_resolved(this.tcx, this.typeck_results)
|
place_builder.try_upvars_resolved(this.tcx, this.typeck_results)
|
||||||
{
|
{
|
||||||
let mir_place =
|
let mir_place =
|
||||||
place_builder_resolved.into_place(this.tcx, this.typeck_results);
|
place_builder_resolved.into_place(this.tcx, this.typeck_results);
|
||||||
this.cfg.push_fake_read(
|
this.cfg.push_fake_read(
|
||||||
block,
|
block,
|
||||||
this.source_info(this.tcx.hir().span(*hir_id)),
|
this.source_info(this.tcx.hir().span(*hir_id)),
|
||||||
*cause,
|
*cause,
|
||||||
mir_place,
|
mir_place,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue