Skip to content

Commit 175345b

Browse files
committed
Fix tests on traits.
1 parent da093d7 commit 175345b

File tree

3 files changed

+107
-99
lines changed

3 files changed

+107
-99
lines changed

compiler/rustc_incremental/src/persist/dirty_clean.rs

+7-14
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ const LABELS_FN_IN_TRAIT: &[&[&str]] =
100100
/// For generic cases like inline-assembly, modules, etc.
101101
const LABELS_HIR_ONLY: &[&[&str]] = &[BASE_HIR];
102102

103+
/// Impl `DepNode`s.
104+
const LABELS_TRAIT: &[&[&str]] = &[
105+
BASE_HIR,
106+
&[label_strs::associated_item_def_ids, label_strs::predicates_of, label_strs::generics_of],
107+
];
108+
103109
/// Impl `DepNode`s.
104110
const LABELS_IMPL: &[&[&str]] = &[BASE_HIR, BASE_IMPL];
105111

@@ -259,20 +265,7 @@ impl DirtyCleanVisitor<'tcx> {
259265
HirItem::Union(..) => ("ItemUnion", LABELS_ADT),
260266

261267
// Represents a Trait Declaration
262-
// FIXME(michaelwoerister): trait declaration is buggy because sometimes some of
263-
// the depnodes don't exist (because they legitimately didn't need to be
264-
// calculated)
265-
//
266-
// michaelwoerister and vitiral came up with a possible solution,
267-
// to just do this before every query
268-
// ```
269-
// ::rustc_middle::ty::query::plumbing::force_from_dep_node(tcx, dep_node)
270-
// ```
271-
//
272-
// However, this did not seem to work effectively and more bugs were hit.
273-
// Nebie @vitiral gave up :)
274-
//
275-
//HirItem::Trait(..) => ("ItemTrait", LABELS_TRAIT),
268+
HirItem::Trait(..) => ("ItemTrait", LABELS_TRAIT),
276269

277270
// An implementation, eg `impl<A> Trait for Foo { .. }`
278271
HirItem::Impl { .. } => ("ItemKind::Impl", LABELS_IMPL),

0 commit comments

Comments
 (0)