fix review comments
This commit is contained in:
parent
f7fe970400
commit
80c13ce134
@ -39,8 +39,6 @@
|
||||
//! previous revision to compare things to.
|
||||
//!
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
use std::vec::Vec;
|
||||
@ -141,14 +139,14 @@ const LABELS_CONST: &[&[&str]] = &[
|
||||
];
|
||||
|
||||
/// Constant/Typedef in an impl
|
||||
const LABELS_CONST_ASSOCIATED: &[&[&str]] = &[
|
||||
const LABELS_CONST_IN_IMPL: &[&[&str]] = &[
|
||||
BASE_HIR,
|
||||
BASE_CONST,
|
||||
EXTRA_ASSOCIATED,
|
||||
];
|
||||
|
||||
/// Trait-Const/Typedef DepNodes
|
||||
const LABELS_CONST_TRAIT: &[&[&str]] = &[
|
||||
const LABELS_CONST_IN_TRAIT: &[&[&str]] = &[
|
||||
BASE_HIR,
|
||||
BASE_CONST,
|
||||
EXTRA_ASSOCIATED,
|
||||
@ -163,7 +161,7 @@ const LABELS_FN: &[&[&str]] = &[
|
||||
];
|
||||
|
||||
/// Method DepNodes
|
||||
const LABELS_FN_ASSOCIATED: &[&[&str]] = &[
|
||||
const LABELS_FN_IN_IMPL: &[&[&str]] = &[
|
||||
BASE_HIR,
|
||||
BASE_MIR,
|
||||
BASE_FN,
|
||||
@ -171,7 +169,7 @@ const LABELS_FN_ASSOCIATED: &[&[&str]] = &[
|
||||
];
|
||||
|
||||
/// Trait-Method DepNodes
|
||||
const LABELS_FN_TRAIT: &[&[&str]] = &[
|
||||
const LABELS_FN_IN_TRAIT: &[&[&str]] = &[
|
||||
BASE_HIR,
|
||||
BASE_MIR,
|
||||
BASE_FN,
|
||||
@ -190,13 +188,14 @@ const LABELS_IMPL: &[&[&str]] = &[
|
||||
BASE_IMPL,
|
||||
];
|
||||
|
||||
/// Struct DepNodes
|
||||
const LABELS_STRUCT: &[&[&str]] = &[
|
||||
/// Abstract Data Type (Struct, Enum, Unions) DepNodes
|
||||
const LABELS_ADT: &[&[&str]] = &[
|
||||
BASE_HIR,
|
||||
BASE_STRUCT,
|
||||
];
|
||||
|
||||
/// Trait Definition DepNodes
|
||||
#[allow(dead_code)]
|
||||
const LABELS_TRAIT: &[&[&str]] = &[
|
||||
BASE_HIR,
|
||||
BASE_TRAIT_DEF,
|
||||
@ -382,16 +381,16 @@ impl<'a, 'tcx> DirtyCleanVisitor<'a, 'tcx> {
|
||||
HirItem::ItemGlobalAsm(..) => ("ItemGlobalAsm", LABELS_HIR_ONLY),
|
||||
|
||||
// A type alias, e.g. `type Foo = Bar<u8>`
|
||||
HirItem::ItemTy(..) => ("ItemTy", LABELS_CONST),
|
||||
HirItem::ItemTy(..) => ("ItemTy", LABELS_HIR_ONLY),
|
||||
|
||||
// An enum definition, e.g. `enum Foo<A, B> {C<A>, D<B>}`
|
||||
HirItem::ItemEnum(..) => ("ItemEnum", LABELS_STRUCT),
|
||||
HirItem::ItemEnum(..) => ("ItemEnum", LABELS_ADT),
|
||||
|
||||
// A struct definition, e.g. `struct Foo<A> {x: A}`
|
||||
HirItem::ItemStruct(..) => ("ItemStruct", LABELS_STRUCT),
|
||||
HirItem::ItemStruct(..) => ("ItemStruct", LABELS_ADT),
|
||||
|
||||
// A union definition, e.g. `union Foo<A, B> {x: A, y: B}`
|
||||
HirItem::ItemUnion(..) => ("ItemUnion", LABELS_STRUCT),
|
||||
HirItem::ItemUnion(..) => ("ItemUnion", LABELS_ADT),
|
||||
|
||||
// Represents a Trait Declaration
|
||||
// FIXME(michaelwoerister): trait declaration is buggy because sometimes some of
|
||||
@ -426,16 +425,16 @@ impl<'a, 'tcx> DirtyCleanVisitor<'a, 'tcx> {
|
||||
},
|
||||
HirNode::NodeTraitItem(item) => {
|
||||
match item.node {
|
||||
TraitItemKind::Method(..) => ("NodeTraitItem", LABELS_FN_TRAIT),
|
||||
TraitItemKind::Const(..) => ("NodeTraitConst", LABELS_CONST_TRAIT),
|
||||
TraitItemKind::Type(..) => ("NodeTraitType", LABELS_CONST_TRAIT),
|
||||
TraitItemKind::Method(..) => ("NodeTraitItem", LABELS_FN_IN_TRAIT),
|
||||
TraitItemKind::Const(..) => ("NodeTraitConst", LABELS_CONST_IN_TRAIT),
|
||||
TraitItemKind::Type(..) => ("NodeTraitType", LABELS_CONST_IN_TRAIT),
|
||||
}
|
||||
},
|
||||
HirNode::NodeImplItem(item) => {
|
||||
match item.node {
|
||||
ImplItemKind::Method(..) => ("NodeImplItem", LABELS_FN_ASSOCIATED),
|
||||
ImplItemKind::Const(..) => ("NodeImplConst", LABELS_CONST_ASSOCIATED),
|
||||
ImplItemKind::Type(..) => ("NodeImplType", LABELS_CONST_ASSOCIATED),
|
||||
ImplItemKind::Method(..) => ("NodeImplItem", LABELS_FN_IN_IMPL),
|
||||
ImplItemKind::Const(..) => ("NodeImplConst", LABELS_CONST_IN_IMPL),
|
||||
ImplItemKind::Type(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
|
||||
}
|
||||
},
|
||||
_ => self.tcx.sess.span_fatal(
|
||||
|
@ -171,13 +171,13 @@ pub fn change_to_ufcs() {
|
||||
s.method1('x', true);
|
||||
}
|
||||
|
||||
// FIXME(vitiral): why would this change anything, doesn't the Mir/Hir expand this
|
||||
// sort of stuff?
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized,TypeckTables")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
// One might think this would be expanded in the HirBody/Mir, but it actually
|
||||
// results in slightly different Hir/Mir.
|
||||
pub fn change_to_ufcs() {
|
||||
let s = Struct;
|
||||
Struct::method1(&s, 'x', true);
|
||||
|
@ -74,6 +74,8 @@ fn change_field_order_struct_like() -> Enum {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
// FIXME(michaelwoerister):Interesting. I would have thought that that changes the MIR. And it
|
||||
// would if it were not all constants
|
||||
fn change_field_order_struct_like() -> Enum {
|
||||
Enum::Struct {
|
||||
y: 4,
|
||||
@ -156,7 +158,8 @@ mod change_constructor_path_indirectly_struct_like {
|
||||
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
|
||||
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,\
|
||||
TypeckTables"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
@ -217,7 +220,10 @@ fn change_constructor_path_tuple_like() {
|
||||
}
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="HirBody,MirOptimized,MirValidated,TypeckTables"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
@ -234,7 +240,10 @@ fn change_constructor_variant_tuple_like() {
|
||||
}
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirValidated,TypeckTables")]
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="HirBody,MirOptimized,MirValidated,TypeckTables"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
@ -252,7 +261,8 @@ mod change_constructor_path_indirectly_tuple_like {
|
||||
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
|
||||
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,\
|
||||
TypeckTables"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
@ -335,7 +345,8 @@ mod change_constructor_path_indirectly_c_like {
|
||||
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,TypeckTables"
|
||||
except="FnSignature,Hir,HirBody,MirOptimized,MirValidated,\
|
||||
TypeckTables"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
|
@ -444,7 +444,6 @@ enum EnumChangeNameOfTypeParameter<S> {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumChangeNameOfTypeParameter<T> {
|
||||
Variant1(T),
|
||||
}
|
||||
@ -463,7 +462,6 @@ enum EnumAddTypeParameter<S> {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddTypeParameter<S, T> {
|
||||
Variant1(S),
|
||||
Variant2(T),
|
||||
@ -482,7 +480,6 @@ enum EnumChangeNameOfLifetimeParameter<'a> {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumChangeNameOfLifetimeParameter<'b> {
|
||||
Variant1(&'b u32),
|
||||
}
|
||||
@ -501,7 +498,6 @@ enum EnumAddLifetimeParameter<'a> {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddLifetimeParameter<'a, 'b> {
|
||||
Variant1(&'a u32),
|
||||
Variant2(&'b u32),
|
||||
@ -517,11 +513,10 @@ enum EnumAddLifetimeParameterBound<'a, 'b> {
|
||||
}
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_dirty(cfg="cfail2", except="GenericsOfItem")]
|
||||
#[rustc_dirty(cfg="cfail2", except="GenericsOfItem,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddLifetimeParameterBound<'a, 'b: 'a> {
|
||||
Variant1(&'a u32),
|
||||
Variant2(&'b u32),
|
||||
@ -535,11 +530,10 @@ enum EnumAddLifetimeBoundToParameter<'a, T> {
|
||||
}
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_dirty(cfg="cfail2")]
|
||||
#[rustc_dirty(cfg="cfail2", except="TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddLifetimeBoundToParameter<'a, T: 'a> {
|
||||
Variant1(T),
|
||||
Variant2(&'a u32),
|
||||
@ -558,7 +552,6 @@ enum EnumAddTraitBound<S> {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddTraitBound<T: Sync> {
|
||||
Variant1(T),
|
||||
}
|
||||
@ -573,11 +566,10 @@ enum EnumAddLifetimeParameterBoundWhere<'a, 'b> {
|
||||
}
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_dirty(cfg="cfail2", except="GenericsOfItem")]
|
||||
#[rustc_dirty(cfg="cfail2", except="GenericsOfItem,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddLifetimeParameterBoundWhere<'a, 'b> where 'b: 'a {
|
||||
Variant1(&'a u32),
|
||||
Variant2(&'b u32),
|
||||
@ -593,11 +585,10 @@ enum EnumAddLifetimeBoundToParameterWhere<'a, T> {
|
||||
}
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_dirty(cfg="cfail2")]
|
||||
#[rustc_dirty(cfg="cfail2", except="TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a {
|
||||
Variant1(T),
|
||||
Variant2(&'a u32),
|
||||
@ -616,7 +607,6 @@ enum EnumAddTraitBoundWhere<S> {
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
#[repr(C)]
|
||||
enum EnumAddTraitBoundWhere<T> where T: Sync {
|
||||
Variant1(T),
|
||||
}
|
||||
|
@ -370,6 +370,8 @@ impl Foo {
|
||||
#[rustc_metadata_clean(cfg="cfail2")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
impl Foo {
|
||||
// FIXME(michaelwoerister): This is curious but an unused lifetime parameter doesn't seem to
|
||||
// show up in any of the derived data structures.
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail2")]
|
||||
|
@ -35,7 +35,7 @@
|
||||
type ChangePrimitiveType = i32;
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangePrimitiveType = i64;
|
||||
@ -47,7 +47,7 @@ type ChangePrimitiveType = i64;
|
||||
type ChangeMutability = &'static i32;
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangeMutability = &'static mut i32;
|
||||
@ -59,7 +59,7 @@ type ChangeMutability = &'static mut i32;
|
||||
type ChangeLifetime<'a> = (&'static i32, &'a i32);
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangeLifetime<'a> = (&'a i32, &'a i32);
|
||||
@ -74,7 +74,7 @@ struct Struct2;
|
||||
type ChangeTypeStruct = Struct1;
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangeTypeStruct = Struct2;
|
||||
@ -86,7 +86,7 @@ type ChangeTypeStruct = Struct2;
|
||||
type ChangeTypeTuple = (u32, u64);
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangeTypeTuple = (u32, i64);
|
||||
@ -107,7 +107,7 @@ enum Enum2 {
|
||||
type ChangeTypeEnum = Enum1;
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangeTypeEnum = Enum2;
|
||||
@ -119,7 +119,7 @@ type ChangeTypeEnum = Enum2;
|
||||
type AddTupleField = (i32, i64);
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type AddTupleField = (i32, i64, i16);
|
||||
@ -131,7 +131,7 @@ type AddTupleField = (i32, i64, i16);
|
||||
type ChangeNestedTupleField = (i32, (i64, i16));
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type ChangeNestedTupleField = (i32, (i64, i8));
|
||||
@ -143,7 +143,7 @@ type ChangeNestedTupleField = (i32, (i64, i8));
|
||||
type AddTypeParam<T1> = (T1, T1);
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type AddTypeParam<T1, T2> = (T1, T2);
|
||||
@ -179,7 +179,7 @@ type AddTypeParamBoundWhereClause<T1> where T1: Clone+Copy = (T1, u32);
|
||||
type AddLifetimeParam<'a> = (&'a u32, &'a u32);
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeOfItem")]
|
||||
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_metadata_clean(cfg="cfail3")]
|
||||
type AddLifetimeParam<'a, 'b> = (&'a u32, &'b u32);
|
||||
|
Loading…
x
Reference in New Issue
Block a user