Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable -Zdrop-tracking-mir by default #107421

Merged
merged 11 commits into from
Sep 23, 2023
Prev Previous commit
Next Next commit
Enable drop_tracking_mir by default.
  • Loading branch information
cjgillot committed Sep 23, 2023
commit 286502c9ed77e49aea5bb89cf18c5eda3a8fce92
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) {
oli-obk marked this conversation as resolved.
Show resolved Hide resolved
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