Skip to content

tracking issue for rustc_dirty/clean enhancements #45009

Closed
@vitiral

Description

@vitiral

cc @michaelwoerister

this is partof #44924

I started this work in #44983, but I would like to break it out into three separate pull requests.

This feature will make it so that rustc_clean(except="foo,bar") will assert that ALL DefNode's are clean (which is different depending on which def-node it is) except for the ones given in except= (which it asserts are dirty)

Example syntax:

#[rustc_clean(except="Hir,HirBody,TypeOfItem", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
struct Abc { ... }

Instead of how it is currently done:

#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="TypeOfItem", cfg="cfail2")]
#[rustc_clean(label="GenericsOfItem", cfg="cfail2")]
#[rustc_clean(label="PredicatesOfItem", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="TypeOfItem", cfg="cfail3")]
#[rustc_clean(label="GenericsOfItem", cfg="cfail3")]
#[rustc_clean(label="PredicatesOfItem", cfg="cfail3")]
struct Abc { ... }

This should make testing incr-compilation more complete, less boilerplate and easier to read (but also an itty bit more magic)

This work is split into three parts:

  1. groundwork for rustc_clean/dirty improvements #44983: allow multiple nodes in label= to support that functionality in except in the future. This requires a couple of changes to librustc, so I want to merge it separately.
  2. Incremental compilation auto assert (with except) #45104 add except= and detect the DefNode and do correct assertions. Also use it in a couple of test files (continue to support label=)
  3. depricate label= and remove from all tests.

Item 1 adds rustc::dep_graph::dep_node::label_strs so that we can specify groups in this way:

const STRUCT_NODES: &'static str = [
    label_strs.Hir,
    label_strs.HirBody,
    label_strs.TypeOfItem,
    label_strs.GenericsOfItem
    label_strs.PredicatesOfItem
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationA-testsuiteArea: The testsuite used to check the correctness of rustcC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions