diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_typeck/src/check/generator_interior.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_typeck/src/check/generator_interior.rs b/compiler/rustc_typeck/src/check/generator_interior.rs index 56b6dd9a284..c6b92db88ae 100644 --- a/compiler/rustc_typeck/src/check/generator_interior.rs +++ b/compiler/rustc_typeck/src/check/generator_interior.rs @@ -22,6 +22,11 @@ use tracing::debug; mod drop_ranges; +// FIXME(eholk): This flag is here to give a quick way to disable drop tracking in case we find +// unexpected breakages while it's still new. It should be removed before too long. For example, +// see #93161. +const ENABLE_DROP_TRACKING: bool = false; + struct InteriorVisitor<'a, 'tcx> { fcx: &'a FnCtxt<'a, 'tcx>, types: FxIndexSet<ty::GeneratorInteriorTypeCause<'tcx>>, @@ -77,7 +82,10 @@ impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> { yield_data.expr_and_pat_count, self.expr_count, source_span ); - if self.drop_ranges.is_dropped_at(hir_id, yield_data.expr_and_pat_count) + if ENABLE_DROP_TRACKING + && self + .drop_ranges + .is_dropped_at(hir_id, yield_data.expr_and_pat_count) { debug!("value is dropped at yield point; not recording"); return false; |
