ICH: Replace old, transitive metadata hashing with direct hashing approach.
Instead of collecting all potential inputs to some metadata entry and hashing those, we directly hash the values we are storing in metadata. This is more accurate and doesn't suffer from quadratic blow-up when many entries have the same dependencies.
This commit is contained in:
parent
bc7af816f3
commit
ca2dce9b48
27 changed files with 689 additions and 341 deletions
|
@ -16,24 +16,9 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
|
||||||
StableHasherResult};
|
StableHasherResult};
|
||||||
use std::hash as std_hash;
|
use std::hash as std_hash;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
use syntax_pos::symbol::InternedString;
|
||||||
use ty;
|
use ty;
|
||||||
|
|
||||||
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::TyS<'tcx> {
|
|
||||||
fn hash_stable<W: StableHasherResult>(&self,
|
|
||||||
hcx: &mut StableHashingContext<'a, 'tcx>,
|
|
||||||
hasher: &mut StableHasher<W>) {
|
|
||||||
let ty::TyS {
|
|
||||||
ref sty,
|
|
||||||
|
|
||||||
// The other fields just provide fast access to information that is
|
|
||||||
// also contained in `sty`, so no need to hash them.
|
|
||||||
..
|
|
||||||
} = *self;
|
|
||||||
|
|
||||||
sty.hash_stable(hcx, hasher);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl_stable_hash_for!(struct ty::ItemSubsts<'tcx> { substs });
|
impl_stable_hash_for!(struct ty::ItemSubsts<'tcx> { substs });
|
||||||
|
|
||||||
impl<'a, 'tcx, T> HashStable<StableHashingContext<'a, 'tcx>> for &'tcx ty::Slice<T>
|
impl<'a, 'tcx, T> HashStable<StableHashingContext<'a, 'tcx>> for &'tcx ty::Slice<T>
|
||||||
|
@ -288,9 +273,14 @@ for ::middle::const_val::ConstVal<'tcx> {
|
||||||
def_id.hash_stable(hcx, hasher);
|
def_id.hash_stable(hcx, hasher);
|
||||||
substs.hash_stable(hcx, hasher);
|
substs.hash_stable(hcx, hasher);
|
||||||
}
|
}
|
||||||
ConstVal::Struct(ref _name_value_map) => {
|
ConstVal::Struct(ref name_value_map) => {
|
||||||
// BTreeMap<ast::Name, ConstVal<'tcx>>),
|
let mut values: Vec<(InternedString, &ConstVal)> =
|
||||||
panic!("Ordering still unstable")
|
name_value_map.iter()
|
||||||
|
.map(|(name, val)| (name.as_str(), val))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
values.sort_unstable_by_key(|&(ref name, _)| name.clone());
|
||||||
|
values.hash_stable(hcx, hasher);
|
||||||
}
|
}
|
||||||
ConstVal::Tuple(ref value) => {
|
ConstVal::Tuple(ref value) => {
|
||||||
value.hash_stable(hcx, hasher);
|
value.hash_stable(hcx, hasher);
|
||||||
|
@ -632,6 +622,8 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::TypeckTables<'
|
||||||
ref fru_field_types,
|
ref fru_field_types,
|
||||||
|
|
||||||
ref cast_kinds,
|
ref cast_kinds,
|
||||||
|
|
||||||
|
// FIXME(#41184): This is still ignored at the moment.
|
||||||
lints: _,
|
lints: _,
|
||||||
ref used_trait_imports,
|
ref used_trait_imports,
|
||||||
tainted_by_errors,
|
tainted_by_errors,
|
||||||
|
@ -672,7 +664,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::TypeckTables<'
|
||||||
ich::hash_stable_nodemap(hcx, hasher, cast_kinds);
|
ich::hash_stable_nodemap(hcx, hasher, cast_kinds);
|
||||||
|
|
||||||
ich::hash_stable_hashset(hcx, hasher, used_trait_imports, |hcx, def_id| {
|
ich::hash_stable_hashset(hcx, hasher, used_trait_imports, |hcx, def_id| {
|
||||||
hcx.tcx().def_path_hash(*def_id)
|
hcx.def_path_hash(*def_id)
|
||||||
});
|
});
|
||||||
|
|
||||||
tainted_by_errors.hash_stable(hcx, hasher);
|
tainted_by_errors.hash_stable(hcx, hasher);
|
||||||
|
|
|
@ -27,6 +27,7 @@ use hir::def_id::{CrateNum, DefId, DefIndex};
|
||||||
use hir::map as hir_map;
|
use hir::map as hir_map;
|
||||||
use hir::map::definitions::{Definitions, DefKey, DisambiguatedDefPathData};
|
use hir::map::definitions::{Definitions, DefKey, DisambiguatedDefPathData};
|
||||||
use hir::svh::Svh;
|
use hir::svh::Svh;
|
||||||
|
use ich;
|
||||||
use middle::lang_items;
|
use middle::lang_items;
|
||||||
use ty::{self, TyCtxt};
|
use ty::{self, TyCtxt};
|
||||||
use session::Session;
|
use session::Session;
|
||||||
|
@ -161,6 +162,20 @@ pub struct ExternCrate {
|
||||||
pub path_len: usize,
|
pub path_len: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct EncodedMetadata {
|
||||||
|
pub raw_data: Vec<u8>,
|
||||||
|
pub hashes: Vec<EncodedMetadataHash>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The hash for some metadata that (when saving) will be exported
|
||||||
|
/// from this crate, or which (when importing) was exported by an
|
||||||
|
/// upstream crate.
|
||||||
|
#[derive(Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
|
||||||
|
pub struct EncodedMetadataHash {
|
||||||
|
pub def_index: DefIndex,
|
||||||
|
pub hash: ich::Fingerprint,
|
||||||
|
}
|
||||||
|
|
||||||
/// A store of Rust crates, through with their metadata
|
/// A store of Rust crates, through with their metadata
|
||||||
/// can be accessed.
|
/// can be accessed.
|
||||||
pub trait CrateStore {
|
pub trait CrateStore {
|
||||||
|
@ -258,7 +273,8 @@ pub trait CrateStore {
|
||||||
fn encode_metadata<'a, 'tcx>(&self,
|
fn encode_metadata<'a, 'tcx>(&self,
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
link_meta: &LinkMeta,
|
link_meta: &LinkMeta,
|
||||||
reachable: &NodeSet) -> Vec<u8>;
|
reachable: &NodeSet)
|
||||||
|
-> EncodedMetadata;
|
||||||
fn metadata_encoding_version(&self) -> &[u8];
|
fn metadata_encoding_version(&self) -> &[u8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,7 +433,10 @@ impl CrateStore for DummyCrateStore {
|
||||||
fn encode_metadata<'a, 'tcx>(&self,
|
fn encode_metadata<'a, 'tcx>(&self,
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
link_meta: &LinkMeta,
|
link_meta: &LinkMeta,
|
||||||
reachable: &NodeSet) -> Vec<u8> { vec![] }
|
reachable: &NodeSet)
|
||||||
|
-> EncodedMetadata {
|
||||||
|
bug!("encode_metadata")
|
||||||
|
}
|
||||||
fn metadata_encoding_version(&self) -> &[u8] { bug!("metadata_encoding_version") }
|
fn metadata_encoding_version(&self) -> &[u8] { bug!("metadata_encoding_version") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -452,6 +452,23 @@ impl<'tcx> Hash for TyS<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ty::TyS<'tcx> {
|
||||||
|
fn hash_stable<W: StableHasherResult>(&self,
|
||||||
|
hcx: &mut StableHashingContext<'a, 'tcx>,
|
||||||
|
hasher: &mut StableHasher<W>) {
|
||||||
|
let ty::TyS {
|
||||||
|
ref sty,
|
||||||
|
|
||||||
|
// The other fields just provide fast access to information that is
|
||||||
|
// also contained in `sty`, so no need to hash them.
|
||||||
|
flags: _,
|
||||||
|
region_depth: _,
|
||||||
|
} = *self;
|
||||||
|
|
||||||
|
sty.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
|
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
|
||||||
|
|
||||||
impl<'tcx> serialize::UseSpecializedEncodable for Ty<'tcx> {}
|
impl<'tcx> serialize::UseSpecializedEncodable for Ty<'tcx> {}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
use hir::def_id::{DefId, LOCAL_CRATE};
|
use hir::def_id::{DefId, LOCAL_CRATE};
|
||||||
use hir::map::DefPathData;
|
use hir::map::DefPathData;
|
||||||
use infer::InferCtxt;
|
use infer::InferCtxt;
|
||||||
// use hir::map as hir_map;
|
use ich::{StableHashingContext, NodeIdHashingMode};
|
||||||
use traits::{self, Reveal};
|
use traits::{self, Reveal};
|
||||||
use ty::{self, Ty, TyCtxt, TypeAndMut, TypeFlags, TypeFoldable};
|
use ty::{self, Ty, TyCtxt, TypeAndMut, TypeFlags, TypeFoldable};
|
||||||
use ty::ParameterEnvironment;
|
use ty::ParameterEnvironment;
|
||||||
|
@ -25,8 +25,8 @@ use util::nodemap::FxHashMap;
|
||||||
use middle::lang_items;
|
use middle::lang_items;
|
||||||
|
|
||||||
use rustc_const_math::{ConstInt, ConstIsize, ConstUsize};
|
use rustc_const_math::{ConstInt, ConstIsize, ConstUsize};
|
||||||
use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult};
|
use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
|
||||||
|
HashStable};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
@ -187,6 +187,22 @@ impl<'tcx> ParameterEnvironment<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
|
||||||
|
/// Creates a hash of the type `Ty` which will be the same no matter what crate
|
||||||
|
/// context it's calculated within. This is used by the `type_id` intrinsic.
|
||||||
|
pub fn type_id_hash(self, ty: Ty<'tcx>) -> u64 {
|
||||||
|
let mut hasher = StableHasher::new();
|
||||||
|
let mut hcx = StableHashingContext::new(self);
|
||||||
|
|
||||||
|
hcx.while_hashing_spans(false, |hcx| {
|
||||||
|
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
||||||
|
ty.hash_stable(hcx, &mut hasher);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
hasher.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
||||||
pub fn has_error_field(self, ty: Ty<'tcx>) -> bool {
|
pub fn has_error_field(self, ty: Ty<'tcx>) -> bool {
|
||||||
match ty.sty {
|
match ty.sty {
|
||||||
|
@ -339,14 +355,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a hash of the type `Ty` which will be the same no matter what crate
|
|
||||||
/// context it's calculated within. This is used by the `type_id` intrinsic.
|
|
||||||
pub fn type_id_hash(self, ty: Ty<'tcx>) -> u64 {
|
|
||||||
let mut hasher = TypeIdHasher::new(self);
|
|
||||||
hasher.visit_ty(ty);
|
|
||||||
hasher.finish()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Calculate the destructor of a given type.
|
/// Calculate the destructor of a given type.
|
||||||
pub fn calculate_dtor(
|
pub fn calculate_dtor(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -29,16 +29,23 @@ pub struct Blake2bCtx {
|
||||||
t: [u64; 2],
|
t: [u64; 2],
|
||||||
c: usize,
|
c: usize,
|
||||||
outlen: u16,
|
outlen: u16,
|
||||||
finalized: bool
|
finalized: bool,
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
fnv_hash: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
impl ::std::fmt::Debug for Blake2bCtx {
|
impl ::std::fmt::Debug for Blake2bCtx {
|
||||||
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
|
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
try!(write!(fmt, "hash: "));
|
write!(fmt, "{:x}", self.fnv_hash)
|
||||||
for v in &self.h {
|
}
|
||||||
try!(write!(fmt, "{:x}", v));
|
}
|
||||||
}
|
|
||||||
Ok(())
|
#[cfg(not(debug_assertions))]
|
||||||
|
impl ::std::fmt::Debug for Blake2bCtx {
|
||||||
|
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
|
write!(fmt, "Enable debug_assertions() for more info.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +164,9 @@ fn blake2b_new(outlen: usize, key: &[u8]) -> Blake2bCtx {
|
||||||
c: 0,
|
c: 0,
|
||||||
outlen: outlen as u16,
|
outlen: outlen as u16,
|
||||||
finalized: false,
|
finalized: false,
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
fnv_hash: 0xcbf29ce484222325,
|
||||||
};
|
};
|
||||||
|
|
||||||
ctx.h[0] ^= 0x01010000 ^ ((key.len() << 8) as u64) ^ (outlen as u64);
|
ctx.h[0] ^= 0x01010000 ^ ((key.len() << 8) as u64) ^ (outlen as u64);
|
||||||
|
@ -194,6 +204,16 @@ fn blake2b_update(ctx: &mut Blake2bCtx, mut data: &[u8]) {
|
||||||
checked_mem_copy(data, &mut ctx.b[ctx.c .. ], bytes_to_copy);
|
checked_mem_copy(data, &mut ctx.b[ctx.c .. ], bytes_to_copy);
|
||||||
ctx.c += bytes_to_copy;
|
ctx.c += bytes_to_copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
{
|
||||||
|
// compute additional FNV hash for simpler to read debug output
|
||||||
|
const MAGIC_PRIME: u64 = 0x00000100000001b3;
|
||||||
|
|
||||||
|
for &byte in data {
|
||||||
|
ctx.fnv_hash = (ctx.fnv_hash ^ byte as u64).wrapping_mul(MAGIC_PRIME);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn blake2b_final(ctx: &mut Blake2bCtx)
|
fn blake2b_final(ctx: &mut Blake2bCtx)
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#![feature(discriminant_value)]
|
#![feature(discriminant_value)]
|
||||||
#![feature(specialization)]
|
#![feature(specialization)]
|
||||||
#![feature(manually_drop)]
|
#![feature(manually_drop)]
|
||||||
|
#![feature(struct_field_attributes)]
|
||||||
|
|
||||||
#![cfg_attr(unix, feature(libc))]
|
#![cfg_attr(unix, feature(libc))]
|
||||||
#![cfg_attr(test, feature(test))]
|
#![cfg_attr(test, feature(test))]
|
||||||
|
|
|
@ -40,13 +40,18 @@ fn write_signed_leb128_to_buf(buf: &mut [u8; 16], value: i64) -> usize {
|
||||||
/// This hasher currently always uses the stable Blake2b algorithm
|
/// This hasher currently always uses the stable Blake2b algorithm
|
||||||
/// and allows for variable output lengths through its type
|
/// and allows for variable output lengths through its type
|
||||||
/// parameter.
|
/// parameter.
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct StableHasher<W> {
|
pub struct StableHasher<W> {
|
||||||
state: Blake2bHasher,
|
state: Blake2bHasher,
|
||||||
bytes_hashed: u64,
|
bytes_hashed: u64,
|
||||||
width: PhantomData<W>,
|
width: PhantomData<W>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<W: StableHasherResult> ::std::fmt::Debug for StableHasher<W> {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
|
write!(f, "{:?}", self.state)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub trait StableHasherResult: Sized {
|
pub trait StableHasherResult: Sized {
|
||||||
fn finish(hasher: StableHasher<Self>) -> Self;
|
fn finish(hasher: StableHasher<Self>) -> Self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1083,6 +1083,7 @@ pub fn phase_4_translate_to_llvm<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
"serialize dep graph",
|
"serialize dep graph",
|
||||||
|| rustc_incremental::save_dep_graph(tcx,
|
|| rustc_incremental::save_dep_graph(tcx,
|
||||||
&incremental_hashes_map,
|
&incremental_hashes_map,
|
||||||
|
&translation.metadata.hashes,
|
||||||
translation.link.crate_hash));
|
translation.link.crate_hash));
|
||||||
translation
|
translation
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
use rustc::dep_graph::{DepNode, WorkProduct, WorkProductId};
|
use rustc::dep_graph::{DepNode, WorkProduct, WorkProductId};
|
||||||
use rustc::hir::def_id::DefIndex;
|
use rustc::hir::def_id::DefIndex;
|
||||||
use rustc::ich::Fingerprint;
|
use rustc::ich::Fingerprint;
|
||||||
|
use rustc::middle::cstore::EncodedMetadataHash;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
|
|
||||||
|
@ -98,7 +99,7 @@ pub struct SerializedMetadataHashes {
|
||||||
/// where `X` refers to some item in this crate. That `X` will be
|
/// where `X` refers to some item in this crate. That `X` will be
|
||||||
/// a `DefPathIndex` that gets retracted to the current `DefId`
|
/// a `DefPathIndex` that gets retracted to the current `DefId`
|
||||||
/// (matching the one found in this structure).
|
/// (matching the one found in this structure).
|
||||||
pub hashes: Vec<SerializedMetadataHash>,
|
pub hashes: Vec<EncodedMetadataHash>,
|
||||||
|
|
||||||
/// For each DefIndex (as it occurs in SerializedMetadataHash), this
|
/// For each DefIndex (as it occurs in SerializedMetadataHash), this
|
||||||
/// map stores the DefPathIndex (as it occurs in DefIdDirectory), so
|
/// map stores the DefPathIndex (as it occurs in DefIdDirectory), so
|
||||||
|
@ -112,14 +113,3 @@ pub struct SerializedMetadataHashes {
|
||||||
/// the DefIndex.
|
/// the DefIndex.
|
||||||
pub index_map: FxHashMap<DefIndex, DefPathIndex>
|
pub index_map: FxHashMap<DefIndex, DefPathIndex>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The hash for some metadata that (when saving) will be exported
|
|
||||||
/// from this crate, or which (when importing) was exported by an
|
|
||||||
/// upstream crate.
|
|
||||||
#[derive(Debug, RustcEncodable, RustcDecodable)]
|
|
||||||
pub struct SerializedMetadataHash {
|
|
||||||
pub def_index: DefIndex,
|
|
||||||
|
|
||||||
/// the hash itself, computed by `calculate_item_hash`
|
|
||||||
pub hash: Fingerprint,
|
|
||||||
}
|
|
||||||
|
|
|
@ -215,9 +215,11 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for DirtyCleanVisitor<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_dirty_clean_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
pub fn check_dirty_clean_metadata<'a, 'tcx>(
|
||||||
prev_metadata_hashes: &FxHashMap<DefId, Fingerprint>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
current_metadata_hashes: &FxHashMap<DefId, Fingerprint>) {
|
prev_metadata_hashes: &FxHashMap<DefId, Fingerprint>,
|
||||||
|
current_metadata_hashes: &FxHashMap<DefId, Fingerprint>)
|
||||||
|
{
|
||||||
if !tcx.sess.opts.debugging_opts.query_dep_graph {
|
if !tcx.sess.opts.debugging_opts.query_dep_graph {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +232,7 @@ pub fn check_dirty_clean_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
current_metadata_hashes: current_metadata_hashes,
|
current_metadata_hashes: current_metadata_hashes,
|
||||||
checked_attrs: FxHashSet(),
|
checked_attrs: FxHashSet(),
|
||||||
};
|
};
|
||||||
krate.visit_all_item_likes(&mut dirty_clean_visitor);
|
intravisit::walk_crate(&mut dirty_clean_visitor, krate);
|
||||||
|
|
||||||
let mut all_attrs = FindAllAttrs {
|
let mut all_attrs = FindAllAttrs {
|
||||||
tcx: tcx,
|
tcx: tcx,
|
||||||
|
@ -246,30 +248,58 @@ pub fn check_dirty_clean_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct DirtyCleanMetadataVisitor<'a, 'tcx:'a, 'm> {
|
pub struct DirtyCleanMetadataVisitor<'a, 'tcx: 'a, 'm> {
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
prev_metadata_hashes: &'m FxHashMap<DefId, Fingerprint>,
|
prev_metadata_hashes: &'m FxHashMap<DefId, Fingerprint>,
|
||||||
current_metadata_hashes: &'m FxHashMap<DefId, Fingerprint>,
|
current_metadata_hashes: &'m FxHashMap<DefId, Fingerprint>,
|
||||||
checked_attrs: FxHashSet<ast::AttrId>,
|
checked_attrs: FxHashSet<ast::AttrId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx, 'm> ItemLikeVisitor<'tcx> for DirtyCleanMetadataVisitor<'a, 'tcx, 'm> {
|
impl<'a, 'tcx, 'm> intravisit::Visitor<'tcx> for DirtyCleanMetadataVisitor<'a, 'tcx, 'm> {
|
||||||
|
|
||||||
|
fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, 'tcx> {
|
||||||
|
intravisit::NestedVisitorMap::All(&self.tcx.hir)
|
||||||
|
}
|
||||||
|
|
||||||
fn visit_item(&mut self, item: &'tcx hir::Item) {
|
fn visit_item(&mut self, item: &'tcx hir::Item) {
|
||||||
self.check_item(item.id, item.span);
|
self.check_item(item.id, item.span);
|
||||||
|
intravisit::walk_item(self, item);
|
||||||
|
}
|
||||||
|
|
||||||
if let hir::ItemEnum(ref def, _) = item.node {
|
fn visit_variant_data(&mut self,
|
||||||
for v in &def.variants {
|
variant_data: &'tcx hir::VariantData,
|
||||||
self.check_item(v.node.data.id(), v.span);
|
_: ast::Name,
|
||||||
}
|
_: &'tcx hir::Generics,
|
||||||
|
_parent_id: ast::NodeId,
|
||||||
|
span: Span) {
|
||||||
|
if self.tcx.hir.find(variant_data.id()).is_some() {
|
||||||
|
// VariantData that represent structs or tuples don't have a
|
||||||
|
// separate entry in the HIR map and checking them would error,
|
||||||
|
// so only check if this is an enum or union variant.
|
||||||
|
self.check_item(variant_data.id(), span);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
intravisit::walk_struct_def(self, variant_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_trait_item(&mut self, item: &hir::TraitItem) {
|
fn visit_trait_item(&mut self, item: &'tcx hir::TraitItem) {
|
||||||
self.check_item(item.id, item.span);
|
self.check_item(item.id, item.span);
|
||||||
|
intravisit::walk_trait_item(self, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_impl_item(&mut self, item: &hir::ImplItem) {
|
fn visit_impl_item(&mut self, item: &'tcx hir::ImplItem) {
|
||||||
self.check_item(item.id, item.span);
|
self.check_item(item.id, item.span);
|
||||||
|
intravisit::walk_impl_item(self, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn visit_foreign_item(&mut self, i: &'tcx hir::ForeignItem) {
|
||||||
|
self.check_item(i.id, i.span);
|
||||||
|
intravisit::walk_foreign_item(self, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn visit_struct_field(&mut self, s: &'tcx hir::StructField) {
|
||||||
|
self.check_item(s.id, s.span);
|
||||||
|
intravisit::walk_struct_field(self, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,13 +311,15 @@ impl<'a, 'tcx, 'm> DirtyCleanMetadataVisitor<'a, 'tcx, 'm> {
|
||||||
for attr in self.tcx.get_attrs(def_id).iter() {
|
for attr in self.tcx.get_attrs(def_id).iter() {
|
||||||
if attr.check_name(ATTR_DIRTY_METADATA) {
|
if attr.check_name(ATTR_DIRTY_METADATA) {
|
||||||
if check_config(self.tcx, attr) {
|
if check_config(self.tcx, attr) {
|
||||||
self.checked_attrs.insert(attr.id);
|
if self.checked_attrs.insert(attr.id) {
|
||||||
self.assert_state(false, def_id, item_span);
|
self.assert_state(false, def_id, item_span);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if attr.check_name(ATTR_CLEAN_METADATA) {
|
} else if attr.check_name(ATTR_CLEAN_METADATA) {
|
||||||
if check_config(self.tcx, attr) {
|
if check_config(self.tcx, attr) {
|
||||||
self.checked_attrs.insert(attr.id);
|
if self.checked_attrs.insert(attr.id) {
|
||||||
self.assert_state(true, def_id, item_span);
|
self.assert_state(true, def_id, item_span);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,16 +44,18 @@ impl<'q> Predecessors<'q> {
|
||||||
pub fn new(query: &'q DepGraphQuery<DefId>, hcx: &mut HashContext) -> Self {
|
pub fn new(query: &'q DepGraphQuery<DefId>, hcx: &mut HashContext) -> Self {
|
||||||
let tcx = hcx.tcx;
|
let tcx = hcx.tcx;
|
||||||
|
|
||||||
let collect_for_metadata = tcx.sess.opts.debugging_opts.incremental_cc ||
|
|
||||||
tcx.sess.opts.debugging_opts.query_dep_graph;
|
|
||||||
|
|
||||||
// Find the set of "start nodes". These are nodes that we will
|
// Find the set of "start nodes". These are nodes that we will
|
||||||
// possibly query later.
|
// possibly query later.
|
||||||
let is_output = |node: &DepNode<DefId>| -> bool {
|
let is_output = |node: &DepNode<DefId>| -> bool {
|
||||||
match *node {
|
match *node {
|
||||||
DepNode::WorkProduct(_) => true,
|
DepNode::WorkProduct(_) => true,
|
||||||
DepNode::MetaData(ref def_id) => collect_for_metadata && def_id.is_local(),
|
DepNode::MetaData(ref def_id) => {
|
||||||
|
// We do *not* create dep-nodes for the current crate's
|
||||||
|
// metadata anymore, just for metadata that we import/read
|
||||||
|
// from other crates.
|
||||||
|
debug_assert!(!def_id.is_local());
|
||||||
|
false
|
||||||
|
}
|
||||||
// if -Z query-dep-graph is passed, save more extended data
|
// if -Z query-dep-graph is passed, save more extended data
|
||||||
// to enable better unit testing
|
// to enable better unit testing
|
||||||
DepNode::TypeckTables(_) |
|
DepNode::TypeckTables(_) |
|
||||||
|
@ -75,6 +77,22 @@ impl<'q> Predecessors<'q> {
|
||||||
.or_insert_with(|| hcx.hash(input).unwrap());
|
.or_insert_with(|| hcx.hash(input).unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if tcx.sess.opts.debugging_opts.query_dep_graph {
|
||||||
|
// Not all inputs might have been reachable from an output node,
|
||||||
|
// but we still want their hash for our unit tests.
|
||||||
|
let hir_nodes = query.graph.all_nodes().iter().filter_map(|node| {
|
||||||
|
match node.data {
|
||||||
|
DepNode::Hir(_) => Some(&node.data),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for node in hir_nodes {
|
||||||
|
hashes.entry(node)
|
||||||
|
.or_insert_with(|| hcx.hash(node).unwrap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let bootstrap_outputs: Vec<&'q DepNode<DefId>> =
|
let bootstrap_outputs: Vec<&'q DepNode<DefId>> =
|
||||||
(0 .. graph.len_nodes())
|
(0 .. graph.len_nodes())
|
||||||
.map(NodeIndex)
|
.map(NodeIndex)
|
||||||
|
|
|
@ -12,13 +12,12 @@ use rustc::dep_graph::DepNode;
|
||||||
use rustc::hir::def_id::DefId;
|
use rustc::hir::def_id::DefId;
|
||||||
use rustc::hir::svh::Svh;
|
use rustc::hir::svh::Svh;
|
||||||
use rustc::ich::Fingerprint;
|
use rustc::ich::Fingerprint;
|
||||||
|
use rustc::middle::cstore::EncodedMetadataHash;
|
||||||
use rustc::session::Session;
|
use rustc::session::Session;
|
||||||
use rustc::ty::TyCtxt;
|
use rustc::ty::TyCtxt;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
use rustc_data_structures::graph::{NodeIndex, INCOMING};
|
|
||||||
use rustc_serialize::Encodable as RustcEncodable;
|
use rustc_serialize::Encodable as RustcEncodable;
|
||||||
use rustc_serialize::opaque::Encoder;
|
use rustc_serialize::opaque::Encoder;
|
||||||
use std::hash::Hash;
|
|
||||||
use std::io::{self, Cursor, Write};
|
use std::io::{self, Cursor, Write};
|
||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
@ -32,10 +31,10 @@ use super::fs::*;
|
||||||
use super::dirty_clean;
|
use super::dirty_clean;
|
||||||
use super::file_format;
|
use super::file_format;
|
||||||
use super::work_product;
|
use super::work_product;
|
||||||
use calculate_svh::IchHasher;
|
|
||||||
|
|
||||||
pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
incremental_hashes_map: &IncrementalHashesMap,
|
incremental_hashes_map: &IncrementalHashesMap,
|
||||||
|
metadata_hashes: &[EncodedMetadataHash],
|
||||||
svh: Svh) {
|
svh: Svh) {
|
||||||
debug!("save_dep_graph()");
|
debug!("save_dep_graph()");
|
||||||
let _ignore = tcx.dep_graph.in_ignore();
|
let _ignore = tcx.dep_graph.in_ignore();
|
||||||
|
@ -56,16 +55,16 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
let preds = Predecessors::new(&query, &mut hcx);
|
let preds = Predecessors::new(&query, &mut hcx);
|
||||||
let mut current_metadata_hashes = FxHashMap();
|
let mut current_metadata_hashes = FxHashMap();
|
||||||
|
|
||||||
|
// IMPORTANT: We are saving the metadata hashes *before* the dep-graph,
|
||||||
|
// since metadata-encoding might add new entries to the
|
||||||
|
// DefIdDirectory (which is saved in the dep-graph file).
|
||||||
if sess.opts.debugging_opts.incremental_cc ||
|
if sess.opts.debugging_opts.incremental_cc ||
|
||||||
sess.opts.debugging_opts.query_dep_graph {
|
sess.opts.debugging_opts.query_dep_graph {
|
||||||
// IMPORTANT: We are saving the metadata hashes *before* the dep-graph,
|
|
||||||
// since metadata-encoding might add new entries to the
|
|
||||||
// DefIdDirectory (which is saved in the dep-graph file).
|
|
||||||
save_in(sess,
|
save_in(sess,
|
||||||
metadata_hash_export_path(sess),
|
metadata_hash_export_path(sess),
|
||||||
|e| encode_metadata_hashes(tcx,
|
|e| encode_metadata_hashes(tcx,
|
||||||
svh,
|
svh,
|
||||||
&preds,
|
metadata_hashes,
|
||||||
&mut builder,
|
&mut builder,
|
||||||
&mut current_metadata_hashes,
|
&mut current_metadata_hashes,
|
||||||
e));
|
e));
|
||||||
|
@ -241,80 +240,16 @@ pub fn encode_dep_graph(preds: &Predecessors,
|
||||||
|
|
||||||
pub fn encode_metadata_hashes(tcx: TyCtxt,
|
pub fn encode_metadata_hashes(tcx: TyCtxt,
|
||||||
svh: Svh,
|
svh: Svh,
|
||||||
preds: &Predecessors,
|
metadata_hashes: &[EncodedMetadataHash],
|
||||||
builder: &mut DefIdDirectoryBuilder,
|
builder: &mut DefIdDirectoryBuilder,
|
||||||
current_metadata_hashes: &mut FxHashMap<DefId, Fingerprint>,
|
current_metadata_hashes: &mut FxHashMap<DefId, Fingerprint>,
|
||||||
encoder: &mut Encoder)
|
encoder: &mut Encoder)
|
||||||
-> io::Result<()> {
|
-> io::Result<()> {
|
||||||
// For each `MetaData(X)` node where `X` is local, accumulate a
|
|
||||||
// hash. These are the metadata items we export. Downstream
|
|
||||||
// crates will want to see a hash that tells them whether we might
|
|
||||||
// have changed the metadata for a given item since they last
|
|
||||||
// compiled.
|
|
||||||
//
|
|
||||||
// (I initially wrote this with an iterator, but it seemed harder to read.)
|
|
||||||
let mut serialized_hashes = SerializedMetadataHashes {
|
let mut serialized_hashes = SerializedMetadataHashes {
|
||||||
hashes: vec![],
|
hashes: metadata_hashes.to_vec(),
|
||||||
index_map: FxHashMap()
|
index_map: FxHashMap()
|
||||||
};
|
};
|
||||||
|
|
||||||
for (index, target) in preds.reduced_graph.all_nodes().iter().enumerate() {
|
|
||||||
let index = NodeIndex(index);
|
|
||||||
let def_id = match *target.data {
|
|
||||||
DepNode::MetaData(def_id) if def_id.is_local() => def_id,
|
|
||||||
_ => continue,
|
|
||||||
};
|
|
||||||
|
|
||||||
// To create the hash for each item `X`, we don't hash the raw
|
|
||||||
// bytes of the metadata (though in principle we
|
|
||||||
// could). Instead, we walk the predecessors of `MetaData(X)`
|
|
||||||
// from the dep-graph. This corresponds to all the inputs that
|
|
||||||
// were read to construct the metadata. To create the hash for
|
|
||||||
// the metadata, we hash (the hash of) all of those inputs.
|
|
||||||
debug!("save: computing metadata hash for {:?}", def_id);
|
|
||||||
|
|
||||||
// Create a vector containing a pair of (source-id, hash).
|
|
||||||
// The source-id is stored as a `DepNode<u64>`, where the u64
|
|
||||||
// is the det. hash of the def-path. This is convenient
|
|
||||||
// because we can sort this to get a stable ordering across
|
|
||||||
// compilations, even if the def-ids themselves have changed.
|
|
||||||
let mut hashes: Vec<(DepNode<u64>, Fingerprint)> =
|
|
||||||
preds.reduced_graph
|
|
||||||
.depth_traverse(index, INCOMING)
|
|
||||||
.map(|index| preds.reduced_graph.node_data(index))
|
|
||||||
.filter(|dep_node| HashContext::is_hashable(dep_node))
|
|
||||||
.map(|dep_node| {
|
|
||||||
let hash_dep_node = dep_node.map_def(|&def_id| Some(tcx.def_path_hash(def_id)))
|
|
||||||
.unwrap();
|
|
||||||
let hash = preds.hashes[dep_node];
|
|
||||||
(hash_dep_node, hash)
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
hashes.sort();
|
|
||||||
let mut state = IchHasher::new();
|
|
||||||
hashes.hash(&mut state);
|
|
||||||
let hash = state.finish();
|
|
||||||
|
|
||||||
debug!("save: metadata hash for {:?} is {}", def_id, hash);
|
|
||||||
|
|
||||||
if tcx.sess.opts.debugging_opts.incremental_dump_hash {
|
|
||||||
println!("metadata hash for {:?} is {}", def_id, hash);
|
|
||||||
for pred_index in preds.reduced_graph.depth_traverse(index, INCOMING) {
|
|
||||||
let dep_node = preds.reduced_graph.node_data(pred_index);
|
|
||||||
if HashContext::is_hashable(&dep_node) {
|
|
||||||
println!("metadata hash for {:?} depends on {:?} with hash {}",
|
|
||||||
def_id, dep_node, preds.hashes[dep_node]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
serialized_hashes.hashes.push(SerializedMetadataHash {
|
|
||||||
def_index: def_id.index,
|
|
||||||
hash: hash,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if tcx.sess.opts.debugging_opts.query_dep_graph {
|
if tcx.sess.opts.debugging_opts.query_dep_graph {
|
||||||
for serialized_hash in &serialized_hashes.hashes {
|
for serialized_hash in &serialized_hashes.hashes {
|
||||||
let def_id = DefId::local(serialized_hash.def_index);
|
let def_id = DefId::local(serialized_hash.def_index);
|
||||||
|
|
|
@ -14,8 +14,9 @@ use locator;
|
||||||
use schema;
|
use schema;
|
||||||
|
|
||||||
use rustc::dep_graph::DepTrackingMapConfig;
|
use rustc::dep_graph::DepTrackingMapConfig;
|
||||||
use rustc::middle::cstore::{CrateStore, CrateSource, LibSource, DepKind, ExternCrate};
|
use rustc::middle::cstore::{CrateStore, CrateSource, LibSource, DepKind,
|
||||||
use rustc::middle::cstore::{NativeLibrary, LinkMeta, LinkagePreference, LoadedMacro};
|
ExternCrate, NativeLibrary, LinkMeta,
|
||||||
|
LinkagePreference, LoadedMacro, EncodedMetadata};
|
||||||
use rustc::hir::def::{self, Def};
|
use rustc::hir::def::{self, Def};
|
||||||
use rustc::middle::lang_items;
|
use rustc::middle::lang_items;
|
||||||
use rustc::session::Session;
|
use rustc::session::Session;
|
||||||
|
@ -498,7 +499,8 @@ impl CrateStore for cstore::CStore {
|
||||||
fn encode_metadata<'a, 'tcx>(&self,
|
fn encode_metadata<'a, 'tcx>(&self,
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
link_meta: &LinkMeta,
|
link_meta: &LinkMeta,
|
||||||
reachable: &NodeSet) -> Vec<u8>
|
reachable: &NodeSet)
|
||||||
|
-> EncodedMetadata
|
||||||
{
|
{
|
||||||
encoder::encode_metadata(tcx, self, link_meta, reachable)
|
encoder::encode_metadata(tcx, self, link_meta, reachable)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,10 @@ use cstore;
|
||||||
use index::Index;
|
use index::Index;
|
||||||
use schema::*;
|
use schema::*;
|
||||||
|
|
||||||
use rustc::middle::cstore::{LinkMeta, LinkagePreference, NativeLibrary};
|
use rustc::middle::cstore::{LinkMeta, LinkagePreference, NativeLibrary,
|
||||||
|
EncodedMetadata, EncodedMetadataHash};
|
||||||
use rustc::hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefIndex, DefId};
|
use rustc::hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefIndex, DefId};
|
||||||
use rustc::hir::map::definitions::DefPathTable;
|
use rustc::hir::map::definitions::DefPathTable;
|
||||||
use rustc::ich;
|
|
||||||
use rustc::middle::dependency_format::Linkage;
|
use rustc::middle::dependency_format::Linkage;
|
||||||
use rustc::middle::lang_items;
|
use rustc::middle::lang_items;
|
||||||
use rustc::mir;
|
use rustc::mir;
|
||||||
|
@ -56,7 +56,7 @@ pub struct EncodeContext<'a, 'tcx: 'a> {
|
||||||
type_shorthands: FxHashMap<Ty<'tcx>, usize>,
|
type_shorthands: FxHashMap<Ty<'tcx>, usize>,
|
||||||
predicate_shorthands: FxHashMap<ty::Predicate<'tcx>, usize>,
|
predicate_shorthands: FxHashMap<ty::Predicate<'tcx>, usize>,
|
||||||
|
|
||||||
pub metadata_hashes: Vec<(DefIndex, ich::Fingerprint)>,
|
pub metadata_hashes: Vec<EncodedMetadataHash>,
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! encoder_methods {
|
macro_rules! encoder_methods {
|
||||||
|
@ -240,13 +240,16 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
||||||
|
|
||||||
impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
fn encode_item_variances(&mut self, def_id: DefId) -> LazySeq<ty::Variance> {
|
fn encode_item_variances(&mut self, def_id: DefId) -> LazySeq<ty::Variance> {
|
||||||
|
debug!("EntryBuilder::encode_item_variances({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
self.lazy_seq_from_slice(&tcx.item_variances(def_id))
|
self.lazy_seq_from_slice(&tcx.item_variances(def_id))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_item_type(&mut self, def_id: DefId) -> Lazy<Ty<'tcx>> {
|
fn encode_item_type(&mut self, def_id: DefId) -> Lazy<Ty<'tcx>> {
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
self.lazy(&tcx.item_type(def_id))
|
let ty = tcx.item_type(def_id);
|
||||||
|
debug!("EntryBuilder::encode_item_type({:?}) => {:?}", def_id, ty);
|
||||||
|
self.lazy(&ty)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Encode data for the given variant of the given ADT. The
|
/// Encode data for the given variant of the given ADT. The
|
||||||
|
@ -261,6 +264,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
let def = tcx.lookup_adt_def(enum_did);
|
let def = tcx.lookup_adt_def(enum_did);
|
||||||
let variant = &def.variants[index];
|
let variant = &def.variants[index];
|
||||||
let def_id = variant.did;
|
let def_id = variant.did;
|
||||||
|
debug!("EntryBuilder::encode_enum_variant_info({:?})", def_id);
|
||||||
|
|
||||||
let data = VariantData {
|
let data = VariantData {
|
||||||
ctor_kind: variant.ctor_kind,
|
ctor_kind: variant.ctor_kind,
|
||||||
|
@ -307,6 +311,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
-> Entry<'tcx> {
|
-> Entry<'tcx> {
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
let def_id = tcx.hir.local_def_id(id);
|
let def_id = tcx.hir.local_def_id(id);
|
||||||
|
debug!("EntryBuilder::encode_info_for_mod({:?})", def_id);
|
||||||
|
|
||||||
let data = ModData {
|
let data = ModData {
|
||||||
reexports: match tcx.export_map.get(&id) {
|
reexports: match tcx.export_map.get(&id) {
|
||||||
|
@ -370,6 +375,8 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
let field = &variant.fields[field_index];
|
let field = &variant.fields[field_index];
|
||||||
|
|
||||||
let def_id = field.did;
|
let def_id = field.did;
|
||||||
|
debug!("EntryBuilder::encode_field({:?})", def_id);
|
||||||
|
|
||||||
let variant_id = tcx.hir.as_local_node_id(variant.did).unwrap();
|
let variant_id = tcx.hir.as_local_node_id(variant.did).unwrap();
|
||||||
let variant_data = tcx.hir.expect_variant_data(variant_id);
|
let variant_data = tcx.hir.expect_variant_data(variant_id);
|
||||||
|
|
||||||
|
@ -394,6 +401,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_struct_ctor(&mut self, (adt_def_id, def_id): (DefId, DefId)) -> Entry<'tcx> {
|
fn encode_struct_ctor(&mut self, (adt_def_id, def_id): (DefId, DefId)) -> Entry<'tcx> {
|
||||||
|
debug!("EntryBuilder::encode_struct_ctor({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
let variant = tcx.lookup_adt_def(adt_def_id).struct_variant();
|
let variant = tcx.lookup_adt_def(adt_def_id).struct_variant();
|
||||||
|
|
||||||
|
@ -436,16 +444,19 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_generics(&mut self, def_id: DefId) -> Lazy<ty::Generics> {
|
fn encode_generics(&mut self, def_id: DefId) -> Lazy<ty::Generics> {
|
||||||
|
debug!("EntryBuilder::encode_generics({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
self.lazy(tcx.item_generics(def_id))
|
self.lazy(tcx.item_generics(def_id))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_predicates(&mut self, def_id: DefId) -> Lazy<ty::GenericPredicates<'tcx>> {
|
fn encode_predicates(&mut self, def_id: DefId) -> Lazy<ty::GenericPredicates<'tcx>> {
|
||||||
|
debug!("EntryBuilder::encode_predicates({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
self.lazy(&tcx.item_predicates(def_id))
|
self.lazy(&tcx.item_predicates(def_id))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_info_for_trait_item(&mut self, def_id: DefId) -> Entry<'tcx> {
|
fn encode_info_for_trait_item(&mut self, def_id: DefId) -> Entry<'tcx> {
|
||||||
|
debug!("EntryBuilder::encode_info_for_trait_item({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
|
|
||||||
let node_id = tcx.hir.as_local_node_id(def_id).unwrap();
|
let node_id = tcx.hir.as_local_node_id(def_id).unwrap();
|
||||||
|
@ -528,6 +539,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_info_for_impl_item(&mut self, def_id: DefId) -> Entry<'tcx> {
|
fn encode_info_for_impl_item(&mut self, def_id: DefId) -> Entry<'tcx> {
|
||||||
|
debug!("EntryBuilder::encode_info_for_impl_item({:?})", def_id);
|
||||||
let node_id = self.tcx.hir.as_local_node_id(def_id).unwrap();
|
let node_id = self.tcx.hir.as_local_node_id(def_id).unwrap();
|
||||||
let ast_item = self.tcx.hir.expect_impl_item(node_id);
|
let ast_item = self.tcx.hir.expect_impl_item(node_id);
|
||||||
let impl_item = self.tcx.associated_item(def_id);
|
let impl_item = self.tcx.associated_item(def_id);
|
||||||
|
@ -614,11 +626,13 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_mir(&mut self, def_id: DefId) -> Option<Lazy<mir::Mir<'tcx>>> {
|
fn encode_mir(&mut self, def_id: DefId) -> Option<Lazy<mir::Mir<'tcx>>> {
|
||||||
|
debug!("EntryBuilder::encode_mir({:?})", def_id);
|
||||||
self.tcx.maps.mir.borrow().get(&def_id).map(|mir| self.lazy(&*mir.borrow()))
|
self.tcx.maps.mir.borrow().get(&def_id).map(|mir| self.lazy(&*mir.borrow()))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encodes the inherent implementations of a structure, enumeration, or trait.
|
// Encodes the inherent implementations of a structure, enumeration, or trait.
|
||||||
fn encode_inherent_implementations(&mut self, def_id: DefId) -> LazySeq<DefIndex> {
|
fn encode_inherent_implementations(&mut self, def_id: DefId) -> LazySeq<DefIndex> {
|
||||||
|
debug!("EntryBuilder::encode_inherent_implementations({:?})", def_id);
|
||||||
match self.tcx.maps.inherent_impls.borrow().get(&def_id) {
|
match self.tcx.maps.inherent_impls.borrow().get(&def_id) {
|
||||||
None => LazySeq::empty(),
|
None => LazySeq::empty(),
|
||||||
Some(implementations) => {
|
Some(implementations) => {
|
||||||
|
@ -631,18 +645,19 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_stability(&mut self, def_id: DefId) -> Option<Lazy<attr::Stability>> {
|
fn encode_stability(&mut self, def_id: DefId) -> Option<Lazy<attr::Stability>> {
|
||||||
|
debug!("EntryBuilder::encode_stability({:?})", def_id);
|
||||||
self.tcx.lookup_stability(def_id).map(|stab| self.lazy(stab))
|
self.tcx.lookup_stability(def_id).map(|stab| self.lazy(stab))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_deprecation(&mut self, def_id: DefId) -> Option<Lazy<attr::Deprecation>> {
|
fn encode_deprecation(&mut self, def_id: DefId) -> Option<Lazy<attr::Deprecation>> {
|
||||||
|
debug!("EntryBuilder::encode_deprecation({:?})", def_id);
|
||||||
self.tcx.lookup_deprecation(def_id).map(|depr| self.lazy(&depr))
|
self.tcx.lookup_deprecation(def_id).map(|depr| self.lazy(&depr))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) -> Entry<'tcx> {
|
fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) -> Entry<'tcx> {
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
|
|
||||||
debug!("encoding info for item at {}",
|
debug!("EntryBuilder::encode_info_for_item({:?})", def_id);
|
||||||
tcx.sess.codemap().span_to_string(item.span));
|
|
||||||
|
|
||||||
let kind = match item.node {
|
let kind = match item.node {
|
||||||
hir::ItemStatic(_, hir::MutMutable, _) => EntryKind::MutStatic,
|
hir::ItemStatic(_, hir::MutMutable, _) => EntryKind::MutStatic,
|
||||||
|
@ -956,7 +971,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
-> Entry<'tcx> {
|
-> Entry<'tcx> {
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
|
|
||||||
debug!("writing foreign item {}", tcx.node_path_str(nitem.id));
|
debug!("EntryBuilder::encode_info_for_foreign_item({:?})", def_id);
|
||||||
|
|
||||||
let kind = match nitem.node {
|
let kind = match nitem.node {
|
||||||
hir::ForeignItemFn(_, ref names, _) => {
|
hir::ForeignItemFn(_, ref names, _) => {
|
||||||
|
@ -1065,6 +1080,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
fn encode_info_for_ty_param(&mut self,
|
fn encode_info_for_ty_param(&mut self,
|
||||||
(def_id, Untracked(has_default)): (DefId, Untracked<bool>))
|
(def_id, Untracked(has_default)): (DefId, Untracked<bool>))
|
||||||
-> Entry<'tcx> {
|
-> Entry<'tcx> {
|
||||||
|
debug!("EntryBuilder::encode_info_for_ty_param({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
Entry {
|
Entry {
|
||||||
kind: EntryKind::Type,
|
kind: EntryKind::Type,
|
||||||
|
@ -1091,6 +1107,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_info_for_anon_ty(&mut self, def_id: DefId) -> Entry<'tcx> {
|
fn encode_info_for_anon_ty(&mut self, def_id: DefId) -> Entry<'tcx> {
|
||||||
|
debug!("EntryBuilder::encode_info_for_anon_ty({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
Entry {
|
Entry {
|
||||||
kind: EntryKind::Type,
|
kind: EntryKind::Type,
|
||||||
|
@ -1113,6 +1130,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_info_for_closure(&mut self, def_id: DefId) -> Entry<'tcx> {
|
fn encode_info_for_closure(&mut self, def_id: DefId) -> Entry<'tcx> {
|
||||||
|
debug!("EntryBuilder::encode_info_for_closure({:?})", def_id);
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
|
|
||||||
let data = ClosureData {
|
let data = ClosureData {
|
||||||
|
@ -1141,6 +1159,9 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode_attributes(&mut self, attrs: &[ast::Attribute]) -> LazySeq<ast::Attribute> {
|
fn encode_attributes(&mut self, attrs: &[ast::Attribute]) -> LazySeq<ast::Attribute> {
|
||||||
|
// NOTE: This must use lazy_seq_from_slice(), not lazy_seq() because
|
||||||
|
// we really on the HashStable specialization for [Attribute]
|
||||||
|
// to properly filter things out.
|
||||||
self.lazy_seq_from_slice(attrs)
|
self.lazy_seq_from_slice(attrs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1442,14 +1463,15 @@ pub fn encode_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
cstore: &cstore::CStore,
|
cstore: &cstore::CStore,
|
||||||
link_meta: &LinkMeta,
|
link_meta: &LinkMeta,
|
||||||
exported_symbols: &NodeSet)
|
exported_symbols: &NodeSet)
|
||||||
-> Vec<u8> {
|
-> EncodedMetadata
|
||||||
|
{
|
||||||
let mut cursor = Cursor::new(vec![]);
|
let mut cursor = Cursor::new(vec![]);
|
||||||
cursor.write_all(METADATA_HEADER).unwrap();
|
cursor.write_all(METADATA_HEADER).unwrap();
|
||||||
|
|
||||||
// Will be filed with the root position after encoding everything.
|
// Will be filed with the root position after encoding everything.
|
||||||
cursor.write_all(&[0, 0, 0, 0]).unwrap();
|
cursor.write_all(&[0, 0, 0, 0]).unwrap();
|
||||||
|
|
||||||
let root = {
|
let (root, metadata_hashes) = {
|
||||||
let mut ecx = EncodeContext {
|
let mut ecx = EncodeContext {
|
||||||
opaque: opaque::Encoder::new(&mut cursor),
|
opaque: opaque::Encoder::new(&mut cursor),
|
||||||
tcx: tcx,
|
tcx: tcx,
|
||||||
|
@ -1467,7 +1489,8 @@ pub fn encode_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
|
|
||||||
// Encode all the entries and extra information in the crate,
|
// Encode all the entries and extra information in the crate,
|
||||||
// culminating in the `CrateRoot` which points to all of it.
|
// culminating in the `CrateRoot` which points to all of it.
|
||||||
ecx.encode_crate_root()
|
let root = ecx.encode_crate_root();
|
||||||
|
(root, ecx.metadata_hashes)
|
||||||
};
|
};
|
||||||
let mut result = cursor.into_inner();
|
let mut result = cursor.into_inner();
|
||||||
|
|
||||||
|
@ -1479,7 +1502,10 @@ pub fn encode_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
result[header + 2] = (pos >> 8) as u8;
|
result[header + 2] = (pos >> 8) as u8;
|
||||||
result[header + 3] = (pos >> 0) as u8;
|
result[header + 3] = (pos >> 0) as u8;
|
||||||
|
|
||||||
result
|
EncodedMetadata {
|
||||||
|
raw_data: result,
|
||||||
|
hashes: metadata_hashes,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_repr_options<'a, 'tcx, 'gcx>(tcx: &TyCtxt<'a, 'tcx, 'gcx>, did: DefId) -> ReprOptions {
|
pub fn get_repr_options<'a, 'tcx, 'gcx>(tcx: &TyCtxt<'a, 'tcx, 'gcx>, did: DefId) -> ReprOptions {
|
||||||
|
|
|
@ -62,16 +62,16 @@ use schema::*;
|
||||||
use rustc::hir;
|
use rustc::hir;
|
||||||
use rustc::hir::def_id::DefId;
|
use rustc::hir::def_id::DefId;
|
||||||
use rustc::ich::{StableHashingContext, Fingerprint};
|
use rustc::ich::{StableHashingContext, Fingerprint};
|
||||||
|
use rustc::middle::cstore::EncodedMetadataHash;
|
||||||
use rustc::ty::TyCtxt;
|
use rustc::ty::TyCtxt;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
|
use rustc_data_structures::accumulate_vec::AccumulateVec;
|
||||||
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
|
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
|
||||||
use rustc_serialize::Encodable;
|
use rustc_serialize::Encodable;
|
||||||
|
|
||||||
use rustc::dep_graph::DepNode;
|
|
||||||
|
|
||||||
/// Builder that can encode new items, adding them into the index.
|
/// Builder that can encode new items, adding them into the index.
|
||||||
/// Item encoding cannot be nested.
|
/// Item encoding cannot be nested.
|
||||||
pub struct IndexBuilder<'a, 'b: 'a, 'tcx: 'b> {
|
pub struct IndexBuilder<'a, 'b: 'a, 'tcx: 'b> {
|
||||||
|
@ -123,20 +123,36 @@ impl<'a, 'b, 'tcx> IndexBuilder<'a, 'b, 'tcx> {
|
||||||
data: DATA)
|
data: DATA)
|
||||||
where DATA: DepGraphRead
|
where DATA: DepGraphRead
|
||||||
{
|
{
|
||||||
let _task = self.tcx.dep_graph.in_task(DepNode::MetaData(id));
|
|
||||||
data.read(self.tcx);
|
|
||||||
|
|
||||||
assert!(id.is_local());
|
assert!(id.is_local());
|
||||||
let tcx: TyCtxt<'b, 'tcx, 'tcx> = self.ecx.tcx;
|
let tcx: TyCtxt<'b, 'tcx, 'tcx> = self.ecx.tcx;
|
||||||
|
|
||||||
|
// We don't track this since we are explicitly computing the incr. comp.
|
||||||
|
// hashes anyway. In theory we could do some tracking here and use it to
|
||||||
|
// avoid rehashing things (and instead cache the hashes) but it's
|
||||||
|
// unclear whether that would be a win since hashing is cheap enough.
|
||||||
|
let _task = tcx.dep_graph.in_ignore();
|
||||||
|
|
||||||
|
let compute_ich = (tcx.sess.opts.debugging_opts.query_dep_graph ||
|
||||||
|
tcx.sess.opts.debugging_opts.incremental_cc) &&
|
||||||
|
tcx.sess.opts.build_dep_graph();
|
||||||
|
|
||||||
let ecx: &'x mut EncodeContext<'b, 'tcx> = &mut *self.ecx;
|
let ecx: &'x mut EncodeContext<'b, 'tcx> = &mut *self.ecx;
|
||||||
let mut entry_builder = EntryBuilder {
|
let mut entry_builder = EntryBuilder {
|
||||||
tcx: tcx,
|
tcx: tcx,
|
||||||
ecx: ecx,
|
ecx: ecx,
|
||||||
hasher: StableHasher::new(),
|
hcx: if compute_ich {
|
||||||
hcx: StableHashingContext::new(tcx),
|
Some((StableHashingContext::new(tcx), StableHasher::new()))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let entry = op(&mut entry_builder, data);
|
let entry = op(&mut entry_builder, data);
|
||||||
|
|
||||||
|
if let Some((ref mut hcx, ref mut hasher)) = entry_builder.hcx {
|
||||||
|
entry.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
|
||||||
let entry = entry_builder.ecx.lazy(&entry);
|
let entry = entry_builder.ecx.lazy(&entry);
|
||||||
entry_builder.finish(id);
|
entry_builder.finish(id);
|
||||||
self.items.record(id, entry);
|
self.items.record(id, entry);
|
||||||
|
@ -245,21 +261,28 @@ impl<T> DepGraphRead for FromId<T> {
|
||||||
pub struct EntryBuilder<'a, 'b: 'a, 'tcx: 'b> {
|
pub struct EntryBuilder<'a, 'b: 'a, 'tcx: 'b> {
|
||||||
pub tcx: TyCtxt<'b, 'tcx, 'tcx>,
|
pub tcx: TyCtxt<'b, 'tcx, 'tcx>,
|
||||||
ecx: &'a mut EncodeContext<'b, 'tcx>,
|
ecx: &'a mut EncodeContext<'b, 'tcx>,
|
||||||
hasher: StableHasher<Fingerprint>,
|
hcx: Option<(StableHashingContext<'b, 'tcx>, StableHasher<Fingerprint>)>,
|
||||||
hcx: StableHashingContext<'b, 'tcx>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
|
|
||||||
pub fn finish(self, def_id: DefId) {
|
pub fn finish(self, def_id: DefId) {
|
||||||
let hash = self.hasher.finish();
|
if let Some((_, hasher)) = self.hcx {
|
||||||
self.ecx.metadata_hashes.push((def_id.index, hash));
|
let hash = hasher.finish();
|
||||||
|
self.ecx.metadata_hashes.push(EncodedMetadataHash {
|
||||||
|
def_index: def_id.index,
|
||||||
|
hash: hash,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lazy<T>(&mut self, value: &T) -> Lazy<T>
|
pub fn lazy<T>(&mut self, value: &T) -> Lazy<T>
|
||||||
where T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
where T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
||||||
{
|
{
|
||||||
value.hash_stable(&mut self.hcx, &mut self.hasher);
|
if let Some((ref mut hcx, ref mut hasher)) = self.hcx {
|
||||||
|
value.hash_stable(hcx, hasher);
|
||||||
|
debug!("metadata-hash: {:?}", hasher);
|
||||||
|
}
|
||||||
self.ecx.lazy(value)
|
self.ecx.lazy(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,22 +290,58 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
|
||||||
where I: IntoIterator<Item = T>,
|
where I: IntoIterator<Item = T>,
|
||||||
T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
||||||
{
|
{
|
||||||
let items: Vec<T> = iter.into_iter().collect();
|
if let Some((ref mut hcx, ref mut hasher)) = self.hcx {
|
||||||
items.hash_stable(&mut self.hcx, &mut self.hasher);
|
let iter = iter.into_iter();
|
||||||
self.ecx.lazy_seq(items)
|
let (lower_bound, upper_bound) = iter.size_hint();
|
||||||
|
|
||||||
|
if upper_bound == Some(lower_bound) {
|
||||||
|
lower_bound.hash_stable(hcx, hasher);
|
||||||
|
let mut num_items_hashed = 0;
|
||||||
|
let ret = self.ecx.lazy_seq(iter.inspect(|item| {
|
||||||
|
item.hash_stable(hcx, hasher);
|
||||||
|
num_items_hashed += 1;
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Sometimes items in a sequence are filtered out without being
|
||||||
|
// hashed (e.g. for &[ast::Attribute]) and this code path cannot
|
||||||
|
// handle that correctly, so we want to make sure we didn't hit
|
||||||
|
// it by accident.
|
||||||
|
if lower_bound != num_items_hashed {
|
||||||
|
bug!("Hashed a different number of items ({}) than expected ({})",
|
||||||
|
num_items_hashed,
|
||||||
|
lower_bound);
|
||||||
|
}
|
||||||
|
debug!("metadata-hash: {:?}", hasher);
|
||||||
|
ret
|
||||||
|
} else {
|
||||||
|
// Collect into a vec so we know the length of the sequence
|
||||||
|
let items: AccumulateVec<[T; 32]> = iter.collect();
|
||||||
|
items.hash_stable(hcx, hasher);
|
||||||
|
debug!("metadata-hash: {:?}", hasher);
|
||||||
|
self.ecx.lazy_seq(items)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
self.ecx.lazy_seq(iter)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lazy_seq_from_slice<T>(&mut self, slice: &[T]) -> LazySeq<T>
|
pub fn lazy_seq_from_slice<T>(&mut self, slice: &[T]) -> LazySeq<T>
|
||||||
where T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
where T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
||||||
{
|
{
|
||||||
slice.hash_stable(&mut self.hcx, &mut self.hasher);
|
if let Some((ref mut hcx, ref mut hasher)) = self.hcx {
|
||||||
|
slice.hash_stable(hcx, hasher);
|
||||||
|
debug!("metadata-hash: {:?}", hasher);
|
||||||
|
}
|
||||||
self.ecx.lazy_seq_ref(slice.iter())
|
self.ecx.lazy_seq_ref(slice.iter())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lazy_seq_ref_from_slice<T>(&mut self, slice: &[&T]) -> LazySeq<T>
|
pub fn lazy_seq_ref_from_slice<T>(&mut self, slice: &[&T]) -> LazySeq<T>
|
||||||
where T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
where T: Encodable + HashStable<StableHashingContext<'b, 'tcx>>
|
||||||
{
|
{
|
||||||
slice.hash_stable(&mut self.hcx, &mut self.hasher);
|
if let Some((ref mut hcx, ref mut hasher)) = self.hcx {
|
||||||
|
slice.hash_stable(hcx, hasher);
|
||||||
|
debug!("metadata-hash: {:?}", hasher);
|
||||||
|
}
|
||||||
self.ecx.lazy_seq_ref(slice.iter().map(|x| *x))
|
self.ecx.lazy_seq_ref(slice.iter().map(|x| *x))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ use index;
|
||||||
use rustc::hir;
|
use rustc::hir;
|
||||||
use rustc::hir::def::{self, CtorKind};
|
use rustc::hir::def::{self, CtorKind};
|
||||||
use rustc::hir::def_id::{DefIndex, DefId};
|
use rustc::hir::def_id::{DefIndex, DefId};
|
||||||
|
use rustc::ich::StableHashingContext;
|
||||||
use rustc::middle::const_val::ConstVal;
|
use rustc::middle::const_val::ConstVal;
|
||||||
use rustc::middle::cstore::{DepKind, LinkagePreference, NativeLibrary};
|
use rustc::middle::cstore::{DepKind, LinkagePreference, NativeLibrary};
|
||||||
use rustc::middle::lang_items;
|
use rustc::middle::lang_items;
|
||||||
|
@ -27,6 +28,7 @@ use syntax::symbol::Symbol;
|
||||||
use syntax_pos::{self, Span};
|
use syntax_pos::{self, Span};
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
use std::mem;
|
||||||
|
|
||||||
use rustc_data_structures::stable_hasher::{StableHasher, HashStable,
|
use rustc_data_structures::stable_hasher::{StableHasher, HashStable,
|
||||||
StableHasherResult};
|
StableHasherResult};
|
||||||
|
@ -107,8 +109,8 @@ impl<CTX, T> HashStable<CTX> for Lazy<T> {
|
||||||
fn hash_stable<W: StableHasherResult>(&self,
|
fn hash_stable<W: StableHasherResult>(&self,
|
||||||
_: &mut CTX,
|
_: &mut CTX,
|
||||||
_: &mut StableHasher<W>) {
|
_: &mut StableHasher<W>) {
|
||||||
// There's nothing to do. Whatever got encoded within this Lazy<>
|
// There's nothing to do. Whatever got encoded within this Lazy<>
|
||||||
// wrapper has already been hashed.
|
// wrapper has already been hashed.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,8 +166,8 @@ impl<CTX, T> HashStable<CTX> for LazySeq<T> {
|
||||||
fn hash_stable<W: StableHasherResult>(&self,
|
fn hash_stable<W: StableHasherResult>(&self,
|
||||||
_: &mut CTX,
|
_: &mut CTX,
|
||||||
_: &mut StableHasher<W>) {
|
_: &mut StableHasher<W>) {
|
||||||
// There's nothing to do. Whatever got encoded within this Lazy<>
|
// There's nothing to do. Whatever got encoded within this Lazy<>
|
||||||
// wrapper has already been hashed.
|
// wrapper has already been hashed.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,6 +242,23 @@ pub struct Entry<'tcx> {
|
||||||
pub mir: Option<Lazy<mir::Mir<'tcx>>>,
|
pub mir: Option<Lazy<mir::Mir<'tcx>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl_stable_hash_for!(struct Entry<'tcx> {
|
||||||
|
kind,
|
||||||
|
visibility,
|
||||||
|
span,
|
||||||
|
attributes,
|
||||||
|
children,
|
||||||
|
stability,
|
||||||
|
deprecation,
|
||||||
|
ty,
|
||||||
|
inherent_impls,
|
||||||
|
variances,
|
||||||
|
generics,
|
||||||
|
predicates,
|
||||||
|
ast,
|
||||||
|
mir
|
||||||
|
});
|
||||||
|
|
||||||
#[derive(Copy, Clone, RustcEncodable, RustcDecodable)]
|
#[derive(Copy, Clone, RustcEncodable, RustcDecodable)]
|
||||||
pub enum EntryKind<'tcx> {
|
pub enum EntryKind<'tcx> {
|
||||||
Const(u8),
|
Const(u8),
|
||||||
|
@ -267,6 +286,69 @@ pub enum EntryKind<'tcx> {
|
||||||
AssociatedConst(AssociatedContainer, u8),
|
AssociatedConst(AssociatedContainer, u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for EntryKind<'tcx> {
|
||||||
|
fn hash_stable<W: StableHasherResult>(&self,
|
||||||
|
hcx: &mut StableHashingContext<'a, 'tcx>,
|
||||||
|
hasher: &mut StableHasher<W>) {
|
||||||
|
mem::discriminant(self).hash_stable(hcx, hasher);
|
||||||
|
match *self {
|
||||||
|
EntryKind::ImmStatic |
|
||||||
|
EntryKind::MutStatic |
|
||||||
|
EntryKind::ForeignImmStatic |
|
||||||
|
EntryKind::ForeignMutStatic |
|
||||||
|
EntryKind::ForeignMod |
|
||||||
|
EntryKind::Field |
|
||||||
|
EntryKind::Type => {
|
||||||
|
// Nothing else to hash here.
|
||||||
|
}
|
||||||
|
EntryKind::Const(qualif) => {
|
||||||
|
qualif.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Enum(ref repr_options) => {
|
||||||
|
repr_options.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Variant(ref variant_data) => {
|
||||||
|
variant_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Struct(ref variant_data, ref repr_options) |
|
||||||
|
EntryKind::Union(ref variant_data, ref repr_options) => {
|
||||||
|
variant_data.hash_stable(hcx, hasher);
|
||||||
|
repr_options.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Fn(ref fn_data) |
|
||||||
|
EntryKind::ForeignFn(ref fn_data) => {
|
||||||
|
fn_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Mod(ref mod_data) => {
|
||||||
|
mod_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::MacroDef(ref macro_def) => {
|
||||||
|
macro_def.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Closure(closure_data) => {
|
||||||
|
closure_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Trait(ref trait_data) => {
|
||||||
|
trait_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::DefaultImpl(ref impl_data) |
|
||||||
|
EntryKind::Impl(ref impl_data) => {
|
||||||
|
impl_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::Method(ref method_data) => {
|
||||||
|
method_data.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::AssociatedType(associated_container) => {
|
||||||
|
associated_container.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
EntryKind::AssociatedConst(associated_container, qualif) => {
|
||||||
|
associated_container.hash_stable(hcx, hasher);
|
||||||
|
qualif.hash_stable(hcx, hasher);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(RustcEncodable, RustcDecodable)]
|
#[derive(RustcEncodable, RustcDecodable)]
|
||||||
pub struct ModData {
|
pub struct ModData {
|
||||||
pub reexports: LazySeq<def::Export>,
|
pub reexports: LazySeq<def::Export>,
|
||||||
|
|
|
@ -443,7 +443,10 @@ fn archive_config<'a>(sess: &'a Session,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_metadata<'a>(sess: &'a Session, trans: &CrateTranslation, out_filename: &Path) {
|
fn emit_metadata<'a>(sess: &'a Session, trans: &CrateTranslation, out_filename: &Path) {
|
||||||
let result = fs::File::create(out_filename).and_then(|mut f| f.write_all(&trans.metadata));
|
let result = fs::File::create(out_filename).and_then(|mut f| {
|
||||||
|
f.write_all(&trans.metadata.raw_data)
|
||||||
|
});
|
||||||
|
|
||||||
if let Err(e) = result {
|
if let Err(e) = result {
|
||||||
sess.fatal(&format!("failed to write {}: {}", out_filename.display(), e));
|
sess.fatal(&format!("failed to write {}: {}", out_filename.display(), e));
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ use llvm::{Linkage, ValueRef, Vector, get_param};
|
||||||
use llvm;
|
use llvm;
|
||||||
use rustc::hir::def_id::LOCAL_CRATE;
|
use rustc::hir::def_id::LOCAL_CRATE;
|
||||||
use middle::lang_items::StartFnLangItem;
|
use middle::lang_items::StartFnLangItem;
|
||||||
|
use middle::cstore::EncodedMetadata;
|
||||||
use rustc::ty::{self, Ty, TyCtxt};
|
use rustc::ty::{self, Ty, TyCtxt};
|
||||||
use rustc::dep_graph::{AssertDepGraphSafe, DepNode, WorkProduct};
|
use rustc::dep_graph::{AssertDepGraphSafe, DepNode, WorkProduct};
|
||||||
use rustc::hir::map as hir_map;
|
use rustc::hir::map as hir_map;
|
||||||
|
@ -724,7 +725,8 @@ fn contains_null(s: &str) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_metadata(cx: &SharedCrateContext,
|
fn write_metadata(cx: &SharedCrateContext,
|
||||||
exported_symbols: &NodeSet) -> Vec<u8> {
|
exported_symbols: &NodeSet)
|
||||||
|
-> EncodedMetadata {
|
||||||
use flate;
|
use flate;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
@ -748,7 +750,10 @@ fn write_metadata(cx: &SharedCrateContext,
|
||||||
}).max().unwrap();
|
}).max().unwrap();
|
||||||
|
|
||||||
if kind == MetadataKind::None {
|
if kind == MetadataKind::None {
|
||||||
return Vec::new();
|
return EncodedMetadata {
|
||||||
|
raw_data: vec![],
|
||||||
|
hashes: vec![],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let cstore = &cx.tcx().sess.cstore;
|
let cstore = &cx.tcx().sess.cstore;
|
||||||
|
@ -761,7 +766,7 @@ fn write_metadata(cx: &SharedCrateContext,
|
||||||
|
|
||||||
assert!(kind == MetadataKind::Compressed);
|
assert!(kind == MetadataKind::Compressed);
|
||||||
let mut compressed = cstore.metadata_encoding_version().to_vec();
|
let mut compressed = cstore.metadata_encoding_version().to_vec();
|
||||||
compressed.extend_from_slice(&flate::deflate_bytes(&metadata));
|
compressed.extend_from_slice(&flate::deflate_bytes(&metadata.raw_data));
|
||||||
|
|
||||||
let llmeta = C_bytes_in_context(cx.metadata_llcx(), &compressed);
|
let llmeta = C_bytes_in_context(cx.metadata_llcx(), &compressed);
|
||||||
let llconst = C_struct_in_context(cx.metadata_llcx(), &[llmeta], false);
|
let llconst = C_struct_in_context(cx.metadata_llcx(), &[llmeta], false);
|
||||||
|
|
|
@ -168,7 +168,7 @@ pub struct CrateTranslation {
|
||||||
pub modules: Vec<ModuleTranslation>,
|
pub modules: Vec<ModuleTranslation>,
|
||||||
pub metadata_module: ModuleTranslation,
|
pub metadata_module: ModuleTranslation,
|
||||||
pub link: middle::cstore::LinkMeta,
|
pub link: middle::cstore::LinkMeta,
|
||||||
pub metadata: Vec<u8>,
|
pub metadata: middle::cstore::EncodedMetadata,
|
||||||
pub exported_symbols: back::symbol_export::ExportedSymbols,
|
pub exported_symbols: back::symbol_export::ExportedSymbols,
|
||||||
pub no_builtins: bool,
|
pub no_builtins: bool,
|
||||||
pub windows_subsystem: Option<String>,
|
pub windows_subsystem: Option<String>,
|
||||||
|
|
|
@ -38,8 +38,13 @@ enum EnumVisibility { A }
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub enum EnumVisibility { A }
|
pub enum EnumVisibility {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
A
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +61,10 @@ enum EnumChangeNameCStyleVariant {
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum EnumChangeNameCStyleVariant {
|
enum EnumChangeNameCStyleVariant {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
Variant1,
|
Variant1,
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
Variant2Changed,
|
Variant2Changed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,10 +267,13 @@ enum EnumChangeFieldTypeTupleStyleVariant {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum EnumChangeFieldTypeTupleStyleVariant {
|
enum EnumChangeFieldTypeTupleStyleVariant {
|
||||||
Variant1(u32, u64),
|
Variant1(u32,
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
u64),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,11 +288,16 @@ enum EnumChangeFieldTypeStructStyleVariant {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum EnumChangeFieldTypeStructStyleVariant {
|
enum EnumChangeFieldTypeStructStyleVariant {
|
||||||
Variant1,
|
Variant1,
|
||||||
Variant2 { a: u32, b: u64 },
|
Variant2 {
|
||||||
|
a: u32,
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
b: u64
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,10 +328,16 @@ enum EnumChangeOrderTupleStyleVariant {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum EnumChangeOrderTupleStyleVariant {
|
enum EnumChangeOrderTupleStyleVariant {
|
||||||
Variant1(u64, u32),
|
Variant1(
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
u64,
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -611,11 +633,23 @@ enum EnumSwapUsageTypeParameters<A, B> {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum EnumSwapUsageTypeParameters<A, B> {
|
enum EnumSwapUsageTypeParameters<A, B> {
|
||||||
Variant1 { a: B },
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
Variant2 { a: A },
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
Variant1 {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
a: B
|
||||||
|
},
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
Variant2 {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
a: A
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -630,11 +664,23 @@ enum EnumSwapUsageLifetimeParameters<'a, 'b> {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum EnumSwapUsageLifetimeParameters<'a, 'b> {
|
enum EnumSwapUsageLifetimeParameters<'a, 'b> {
|
||||||
Variant1 { a: &'b u32 },
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
Variant2 { b: &'a u32 },
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
Variant1 {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
a: &'b u32
|
||||||
|
},
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
Variant2 {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
b: &'a u32
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -653,10 +699,16 @@ mod change_field_type_indirectly_tuple_style {
|
||||||
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum TupleStyle {
|
enum TupleStyle {
|
||||||
Variant1(FieldType)
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
Variant1(
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
FieldType
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,10 +723,16 @@ mod change_field_type_indirectly_struct_style {
|
||||||
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
enum StructStyle {
|
enum StructStyle {
|
||||||
Variant1 { a: FieldType }
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
Variant1 {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
a: FieldType
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn change_parameter_name(d: i64) -> i32;
|
pub fn change_parameter_name(d: i64) -> i32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +72,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn change_parameter_type(c: i32) -> i32;
|
pub fn change_parameter_type(c: i32) -> i32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,9 +91,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn change_return_type(c: i32) -> i8;
|
pub fn change_return_type(c: i32) -> i8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,9 +110,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn add_parameter(c: i32, d: i32) -> i32;
|
pub fn add_parameter(c: i32, d: i32) -> i32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,9 +129,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn add_return_type(c: i32) -> i32;
|
pub fn add_return_type(c: i32) -> i32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,9 +148,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn make_function_variadic(c: i32, ...);
|
pub fn make_function_variadic(c: i32, ...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,9 +167,11 @@ extern "C" {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern "rust-call" {
|
extern "rust-call" {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn change_calling_convention(c: i32);
|
pub fn change_calling_convention(c: i32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,9 +186,11 @@ extern {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn make_function_public(c: i32);
|
pub fn make_function_public(c: i32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,9 +262,11 @@ mod indirectly_change_parameter_type {
|
||||||
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn indirectly_change_parameter_type(c: c_int);
|
pub fn indirectly_change_parameter_type(c: c_int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,9 +282,11 @@ mod indirectly_change_return_type {
|
||||||
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
extern {
|
extern {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn indirectly_change_return_type() -> c_int;
|
pub fn indirectly_change_return_type() -> c_int;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ fn add_return_type() {}
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")] // The type doesn't change, so metadata is the same
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn add_return_type() -> () {}
|
fn add_return_type() -> () {}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ fn lifetime_parameter() {}
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
// #[rustc_metadata_dirty(cfg="cfail2")] -- Unused lifetime params don't show up in the type?
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn lifetime_parameter<'a>() {}
|
fn lifetime_parameter<'a>() {}
|
||||||
|
|
||||||
|
@ -315,16 +315,16 @@ fn return_impl_trait() -> impl Clone {
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
fn change_return_impl_trait() -> impl Clone {
|
fn change_return_impl_trait() -> impl Clone {
|
||||||
0
|
0u32
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")] // The actual type is the same, so: clean
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn change_return_impl_trait() -> impl Copy {
|
fn change_return_impl_trait() -> impl Copy {
|
||||||
0
|
0u32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ impl Foo {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl Foo {
|
impl Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -126,7 +126,7 @@ impl Foo {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl Foo {
|
impl Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -171,7 +171,7 @@ impl Foo {
|
||||||
impl Foo {
|
impl Foo {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn add_method_to_impl1(&self) { }
|
pub fn add_method_to_impl1(&self) { }
|
||||||
|
|
||||||
|
@ -219,9 +219,7 @@ impl Foo {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_dirty(label="HirBody", cfg="cfail2")]
|
#[rustc_dirty(label="HirBody", cfg="cfail2")]
|
||||||
#[rustc_clean(label="HirBody", cfg="cfail3")]
|
#[rustc_clean(label="HirBody", cfg="cfail3")]
|
||||||
// At the moment we explicitly ignore argument names in metadata, since they
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
// are not used in downstream crates (except in rustdoc)
|
|
||||||
#[rustc_metadata_clean(cfg="cfail2")]
|
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn change_method_parameter_name(&self, b: i64) { }
|
pub fn change_method_parameter_name(&self, b: i64) { }
|
||||||
}
|
}
|
||||||
|
@ -287,9 +285,7 @@ impl Foo {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_dirty(label="HirBody", cfg="cfail2")]
|
#[rustc_dirty(label="HirBody", cfg="cfail2")]
|
||||||
#[rustc_clean(label="HirBody", cfg="cfail3")]
|
#[rustc_clean(label="HirBody", cfg="cfail3")]
|
||||||
// At the moment we explicitly ignore argument names in metadata, since they
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
// are not used in downstream crates (except in rustdoc)
|
|
||||||
#[rustc_metadata_clean(cfg="cfail2")]
|
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn change_method_parameter_order(&self, b: i64, a: i64) { }
|
pub fn change_method_parameter_order(&self, b: i64, a: i64) { }
|
||||||
}
|
}
|
||||||
|
@ -373,7 +369,7 @@ impl Foo {
|
||||||
impl Foo {
|
impl Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")] // Apparently unused lifetimes don't show up in the type.
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn add_lifetime_parameter_to_method<'a>(&self) { }
|
pub fn add_lifetime_parameter_to_method<'a>(&self) { }
|
||||||
}
|
}
|
||||||
|
@ -544,7 +540,7 @@ impl<T> Bar<T> {
|
||||||
impl<T: 'static> Bar<T> {
|
impl<T: 'static> Bar<T> {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn add_lifetime_bound_to_impl_parameter(&self) { }
|
pub fn add_lifetime_bound_to_impl_parameter(&self) { }
|
||||||
}
|
}
|
||||||
|
@ -565,7 +561,7 @@ impl<T> Bar<T> {
|
||||||
impl<T: Clone> Bar<T> {
|
impl<T: Clone> Bar<T> {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub fn add_trait_bound_to_impl_parameter(&self) { }
|
pub fn add_trait_bound_to_impl_parameter(&self) { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,9 +62,13 @@ struct TupleStructFieldType(i32);
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct TupleStructFieldType(u32);
|
struct TupleStructFieldType(
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
u32
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Tuple Struct Add Field ------------------------------------------------------
|
// Tuple Struct Add Field ------------------------------------------------------
|
||||||
|
@ -77,7 +81,13 @@ struct TupleStructAddField(i32);
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct TupleStructAddField(i32, u32);
|
struct TupleStructAddField(
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
i32,
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
u32
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Tuple Struct Field Visibility -----------------------------------------------
|
// Tuple Struct Field Visibility -----------------------------------------------
|
||||||
|
@ -101,9 +111,13 @@ struct RecordStructFieldType { x: f32 }
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct RecordStructFieldType { x: u64 }
|
struct RecordStructFieldType {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
x: u64
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Record Struct Field Name ----------------------------------------------------
|
// Record Struct Field Name ----------------------------------------------------
|
||||||
|
@ -129,7 +143,12 @@ struct RecordStructAddField { x: f32 }
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct RecordStructAddField { x: f32, y: () }
|
struct RecordStructAddField {
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
x: f32,
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
y: () }
|
||||||
|
|
||||||
|
|
||||||
// Record Struct Field Visibility ----------------------------------------------
|
// Record Struct Field Visibility ----------------------------------------------
|
||||||
|
@ -142,7 +161,11 @@ struct RecordStructFieldVisibility { x: f32 }
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct RecordStructFieldVisibility { pub x: f32 }
|
struct RecordStructFieldVisibility {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
pub x: f32
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add Lifetime Parameter ------------------------------------------------------
|
// Add Lifetime Parameter ------------------------------------------------------
|
||||||
|
@ -168,7 +191,14 @@ struct AddLifetimeParameterBound<'a, 'b>(&'a f32, &'b f64);
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct AddLifetimeParameterBound<'a, 'b: 'a>(&'a f32, &'b f64);
|
struct AddLifetimeParameterBound<'a, 'b: 'a>(
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
&'a f32,
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
&'b f64
|
||||||
|
);
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
struct AddLifetimeParameterBoundWhereClause<'a, 'b>(&'a f32, &'b f64);
|
struct AddLifetimeParameterBoundWhereClause<'a, 'b>(&'a f32, &'b f64);
|
||||||
|
@ -178,7 +208,13 @@ struct AddLifetimeParameterBoundWhereClause<'a, 'b>(&'a f32, &'b f64);
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct AddLifetimeParameterBoundWhereClause<'a, 'b>(&'a f32, &'b f64)
|
struct AddLifetimeParameterBoundWhereClause<'a, 'b>(
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
&'a f32,
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
&'b f64)
|
||||||
where 'b: 'a;
|
where 'b: 'a;
|
||||||
|
|
||||||
|
|
||||||
|
@ -192,7 +228,16 @@ struct AddTypeParameter<T1>(T1, T1);
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct AddTypeParameter<T1, T2>(T1, T2);
|
struct AddTypeParameter<T1, T2>(
|
||||||
|
// The field contains the parent's Generics, so it's dirty even though its
|
||||||
|
// type hasn't changed.
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
T1,
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
T2
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Add Type Parameter Bound ----------------------------------------------------
|
// Add Type Parameter Bound ----------------------------------------------------
|
||||||
|
@ -205,7 +250,11 @@ struct AddTypeParameterBound<T>(T);
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct AddTypeParameterBound<T: Send>(T);
|
struct AddTypeParameterBound<T: Send>(
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
T
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -216,7 +265,11 @@ struct AddTypeParameterBoundWhereClause<T>(T);
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct AddTypeParameterBoundWhereClause<T>(T) where T: Sync;
|
struct AddTypeParameterBoundWhereClause<T>(
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
T
|
||||||
|
) where T: Sync;
|
||||||
|
|
||||||
|
|
||||||
// Empty struct ----------------------------------------------------------------
|
// Empty struct ----------------------------------------------------------------
|
||||||
|
@ -234,6 +287,7 @@ struct Visibility;
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub struct Visibility;
|
pub struct Visibility;
|
||||||
|
|
||||||
|
@ -252,9 +306,13 @@ mod tuple_struct_change_field_type_indirectly {
|
||||||
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct TupleStruct(FieldType);
|
struct TupleStruct(
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
FieldType
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -267,9 +325,11 @@ mod record_struct_change_field_type_indirectly {
|
||||||
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
struct RecordStruct {
|
struct RecordStruct {
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
_x: FieldType
|
_x: FieldType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ trait TraitAddReturnType {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddReturnType {
|
trait TraitAddReturnType {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -121,7 +121,7 @@ trait TraitChangeReturnType {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeReturnType {
|
trait TraitChangeReturnType {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -142,7 +142,7 @@ trait TraitAddParameterToMethod {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddParameterToMethod {
|
trait TraitAddParameterToMethod {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -164,7 +164,7 @@ trait TraitChangeMethodParameterName {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeMethodParameterName {
|
trait TraitChangeMethodParameterName {
|
||||||
// FIXME(#38501) This should preferably always be clean.
|
// FIXME(#38501) This should preferably always be clean.
|
||||||
|
@ -194,7 +194,7 @@ trait TraitChangeMethodParameterType {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeMethodParameterType {
|
trait TraitChangeMethodParameterType {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -215,7 +215,7 @@ trait TraitChangeMethodParameterTypeRef {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeMethodParameterTypeRef {
|
trait TraitChangeMethodParameterTypeRef {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -236,7 +236,7 @@ trait TraitChangeMethodParametersOrder {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeMethodParametersOrder {
|
trait TraitChangeMethodParametersOrder {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -257,9 +257,13 @@ trait TraitAddMethodDefaultImplementation {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddMethodDefaultImplementation {
|
trait TraitAddMethodDefaultImplementation {
|
||||||
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn method() { }
|
fn method() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +297,7 @@ trait TraitChangeModeSelfRefToMut {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeModeSelfRefToMut {
|
trait TraitChangeModeSelfRefToMut {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -335,7 +339,7 @@ trait TraitChangeModeSelfOwnToRef {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeModeSelfOwnToRef {
|
trait TraitChangeModeSelfOwnToRef {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -356,7 +360,7 @@ trait TraitAddUnsafeModifier {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddUnsafeModifier {
|
trait TraitAddUnsafeModifier {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -377,7 +381,7 @@ trait TraitAddExternModifier {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddExternModifier {
|
trait TraitAddExternModifier {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -398,7 +402,7 @@ trait TraitChangeExternCToRustIntrinsic {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeExternCToRustIntrinsic {
|
trait TraitChangeExternCToRustIntrinsic {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -419,7 +423,7 @@ trait TraitAddTypeParameterToMethod {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddTypeParameterToMethod {
|
trait TraitAddTypeParameterToMethod {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -440,12 +444,12 @@ trait TraitAddLifetimeParameterToMethod {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddLifetimeParameterToMethod {
|
trait TraitAddLifetimeParameterToMethod {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")] // Unused lifetimes don't seem to show up in type?
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn method<'a>();
|
fn method<'a>();
|
||||||
}
|
}
|
||||||
|
@ -465,7 +469,7 @@ trait TraitAddTraitBoundToMethodTypeParameter {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddTraitBoundToMethodTypeParameter {
|
trait TraitAddTraitBoundToMethodTypeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -486,7 +490,7 @@ trait TraitAddBuiltinBoundToMethodTypeParameter {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddBuiltinBoundToMethodTypeParameter {
|
trait TraitAddBuiltinBoundToMethodTypeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -507,7 +511,7 @@ trait TraitAddLifetimeBoundToMethodLifetimeParameter {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddLifetimeBoundToMethodLifetimeParameter {
|
trait TraitAddLifetimeBoundToMethodLifetimeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -528,7 +532,7 @@ trait TraitAddSecondTraitBoundToMethodTypeParameter {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddSecondTraitBoundToMethodTypeParameter {
|
trait TraitAddSecondTraitBoundToMethodTypeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -549,7 +553,7 @@ trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
|
trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -570,7 +574,7 @@ trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
|
trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -585,7 +589,12 @@ trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
|
||||||
// Add associated type ------------------------------------------------------------
|
// Add associated type ------------------------------------------------------------
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
trait TraitAddAssociatedType {
|
trait TraitAddAssociatedType {
|
||||||
fn mathod();
|
|
||||||
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
|
@ -596,7 +605,7 @@ trait TraitAddAssociatedType {
|
||||||
trait TraitAddAssociatedType {
|
trait TraitAddAssociatedType {
|
||||||
type Associated;
|
type Associated;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -606,9 +615,12 @@ trait TraitAddAssociatedType {
|
||||||
trait TraitAddTraitBoundToAssociatedType {
|
trait TraitAddTraitBoundToAssociatedType {
|
||||||
type Associated;
|
type Associated;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Apparently the type bound contributes to the predicates of the trait, but
|
||||||
|
// does not change the associated item itself.
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
@ -617,11 +629,11 @@ trait TraitAddTraitBoundToAssociatedType {
|
||||||
trait TraitAddTraitBoundToAssociatedType {
|
trait TraitAddTraitBoundToAssociatedType {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
type Associated: ReferencedTrait0;
|
type Associated: ReferencedTrait0;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -631,7 +643,7 @@ trait TraitAddTraitBoundToAssociatedType {
|
||||||
trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
||||||
type Associated;
|
type Associated;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
|
@ -642,11 +654,11 @@ trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
||||||
trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
type Associated: 'a;
|
type Associated: 'a;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -656,18 +668,22 @@ trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
||||||
trait TraitAddDefaultToAssociatedType {
|
trait TraitAddDefaultToAssociatedType {
|
||||||
type Associated;
|
type Associated;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddDefaultToAssociatedType {
|
trait TraitAddDefaultToAssociatedType {
|
||||||
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
type Associated = ReferenceType0;
|
type Associated = ReferenceType0;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -675,7 +691,7 @@ trait TraitAddDefaultToAssociatedType {
|
||||||
// Add associated constant --------------------------------------------------------
|
// Add associated constant --------------------------------------------------------
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
trait TraitAddAssociatedConstant {
|
trait TraitAddAssociatedConstant {
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
|
@ -686,7 +702,7 @@ trait TraitAddAssociatedConstant {
|
||||||
trait TraitAddAssociatedConstant {
|
trait TraitAddAssociatedConstant {
|
||||||
const Value: u32;
|
const Value: u32;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -696,18 +712,26 @@ trait TraitAddAssociatedConstant {
|
||||||
trait TraitAddInitializerToAssociatedConstant {
|
trait TraitAddInitializerToAssociatedConstant {
|
||||||
const Value: u32;
|
const Value: u32;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitAddInitializerToAssociatedConstant {
|
trait TraitAddInitializerToAssociatedConstant {
|
||||||
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
const Value: u32 = 1;
|
const Value: u32 = 1;
|
||||||
|
|
||||||
fn mathod();
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -717,13 +741,13 @@ trait TraitAddInitializerToAssociatedConstant {
|
||||||
trait TraitChangeTypeOfAssociatedConstant {
|
trait TraitChangeTypeOfAssociatedConstant {
|
||||||
const Value: u32;
|
const Value: u32;
|
||||||
|
|
||||||
fn mathod();
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeTypeOfAssociatedConstant {
|
trait TraitChangeTypeOfAssociatedConstant {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -732,7 +756,11 @@ trait TraitChangeTypeOfAssociatedConstant {
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
const Value: f64;
|
const Value: f64;
|
||||||
|
|
||||||
fn mathod();
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
|
fn method();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1111,9 +1139,6 @@ trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
|
||||||
trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
|
trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// EDIT: Some more cases ----------------------------------------------------------
|
|
||||||
|
|
||||||
// Change return type of method indirectly by modifying a use statement------------
|
// Change return type of method indirectly by modifying a use statement------------
|
||||||
mod change_return_type_of_method_indirectly_use {
|
mod change_return_type_of_method_indirectly_use {
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -1123,7 +1148,7 @@ mod change_return_type_of_method_indirectly_use {
|
||||||
|
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeReturnType {
|
trait TraitChangeReturnType {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -1145,7 +1170,7 @@ mod change_method_parameter_type_indirectly_by_use {
|
||||||
|
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeArgType {
|
trait TraitChangeArgType {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -1167,7 +1192,7 @@ mod change_method_parameter_type_bound_indirectly_by_use {
|
||||||
|
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeBoundOfMethodTypeParameter {
|
trait TraitChangeBoundOfMethodTypeParameter {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -1190,7 +1215,7 @@ mod change_method_parameter_type_bound_indirectly_by_use_where {
|
||||||
|
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
trait TraitChangeBoundOfMethodTypeParameterWhere {
|
trait TraitChangeBoundOfMethodTypeParameterWhere {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
|
|
@ -120,7 +120,7 @@ impl ChangeMethodBodyTraitInlined for Foo {
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn method_name() {
|
fn method_name() {
|
||||||
()
|
panic!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ pub trait ChangeMethodSelfnessTrait {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl ChangeMethodSelfnessTrait for Foo {
|
impl ChangeMethodSelfnessTrait for Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -176,16 +176,14 @@ pub trait RemoveMethodSelfnessTrait {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl RemoveMethodSelfnessTrait for Foo {
|
impl RemoveMethodSelfnessTrait for Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn method_name() {
|
fn method_name() {}
|
||||||
()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change Method Selfmutness -----------------------------------------------------------
|
// Change Method Selfmutness -----------------------------------------------------------
|
||||||
|
@ -208,16 +206,14 @@ pub trait ChangeMethodSelfmutnessTrait {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl ChangeMethodSelfmutnessTrait for Foo {
|
impl ChangeMethodSelfmutnessTrait for Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn method_name(&mut self) {
|
fn method_name(&mut self) {}
|
||||||
()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change item kind -----------------------------------------------------------
|
// Change item kind -----------------------------------------------------------
|
||||||
|
@ -317,16 +313,20 @@ impl ChangeHasValueTrait for Foo {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
pub trait ChangeHasValueTrait {
|
pub trait ChangeHasValueTrait {
|
||||||
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn method_name() { }
|
fn method_name() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl ChangeHasValueTrait for Foo {
|
impl ChangeHasValueTrait for Foo {
|
||||||
fn method_name() { }
|
fn method_name() { }
|
||||||
|
@ -346,32 +346,16 @@ impl AddDefaultTrait for Foo {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl AddDefaultTrait for Foo {
|
impl AddDefaultTrait for Foo {
|
||||||
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
|
#[rustc_metadata_dirty(cfg="cfail2")]
|
||||||
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
default fn method_name() { }
|
default fn method_name() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove default
|
|
||||||
|
|
||||||
pub trait RemoveDefaultTrait {
|
|
||||||
fn method_name();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
|
||||||
impl RemoveDefaultTrait for Foo {
|
|
||||||
default fn method_name() { }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
|
||||||
impl RemoveDefaultTrait for Foo {
|
|
||||||
fn method_name() { }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add arguments
|
// Add arguments
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -392,7 +376,7 @@ pub trait AddArgumentTrait {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl AddArgumentTrait for Foo {
|
impl AddArgumentTrait for Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -422,7 +406,7 @@ pub trait ChangeArgumentTypeTrait {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
impl ChangeArgumentTypeTrait for Foo {
|
impl ChangeArgumentTypeTrait for Foo {
|
||||||
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
||||||
|
@ -504,7 +488,7 @@ impl<T> AddLifetimeBoundToImplParameter for T {
|
||||||
impl<T: 'static> AddLifetimeBoundToImplParameter for T {
|
impl<T: 'static> AddLifetimeBoundToImplParameter for T {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn id(self) -> Self { self }
|
fn id(self) -> Self { self }
|
||||||
}
|
}
|
||||||
|
@ -529,7 +513,7 @@ impl<T> AddTraitBoundToImplParameter for T {
|
||||||
impl<T: Clone> AddTraitBoundToImplParameter for T {
|
impl<T: Clone> AddTraitBoundToImplParameter for T {
|
||||||
#[rustc_clean(label="Hir", cfg="cfail2")]
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
||||||
#[rustc_clean(label="Hir", cfg="cfail3")]
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
#[rustc_metadata_clean(cfg="cfail2")]
|
||||||
#[rustc_metadata_clean(cfg="cfail3")]
|
#[rustc_metadata_clean(cfg="cfail3")]
|
||||||
fn id(self) -> Self { self }
|
fn id(self) -> Self { self }
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,13 +33,3 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _Struct {
|
|
||||||
#[rustc_metadata_dirty(cfg="cfail2")]
|
|
||||||
//[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
|
|
||||||
_field1: i32,
|
|
||||||
|
|
||||||
#[rustc_metadata_clean(cfg="cfail2")]
|
|
||||||
//[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
|
|
||||||
_field2: i32,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue