mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
Test drop_tracking_mir before querying generator. r? `@ghost`
This commit is contained in:
@@ -1415,7 +1415,7 @@ fn encode_mir(&mut self) {
|
||||
if encode_opt {
|
||||
record!(self.tables.optimized_mir[def_id.to_def_id()] <- tcx.optimized_mir(def_id));
|
||||
|
||||
if let DefKind::Generator = self.tcx.def_kind(def_id) && tcx.sess.opts.unstable_opts.drop_tracking_mir {
|
||||
if tcx.sess.opts.unstable_opts.drop_tracking_mir && let DefKind::Generator = self.tcx.def_kind(def_id) {
|
||||
record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- tcx.mir_generator_witnesses(def_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
use rustc_data_structures::fx::FxIndexSet;
|
||||
use rustc_data_structures::steal::Steal;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
use rustc_hir::intravisit::{self, Visitor};
|
||||
use rustc_index::vec::IndexVec;
|
||||
@@ -430,7 +431,9 @@ fn mir_drops_elaborated_and_const_checked(
|
||||
return tcx.mir_drops_elaborated_and_const_checked(def);
|
||||
}
|
||||
|
||||
if tcx.generator_kind(def.did).is_some() && tcx.sess.opts.unstable_opts.drop_tracking_mir {
|
||||
if tcx.sess.opts.unstable_opts.drop_tracking_mir
|
||||
&& let DefKind::Generator = tcx.def_kind(def.did)
|
||||
{
|
||||
tcx.ensure().mir_generator_witnesses(def.did);
|
||||
}
|
||||
let mir_borrowck = tcx.mir_borrowck_opt_const_arg(def);
|
||||
|
||||
Reference in New Issue
Block a user