Skip to content

Commit cf5f5c5

Browse files
Use separate files for debugging Qualif dataflow results
1 parent cd24cd4 commit cf5f5c5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/librustc_mir/transform/check_consts/qualifs.rs

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ impl QualifSet {
2727
pub trait Qualif {
2828
const IDX: usize;
2929

30+
/// The name of the file used to debug the dataflow analysis that computes this qualif.
31+
const ANALYSIS_NAME: &'static str;
32+
3033
/// Whether this `Qualif` is cleared when a local is moved from.
3134
const IS_CLEARED_ON_MOVE: bool = false;
3235

@@ -207,6 +210,7 @@ pub struct HasMutInterior;
207210

208211
impl Qualif for HasMutInterior {
209212
const IDX: usize = 0;
213+
const ANALYSIS_NAME: &'static str = "flow_has_mut_interior";
210214

211215
fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
212216
!ty.is_freeze(cx.tcx, cx.param_env, DUMMY_SP)
@@ -264,6 +268,7 @@ pub struct NeedsDrop;
264268

265269
impl Qualif for NeedsDrop {
266270
const IDX: usize = 1;
271+
const ANALYSIS_NAME: &'static str = "flow_needs_drop";
267272
const IS_CLEARED_ON_MOVE: bool = true;
268273

269274
fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {

src/librustc_mir/transform/check_consts/resolver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ where
309309
{
310310
type Idx = Local;
311311

312-
const NAME: &'static str = "flow_sensitive_qualif";
312+
const NAME: &'static str = Q::ANALYSIS_NAME;
313313

314314
fn bits_per_block(&self, body: &mir::Body<'tcx>) -> usize {
315315
body.local_decls.len()

0 commit comments

Comments
 (0)