Skip to content

Commit

Permalink
Adjust some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Dec 22, 2021
1 parent 6fbc75b commit e11ef37
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 37 deletions.
4 changes: 3 additions & 1 deletion compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl std::convert::From<DepNodeIndex> for QueryInvocationId {
}
}

#[derive(PartialEq)]
#[derive(PartialEq, Debug)]
pub enum DepNodeColor {
Red,
Green(DepNodeIndex),
Expand Down Expand Up @@ -285,6 +285,7 @@ impl<K: DepKind> DepGraph<K> {
key
);

tracing::info!("Inserting color: {:?} {:?}", key, color);
data.colors.insert(prev_index, color);
}

Expand Down Expand Up @@ -1156,6 +1157,7 @@ impl DepNodeColorMap {
}

fn insert(&self, index: SerializedDepNodeIndex, color: DepNodeColor) {
tracing::info!("Actually storing: {:?} {:?}", index, color);
self.values[index].store(
match color {
DepNodeColor::Red => COMPRESSED_RED,
Expand Down
20 changes: 10 additions & 10 deletions src/test/incremental/hashes/enum_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum EnumVisibility { A }
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,type_of")]
#[rustc_clean(cfg="cfail6")]
pub enum EnumVisibility {
A
Expand Down Expand Up @@ -251,7 +251,7 @@ enum EnumChangeFieldTypeTupleStyleVariant {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumChangeFieldTypeTupleStyleVariant {
Variant1(u32,
Expand All @@ -270,7 +270,7 @@ enum EnumChangeFieldTypeStructStyleVariant {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumChangeFieldTypeStructStyleVariant {
Variant1,
Expand Down Expand Up @@ -308,7 +308,7 @@ enum EnumChangeOrderTupleStyleVariant {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumChangeOrderTupleStyleVariant {
Variant1(
Expand Down Expand Up @@ -491,7 +491,7 @@ enum EnumAddLifetimeParameterBound<'a, 'b> {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumAddLifetimeParameterBound<'a, 'b: 'a> {
Variant1(&'a u32),
Expand All @@ -508,7 +508,7 @@ enum EnumAddLifetimeBoundToParameter<'a, T> {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumAddLifetimeBoundToParameter<'a, T: 'a> {
Variant1(T),
Expand Down Expand Up @@ -544,7 +544,7 @@ enum EnumAddLifetimeParameterBoundWhere<'a, 'b> {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumAddLifetimeParameterBoundWhere<'a, 'b> where 'b: 'a {
Variant1(&'a u32),
Expand All @@ -563,7 +563,7 @@ enum EnumAddLifetimeBoundToParameterWhere<'a, T> {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a {
Variant1(T),
Expand Down Expand Up @@ -599,7 +599,7 @@ enum EnumSwapUsageTypeParameters<A, B> {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumSwapUsageTypeParameters<A, B> {
Variant1 {
Expand All @@ -622,7 +622,7 @@ enum EnumSwapUsageLifetimeParameters<'a, 'b> {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,type_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumSwapUsageLifetimeParameters<'a, 'b> {
Variant1 {
Expand Down
10 changes: 5 additions & 5 deletions src/test/incremental/hashes/inherent_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl Foo {
impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="associated_item")]
#[rustc_clean(cfg="cfail6")]
pub fn add_method_to_impl1(&self) { }

Expand Down Expand Up @@ -704,7 +704,7 @@ impl<T> Bar<T> {
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(
cfg="cfail5",
except="generics_of,fn_sig,typeck,type_of,optimized_mir"
except="generics_of,fn_sig,typeck,type_of,optimized_mir,associated_item"
)]
#[rustc_clean(cfg="cfail6")]
pub fn add_type_parameter_to_impl(&self) { }
Expand All @@ -726,7 +726,7 @@ impl Bar<u32> {
impl Bar<u64> {
#[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,typeck")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5", except="fn_sig,optimized_mir,typeck")]
#[rustc_clean(cfg="cfail5", except="fn_sig,optimized_mir,typeck,associated_item")]
#[rustc_clean(cfg="cfail6")]
pub fn change_impl_self_type(&self) { }
}
Expand All @@ -747,7 +747,7 @@ impl<T> Bar<T> {
impl<T: 'static> Bar<T> {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="associated_item")]
#[rustc_clean(cfg="cfail6")]
pub fn add_lifetime_bound_to_impl_parameter(&self) { }
}
Expand All @@ -768,7 +768,7 @@ impl<T> Bar<T> {
impl<T: Clone> Bar<T> {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="associated_item")]
#[rustc_clean(cfg="cfail6")]
pub fn add_trait_bound_to_impl_parameter(&self) { }
}
Expand Down
14 changes: 7 additions & 7 deletions src/test/incremental/hashes/struct_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct TupleStructFieldType(i32);
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
// Note that changing the type of a field does not change the type of the struct or enum, but
// adding/removing fields or changing a fields name or visibility does.
Expand Down Expand Up @@ -102,7 +102,7 @@ struct RecordStructFieldType { x: f32 }
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
// Note that changing the type of a field does not change the type of the struct or enum, but
// adding/removing fields or changing a fields name or visibility does.
Expand Down Expand Up @@ -175,7 +175,7 @@ struct AddLifetimeParameterBound<'a, 'b>(&'a f32, &'b f64);
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
struct AddLifetimeParameterBound<'a, 'b: 'a>(
&'a f32,
Expand All @@ -188,7 +188,7 @@ struct AddLifetimeParameterBoundWhereClause<'a, 'b>(&'a f32, &'b f64);
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
struct AddLifetimeParameterBoundWhereClause<'a, 'b>(
&'a f32,
Expand Down Expand Up @@ -222,7 +222,7 @@ struct AddTypeParameterBound<T>(T);
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
struct AddTypeParameterBound<T: Send>(
T
Expand All @@ -235,7 +235,7 @@ struct AddTypeParameterBoundWhereClause<T>(T);
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
struct AddTypeParameterBoundWhereClause<T>(
T
Expand All @@ -262,7 +262,7 @@ struct Visibility;
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
pub struct Visibility;

Expand Down
10 changes: 5 additions & 5 deletions src/test/incremental/hashes/trait_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ trait TraitAddUnsafeModifier {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="hir_owner")]
#[rustc_clean(cfg="cfail6")]
trait TraitAddUnsafeModifier {
#[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,fn_sig", cfg="cfail5")]
#[rustc_clean(except="hir_owner,fn_sig,associated_item", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
unsafe fn method();
}
Expand All @@ -425,12 +425,12 @@ trait TraitAddExternModifier {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="hir_owner")]
#[rustc_clean(cfg="cfail6")]
trait TraitAddExternModifier {
#[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,fn_sig", cfg="cfail5")]
#[rustc_clean(except="hir_owner,fn_sig,associated_item", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
extern "C" fn method();
}
Expand Down Expand Up @@ -850,7 +850,7 @@ trait TraitAddInitializerToAssociatedConstant {

#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="associated_item")]
#[rustc_clean(cfg="cfail6")]
fn method();
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/incremental/hashes/trait_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ pub trait AddArgumentTrait {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="hir_owner")]
#[rustc_clean(cfg="cfail6")]
impl AddArgumentTrait for Foo {
#[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
#[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,typeck,optimized_mir,associated_item", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
fn method_name(&self, _x: u32) { }
}
Expand Down Expand Up @@ -470,7 +470,7 @@ impl<TTT> AddTypeParameterToImpl<TTT> for Bar<TTT> {
)]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(
except="hir_owner,hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir",
except="hir_owner,hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir,associated_item",
cfg="cfail5",
)]
#[rustc_clean(cfg="cfail6")]
Expand All @@ -497,7 +497,7 @@ impl ChangeSelfTypeOfImpl for u32 {
impl ChangeSelfTypeOfImpl for u64 {
#[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail5")]
#[rustc_clean(except="fn_sig,typeck,optimized_mir,associated_item", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
fn id(self) -> Self { self }
}
Expand All @@ -522,7 +522,7 @@ impl<T> AddLifetimeBoundToImplParameter for T {
impl<T: 'static> AddLifetimeBoundToImplParameter for T {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="associated_item")]
#[rustc_clean(cfg="cfail6")]
fn id(self) -> Self { self }
}
Expand All @@ -547,7 +547,7 @@ impl<T> AddTraitBoundToImplParameter for T {
impl<T: Clone> AddTraitBoundToImplParameter for T {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_clean(cfg="cfail5")]
#[rustc_clean(cfg="cfail5", except="associated_item")]
#[rustc_clean(cfg="cfail6")]
fn id(self) -> Self { self }
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/incremental/spans_in_type_debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// ignore-asmjs wasm2js does not support source maps yet
// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph -g
// compile-flags: -Z query-dep-graph -g -Z dep-tasks

#![rustc_partition_reused(module="spans_in_type_debuginfo-structs", cfg="rpass2")]
#![rustc_partition_reused(module="spans_in_type_debuginfo-enums", cfg="rpass2")]
Expand Down
4 changes: 2 additions & 2 deletions src/test/incremental/struct_change_nothing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ pub struct Y {
pub y: char
}

#[rustc_clean(cfg="rpass2")]
#[rustc_clean(cfg="rpass2", except="typeck")]
pub fn use_X() -> u32 {
let x: X = X { x: 22 };
x.x as u32
}

#[rustc_clean(cfg="rpass2")]
#[rustc_clean(cfg="rpass2", except="typeck")]
pub fn use_EmbedX(x: EmbedX) -> u32 {
let x: X = X { x: 22 };
x.x as u32
Expand Down

0 comments on commit e11ef37

Please sign in to comment.