Pass in dep kind names to the duplicate dep node check
This commit is contained in:
parent
f5dc674bf8
commit
68fd771bc1
7 changed files with 38 additions and 10 deletions
|
@ -100,6 +100,8 @@ pub trait Deps {
|
|||
where
|
||||
OP: for<'a> FnOnce(TaskDepsRef<'a>);
|
||||
|
||||
fn name(&self, dep_kind: DepKind) -> &'static str;
|
||||
|
||||
/// We use this for most things when incr. comp. is turned off.
|
||||
const DEP_KIND_NULL: DepKind;
|
||||
|
||||
|
@ -154,7 +156,7 @@ pub enum FingerprintStyle {
|
|||
|
||||
impl FingerprintStyle {
|
||||
#[inline]
|
||||
pub fn reconstructible(self) -> bool {
|
||||
pub const fn reconstructible(self) -> bool {
|
||||
match self {
|
||||
FingerprintStyle::DefPathHash | FingerprintStyle::Unit | FingerprintStyle::HirId => {
|
||||
true
|
||||
|
|
|
@ -179,8 +179,8 @@ fn mask(bits: usize) -> usize {
|
|||
}
|
||||
|
||||
impl SerializedDepGraph {
|
||||
#[instrument(level = "debug", skip(d))]
|
||||
pub fn decode<D: Deps>(d: &mut MemDecoder<'_>) -> Arc<SerializedDepGraph> {
|
||||
#[instrument(level = "debug", skip(d, deps))]
|
||||
pub fn decode<D: Deps>(d: &mut MemDecoder<'_>, deps: &D) -> Arc<SerializedDepGraph> {
|
||||
// The last 16 bytes are the node count and edge count.
|
||||
debug!("position: {:?}", d.position());
|
||||
let (node_count, edge_count) =
|
||||
|
@ -253,8 +253,9 @@ impl SerializedDepGraph {
|
|||
|
||||
for (idx, node) in nodes.iter_enumerated() {
|
||||
if index[node.kind.as_usize()].insert(node.hash, idx).is_some() {
|
||||
let name = deps.name(node.kind);
|
||||
panic!(
|
||||
"Error: A dep graph node does not have an unique index. \
|
||||
"Error: A dep graph node ({name}) does not have an unique index. \
|
||||
Running a clean build on a nightly compiler with `-Z incremental-verify-ich` \
|
||||
can help narrow down the issue for reporting. A clean build may also work around the issue.\n
|
||||
DepNode: {node:?}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue