Skip to content

Commit

Permalink
Enable drop_tracking_mir by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Sep 23, 2023
1 parent a626caa commit 286502c
Show file tree
Hide file tree
Showing 29 changed files with 114 additions and 2,513 deletions.
9 changes: 1 addition & 8 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,13 +1579,7 @@ fn opaque_type_cycle_error(
label_match(capture.place.ty(), capture.get_path_span(tcx));
}
// Label any generator locals that capture the opaque
for interior_ty in
typeck_results.generator_interior_types.as_ref().skip_binder()
{
label_match(interior_ty.ty, interior_ty.span);
}
if tcx.sess.opts.unstable_opts.drop_tracking_mir
&& let DefKind::Generator = tcx.def_kind(closure_def_id)
if let DefKind::Generator = tcx.def_kind(closure_def_id)
&& let Some(generator_layout) = tcx.mir_generator_witnesses(closure_def_id)
{
for interior_ty in &generator_layout.field_tys {
Expand All @@ -1603,7 +1597,6 @@ fn opaque_type_cycle_error(
}

pub(super) fn check_generator_obligations(tcx: TyCtxt<'_>, def_id: LocalDefId) {
debug_assert!(tcx.sess.opts.unstable_opts.drop_tracking_mir);
debug_assert!(matches!(tcx.def_kind(def_id), DefKind::Generator));

let typeck = tcx.typeck(def_id);
Expand Down
20 changes: 1 addition & 19 deletions compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,25 +510,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}

pub(in super::super) fn resolve_generator_interiors(&self, def_id: DefId) {
if self.tcx.sess.opts.unstable_opts.drop_tracking_mir {
self.save_generator_interior_predicates(def_id);
return;
}

self.select_obligations_where_possible(|_| {});

let mut generators = self.deferred_generator_interiors.borrow_mut();
for (generator_def_id, body_id, interior, kind) in generators.drain(..) {
crate::generator_interior::resolve_interior(
self,
def_id,
generator_def_id,
body_id,
interior,
kind,
);
self.select_obligations_where_possible(|_| {});
}
self.save_generator_interior_predicates(def_id);
}

/// Unify the inference variables corresponding to generator witnesses, and save all the
Expand Down
Loading

0 comments on commit 286502c

Please sign in to comment.