Closed
Description
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:
- groundwork for rustc_clean/dirty improvements #44983: allow multiple nodes in
label=
to support that functionality inexcept
in the future. This requires a couple of changes tolibrustc
, so I want to merge it separately. - Incremental compilation auto assert (with except) #45104 add
except=
and detect theDefNode
and do correct assertions. Also use it in a couple of test files (continue to supportlabel=
)- To do this we want to match on the
Node
enum, which can be gotten fromhir.get
. From there I will construct the expected fields that could change. The initial implementation will just use the ones suggested in incr.comp.: Update fingerprint-based auto tests for red/green tracking. #44924
- To do this we want to match on the
- 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
Labels
Area: Incremental compilationArea: The testsuite used to check the correctness of rustcCategory: An issue tracking the progress of sth. like the implementation of an RFCCall for participation: Help is requested to fix this issue.Relevant to the compiler team, which will review and decide on the PR/issue.