From 175345b8640e774089fd89cddc000f677c4fb316 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 15 May 2021 14:38:32 +0200 Subject: [PATCH] Fix tests on traits. --- .../src/persist/dirty_clean.rs | 21 +-- src/test/incremental/hashes/trait_defs.rs | 136 +++++++++--------- src/test/incremental/hashes/trait_impls.rs | 49 ++++--- 3 files changed, 107 insertions(+), 99 deletions(-) diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs index b4963e2e4601..1a08d6e58d26 100644 --- a/compiler/rustc_incremental/src/persist/dirty_clean.rs +++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs @@ -100,6 +100,12 @@ const LABELS_FN_IN_TRAIT: &[&[&str]] = /// For generic cases like inline-assembly, modules, etc. const LABELS_HIR_ONLY: &[&[&str]] = &[BASE_HIR]; +/// Impl `DepNode`s. +const LABELS_TRAIT: &[&[&str]] = &[ + BASE_HIR, + &[label_strs::associated_item_def_ids, label_strs::predicates_of, label_strs::generics_of], +]; + /// Impl `DepNode`s. const LABELS_IMPL: &[&[&str]] = &[BASE_HIR, BASE_IMPL]; @@ -259,20 +265,7 @@ impl DirtyCleanVisitor<'tcx> { HirItem::Union(..) => ("ItemUnion", LABELS_ADT), // Represents a Trait Declaration - // FIXME(michaelwoerister): trait declaration is buggy because sometimes some of - // the depnodes don't exist (because they legitimately didn't need to be - // calculated) - // - // michaelwoerister and vitiral came up with a possible solution, - // to just do this before every query - // ``` - // ::rustc_middle::ty::query::plumbing::force_from_dep_node(tcx, dep_node) - // ``` - // - // However, this did not seem to work effectively and more bugs were hit. - // Nebie @vitiral gave up :) - // - //HirItem::Trait(..) => ("ItemTrait", LABELS_TRAIT), + HirItem::Trait(..) => ("ItemTrait", LABELS_TRAIT), // An implementation, eg `impl Trait for Foo { .. }` HirItem::Impl { .. } => ("ItemKind::Impl", LABELS_IMPL), diff --git a/src/test/incremental/hashes/trait_defs.rs b/src/test/incremental/hashes/trait_defs.rs index 73d836484967..a604ca5ca82d 100644 --- a/src/test/incremental/hashes/trait_defs.rs +++ b/src/test/incremental/hashes/trait_defs.rs @@ -48,7 +48,7 @@ trait TraitAddMethod { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] pub trait TraitAddMethod { fn method(); @@ -63,7 +63,7 @@ trait TraitChangeMethodName { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeMethodName { fn methodChanged(); @@ -81,7 +81,7 @@ trait TraitAddReturnType { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddReturnType { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method() -> u32; } @@ -98,7 +98,7 @@ trait TraitChangeReturnType { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeReturnType { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method() -> u64; } @@ -115,7 +115,7 @@ trait TraitAddParameterToMethod { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddParameterToMethod { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(a: u32); } @@ -138,7 +138,7 @@ trait TraitChangeMethodParameterName { #[rustc_clean(cfg="cfail3")] fn method(b: u32); - #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")] + #[rustc_clean(except="hir_owner_nodes,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn with_default(y: i32) {} } @@ -155,7 +155,7 @@ trait TraitChangeMethodParameterType { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeMethodParameterType { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(a: i64); } @@ -172,7 +172,7 @@ trait TraitChangeMethodParameterTypeRef { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeMethodParameterTypeRef { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(a: &mut i32); } @@ -189,7 +189,7 @@ trait TraitChangeMethodParametersOrder { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeMethodParametersOrder { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(b: i64, a: i32); } @@ -206,7 +206,7 @@ trait TraitAddMethodAutoImplementation { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddMethodAutoImplementation { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method() { } } @@ -221,7 +221,7 @@ trait TraitChangeOrderOfMethods { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeOrderOfMethods { fn method1(); @@ -240,7 +240,7 @@ trait TraitChangeModeSelfRefToMut { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeModeSelfRefToMut { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(&mut self); } @@ -256,7 +256,7 @@ trait TraitChangeModeSelfOwnToMut: Sized { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeModeSelfOwnToMut: Sized { - #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(mut self) {} } @@ -272,7 +272,7 @@ trait TraitChangeModeSelfOwnToRef { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeModeSelfOwnToRef { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(&self); } @@ -289,7 +289,7 @@ trait TraitAddUnsafeModifier { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddUnsafeModifier { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] unsafe fn method(); } @@ -306,7 +306,7 @@ trait TraitAddExternModifier { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddExternModifier { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] extern "C" fn method(); } @@ -323,7 +323,7 @@ trait TraitChangeExternCToRustIntrinsic { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeExternCToRustIntrinsic { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] extern "stdcall" fn method(); } @@ -340,7 +340,7 @@ trait TraitAddTypeParameterToMethod { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTypeParameterToMethod { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,generics_of,predicates_of,type_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(); } @@ -357,7 +357,7 @@ trait TraitAddLifetimeParameterToMethod { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeParameterToMethod { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method<'a>(); } @@ -378,7 +378,7 @@ trait TraitAddTraitBoundToMethodTypeParameter { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTraitBoundToMethodTypeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(); } @@ -395,7 +395,7 @@ trait TraitAddBuiltinBoundToMethodTypeParameter { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddBuiltinBoundToMethodTypeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(); } @@ -412,7 +412,10 @@ trait TraitAddLifetimeBoundToMethodLifetimeParameter { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeBoundToMethodLifetimeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean( + except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", + cfg="cfail2", + )] #[rustc_clean(cfg="cfail3")] fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32); } @@ -429,7 +432,7 @@ trait TraitAddSecondTraitBoundToMethodTypeParameter { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondTraitBoundToMethodTypeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(); } @@ -446,7 +449,7 @@ trait TraitAddSecondBuiltinBoundToMethodTypeParameter { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondBuiltinBoundToMethodTypeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(); } @@ -463,7 +466,10 @@ trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean( + except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", + cfg="cfail2", + )] #[rustc_clean(cfg="cfail3")] fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32); } @@ -480,7 +486,7 @@ trait TraitAddAssociatedType { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddAssociatedType { type Associated; @@ -547,7 +553,7 @@ trait TraitAddDefaultToAssociatedType { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddDefaultToAssociatedType { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] type Associated = ReferenceType0; @@ -563,7 +569,7 @@ trait TraitAddAssociatedConstant { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddAssociatedConstant { const Value: u32; @@ -585,7 +591,7 @@ trait TraitAddInitializerToAssociatedConstant { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddInitializerToAssociatedConstant { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] const Value: u32 = 1; @@ -608,7 +614,7 @@ trait TraitChangeTypeOfAssociatedConstant { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeTypeOfAssociatedConstant { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,type_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] const Value: f64; @@ -624,7 +630,7 @@ trait TraitChangeTypeOfAssociatedConstant { trait TraitAddSuperTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSuperTrait : ReferencedTrait0 { } @@ -635,7 +641,7 @@ trait TraitAddSuperTrait : ReferencedTrait0 { } trait TraitAddBuiltiBound { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddBuiltiBound : Send { } @@ -646,7 +652,7 @@ trait TraitAddBuiltiBound : Send { } trait TraitAddStaticLifetimeBound { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddStaticLifetimeBound : 'static { } @@ -657,7 +663,7 @@ trait TraitAddStaticLifetimeBound : 'static { } trait TraitAddTraitAsSecondBound : ReferencedTrait0 { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { } @@ -665,7 +671,7 @@ trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { } trait TraitAddTraitAsSecondBoundFromBuiltin : Send { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { } @@ -676,7 +682,7 @@ trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { } trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { } @@ -684,7 +690,7 @@ trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { } trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { } @@ -695,7 +701,7 @@ trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { } trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { } @@ -703,7 +709,7 @@ trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { } trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { } @@ -714,7 +720,7 @@ trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { } trait TraitAddTypeParameterToTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTypeParameterToTrait { } @@ -725,7 +731,7 @@ trait TraitAddTypeParameterToTrait { } trait TraitAddLifetimeParameterToTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeParameterToTrait<'a> { } @@ -736,7 +742,7 @@ trait TraitAddLifetimeParameterToTrait<'a> { } trait TraitAddTraitBoundToTypeParameterOfTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTraitBoundToTypeParameterOfTrait { } @@ -747,7 +753,7 @@ trait TraitAddTraitBoundToTypeParameterOfTrait { } trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { } @@ -758,7 +764,7 @@ trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { } trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { } @@ -769,7 +775,7 @@ trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { } trait TraitAddBuiltinBoundToTypeParameterOfTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddBuiltinBoundToTypeParameterOfTrait { } @@ -780,7 +786,7 @@ trait TraitAddBuiltinBoundToTypeParameterOfTrait { } trait TraitAddSecondTypeParameterToTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondTypeParameterToTrait { } @@ -791,7 +797,7 @@ trait TraitAddSecondTypeParameterToTrait { } trait TraitAddSecondLifetimeParameterToTrait<'a> { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { } @@ -802,7 +808,7 @@ trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { } trait TraitAddSecondTraitBoundToTypeParameterOfTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondTraitBoundToTypeParameterOfTrait { } @@ -813,7 +819,7 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { } @@ -824,7 +830,7 @@ trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { } trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { } @@ -835,7 +841,7 @@ trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait { } @@ -851,7 +857,7 @@ struct ReferenceType1 {} trait TraitAddTraitBoundToTypeParameterOfTraitWhere { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddTraitBoundToTypeParameterOfTraitWhere where T: ReferencedTrait0 { } @@ -862,7 +868,7 @@ trait TraitAddTraitBoundToTypeParameterOfTraitWhere where T: ReferencedTrait0 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { } @@ -873,7 +879,7 @@ trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { } trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { } @@ -884,7 +890,7 @@ trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere where T: Send { } @@ -895,7 +901,7 @@ trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere where T: Send { } trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere where T: ReferencedTrait0 { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere where T: ReferencedTrait0 + ReferencedTrait1 { } @@ -907,7 +913,7 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { } @@ -918,7 +924,7 @@ trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { } @@ -929,7 +935,7 @@ trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> whe trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere where T: Send { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere where T: Send + Sync { } @@ -944,7 +950,7 @@ mod change_return_type_of_method_indirectly_use { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeReturnType { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method() -> ReturnType; } @@ -962,7 +968,7 @@ mod change_method_parameter_type_indirectly_by_use { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeArgType { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(a: ArgType); } @@ -980,7 +986,7 @@ mod change_method_parameter_type_bound_indirectly_by_use { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeBoundOfMethodTypeParameter { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(a: T); } @@ -999,7 +1005,7 @@ mod change_method_parameter_type_bound_indirectly_by_use_where { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeBoundOfMethodTypeParameterWhere { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method(a: T) where T: Bound; } @@ -1014,7 +1020,7 @@ mod change_method_type_parameter_bound_indirectly { #[cfg(not(cfail1))] use super::ReferencedTrait1 as Bound; - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeTraitBound { fn method(a: T); @@ -1031,7 +1037,7 @@ mod change_method_type_parameter_bound_indirectly_where { #[cfg(not(cfail1))] use super::ReferencedTrait1 as Bound; - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] trait TraitChangeTraitBoundWhere where T: Bound { fn method(a: T); diff --git a/src/test/incremental/hashes/trait_impls.rs b/src/test/incremental/hashes/trait_impls.rs index 4cbbb0e6858a..c9a3de1f6ae4 100644 --- a/src/test/incremental/hashes/trait_impls.rs +++ b/src/test/incremental/hashes/trait_impls.rs @@ -30,7 +30,7 @@ impl ChangeMethodNameTrait for Foo { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] pub trait ChangeMethodNameTrait { #[rustc_clean(cfg="cfail3")] @@ -38,7 +38,7 @@ pub trait ChangeMethodNameTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeMethodNameTrait for Foo { #[rustc_clean(cfg="cfail3")] @@ -62,7 +62,7 @@ impl ChangeMethodBodyTrait for Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeMethodBodyTrait for Foo { - #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")] + #[rustc_clean(except="hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method_name() { () @@ -87,7 +87,7 @@ impl ChangeMethodBodyTraitInlined for Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeMethodBodyTraitInlined for Foo { - #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")] + #[rustc_clean(except="hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] #[inline] fn method_name() { @@ -116,7 +116,10 @@ pub trait ChangeMethodSelfnessTrait { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeMethodSelfnessTrait for Foo { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean( + except="hir_owner,hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir", + cfg="cfail2", + )] #[rustc_clean(cfg="cfail3")] fn method_name(&self) { () @@ -144,7 +147,10 @@ pub trait RemoveMethodSelfnessTrait { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl RemoveMethodSelfnessTrait for Foo { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean( + except="hir_owner,hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir", + cfg="cfail2", + )] #[rustc_clean(cfg="cfail3")] fn method_name() {} } @@ -170,7 +176,7 @@ pub trait ChangeMethodSelfmutnessTrait { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeMethodSelfmutnessTrait for Foo { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method_name(&mut self) {} } @@ -193,7 +199,7 @@ pub trait ChangeItemKindTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeItemKindTrait for Foo { type name = (); @@ -219,7 +225,7 @@ pub trait RemoveItemTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl RemoveItemTrait for Foo { type TypeName = (); @@ -244,7 +250,7 @@ pub trait AddItemTrait { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl AddItemTrait for Foo { type TypeName = (); @@ -267,7 +273,7 @@ impl ChangeHasValueTrait for Foo { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] pub trait ChangeHasValueTrait { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method_name() { } } @@ -294,7 +300,7 @@ impl AddDefaultTrait for Foo { #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl AddDefaultTrait for Foo { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] default fn method_name() { } } @@ -320,7 +326,7 @@ pub trait AddArgumentTrait { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl AddArgumentTrait for Foo { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method_name(&self, _x: u32) { } } @@ -346,7 +352,7 @@ pub trait ChangeArgumentTypeTrait { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeArgumentTypeTrait for Foo { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn method_name(&self, _x: char) { } } @@ -366,10 +372,13 @@ impl AddTypeParameterToImpl for Bar { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,generics_of,impl_trait_ref", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl AddTypeParameterToImpl for Bar { - #[rustc_clean(except="hir_owner", cfg="cfail2")] + #[rustc_clean( + except="hir_owner,hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir", + cfg="cfail2", + )] #[rustc_clean(cfg="cfail3")] fn id(t: T) -> T { t } } @@ -387,10 +396,10 @@ impl ChangeSelfTypeOfImpl for u32 { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,impl_trait_ref", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl ChangeSelfTypeOfImpl for u64 { - #[rustc_clean(cfg="cfail2")] + #[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] fn id(self) -> Self { self } } @@ -408,7 +417,7 @@ impl AddLifetimeBoundToImplParameter for T { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl AddLifetimeBoundToImplParameter for T { #[rustc_clean(cfg="cfail2")] @@ -429,7 +438,7 @@ impl AddTraitBoundToImplParameter for T { } #[cfg(not(cfail1))] -#[rustc_clean(except="hir_owner", cfg="cfail2")] +#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl AddTraitBoundToImplParameter for T { #[rustc_clean(cfg="cfail2")]