diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-01-28 12:56:04 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-09-23 13:34:09 +0000 |
| commit | 286502c9ed77e49aea5bb89cf18c5eda3a8fce92 (patch) | |
| tree | 08a01a16ddcbb97325f70ff0677debf33c332065 /compiler/rustc_ty_utils/src | |
| parent | a626caaad97b7f8733b8c9bd1fe9662cfc1e3ec1 (diff) | |
| download | rust-286502c9ed77e49aea5bb89cf18c5eda3a8fce92.tar.gz rust-286502c9ed77e49aea5bb89cf18c5eda3a8fce92.zip | |
Enable drop_tracking_mir by default.
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/needs_drop.rs | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs index 1fc5d9359a4..76d381dd19f 100644 --- a/compiler/rustc_ty_utils/src/needs_drop.rs +++ b/compiler/rustc_ty_utils/src/needs_drop.rs @@ -7,7 +7,7 @@ use rustc_middle::ty::util::{needs_drop_components, AlwaysRequiresDrop}; use rustc_middle::ty::GenericArgsRef; use rustc_middle::ty::{self, EarlyBinder, Ty, TyCtxt}; use rustc_session::Limit; -use rustc_span::{sym, DUMMY_SP}; +use rustc_span::sym; use crate::errors::NeedsDropOverflow; @@ -133,7 +133,7 @@ where // The information required to determine whether a generator has drop is // computed on MIR, while this very method is used to build MIR. // To avoid cycles, we consider that generators always require drop. - ty::Generator(..) if tcx.sess.opts.unstable_opts.drop_tracking_mir => { + ty::Generator(..) => { return Some(Err(AlwaysRequiresDrop)); } @@ -145,29 +145,6 @@ where } } - ty::Generator(def_id, args, _) => { - let args = args.as_generator(); - for upvar in args.upvar_tys() { - queue_type(self, upvar); - } - - let witness = args.witness(); - let interior_tys = match witness.kind() { - &ty::GeneratorWitness(tys) => tcx.erase_late_bound_regions(tys), - _ => { - tcx.sess.delay_span_bug( - tcx.hir().span_if_local(def_id).unwrap_or(DUMMY_SP), - format!("unexpected generator witness type {witness:?}"), - ); - return Some(Err(AlwaysRequiresDrop)); - } - }; - - for interior_ty in interior_tys { - queue_type(self, interior_ty); - } - } - // Check for a `Drop` impl and whether this is a union or // `ManuallyDrop`. If it's a struct or enum without a `Drop` // impl then check whether the field types need `Drop`. |
