Auto merge of #68944 - Zoxc:hir-map, r=eddyb

Use queries for the HIR map

r? @eddyb cc @michaelwoerister
This commit is contained in:
bors 2020-03-15 20:40:16 +00:00
commit 45ebd5808a
108 changed files with 1548 additions and 1648 deletions

View file

@ -161,6 +161,12 @@ macro_rules! arena_types {
[] type_binding: rustc_hir::TypeBinding<$tcx>,
[] variant: rustc_hir::Variant<$tcx>,
[] where_predicate: rustc_hir::WherePredicate<$tcx>,
// HIR query types
[few] indexed_hir: rustc::hir::map::IndexedHir<$tcx>,
[few] hir_definitions: rustc::hir::map::definitions::Definitions,
[] hir_owner: rustc::hir::HirOwner<$tcx>,
[] hir_owner_items: rustc::hir::HirOwnerItems<$tcx>,
], $tcx);
)
}

View file

@ -35,7 +35,7 @@
//! "infer" some properties for each kind of `DepNode`:
//!
//! * Whether a `DepNode` of a given kind has any parameters at all. Some
//! `DepNode`s, like `AllLocalTraitImpls`, represent global concepts with only one value.
//! `DepNode`s could represent global concepts with only one value.
//! * Whether it is possible, in principle, to reconstruct a query key from a
//! given `DepNode`. Many `DepKind`s only require a single `DefId` parameter,
//! in which case it is possible to map the node's fingerprint back to the
@ -223,8 +223,8 @@ macro_rules! define_dep_nodes {
/// Construct a DepNode from the given DepKind and DefPathHash. This
/// method will assert that the given DepKind actually requires a
/// single DefId/DefPathHash parameter.
pub fn from_def_path_hash(kind: DepKind,
def_path_hash: DefPathHash)
pub fn from_def_path_hash(def_path_hash: DefPathHash,
kind: DepKind)
-> DepNode {
debug_assert!(kind.can_reconstruct_query_key() && kind.has_params());
DepNode {
@ -280,7 +280,7 @@ macro_rules! define_dep_nodes {
}
if kind.has_params() {
Ok(def_path_hash.to_dep_node(kind))
Ok(DepNode::from_def_path_hash(def_path_hash, kind))
} else {
Ok(DepNode::new_no_params(kind))
}
@ -337,28 +337,13 @@ impl fmt::Debug for DepNode {
}
}
impl DefPathHash {
pub fn to_dep_node(self, kind: DepKind) -> DepNode {
DepNode::from_def_path_hash(kind, self)
}
}
rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
// We use this for most things when incr. comp. is turned off.
[] Null,
// Represents the body of a function or method. The def-id is that of the
// function/method.
[eval_always] HirBody(DefId),
// Represents the HIR node with the given node-id
[eval_always] Hir(DefId),
// Represents metadata from an extern crate.
[eval_always] CrateMetadata(CrateNum),
[eval_always] AllLocalTraitImpls,
[anon] TraitSelect,
[] CompileCodegenUnit(Symbol),

View file

@ -225,28 +225,6 @@ impl DepGraph {
)
}
/// Creates a new dep-graph input with value `input`
pub fn input_task<'a, C, R>(&self, key: DepNode, cx: C, input: R) -> (R, DepNodeIndex)
where
C: DepGraphSafe + StableHashingContextProvider<'a>,
R: for<'b> HashStable<StableHashingContext<'b>>,
{
fn identity_fn<C, A>(_: C, arg: A) -> A {
arg
}
self.with_task_impl(
key,
cx,
input,
true,
identity_fn,
|_| None,
|data, key, fingerprint, _| data.alloc_node(key, SmallVec::new(), fingerprint),
hash_result::<R>,
)
}
fn with_task_impl<'a, C, A, R>(
&self,
key: DepNode,
@ -676,18 +654,25 @@ impl DepGraph {
continue;
}
} else {
// FIXME: This match is just a workaround for incremental bugs and should
// be removed. https://github.com/rust-lang/rust/issues/62649 is one such
// bug that must be fixed before removing this.
match dep_dep_node.kind {
DepKind::Hir | DepKind::HirBody | DepKind::CrateMetadata => {
DepKind::hir_owner
| DepKind::hir_owner_items
| DepKind::CrateMetadata => {
if let Some(def_id) = dep_dep_node.extract_def_id(tcx) {
if def_id_corresponds_to_hir_dep_node(tcx, def_id) {
// The `DefPath` has corresponding node,
// and that node should have been marked
// either red or green in `data.colors`.
bug!(
"DepNode {:?} should have been \
if dep_dep_node.kind == DepKind::CrateMetadata {
// The `DefPath` has corresponding node,
// and that node should have been marked
// either red or green in `data.colors`.
bug!(
"DepNode {:?} should have been \
pre-marked as red or green but wasn't.",
dep_dep_node
);
dep_dep_node
);
}
} else {
// This `DefPath` does not have a
// corresponding `DepNode` (e.g. a

View file

@ -1,9 +1,9 @@
use crate::dep_graph::{DepGraph, DepKind, DepNode, DepNodeIndex};
use crate::arena::Arena;
use crate::hir::map::definitions::{self, DefPathHash};
use crate::hir::map::{Entry, HirEntryMap, Map};
use crate::hir::map::{Entry, HirOwnerData, Map};
use crate::hir::{HirItem, HirOwner, HirOwnerItems};
use crate::ich::StableHashingContext;
use crate::middle::cstore::CrateStore;
use rustc_ast::ast::NodeId;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
@ -13,7 +13,7 @@ use rustc_hir::def_id::CRATE_DEF_INDEX;
use rustc_hir::def_id::{CrateNum, DefIndex, LOCAL_CRATE};
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_index::vec::IndexVec;
use rustc_index::vec::{Idx, IndexVec};
use rustc_session::{CrateDisambiguator, Session};
use rustc_span::source_map::SourceMap;
use rustc_span::{Span, Symbol, DUMMY_SP};
@ -22,76 +22,57 @@ use std::iter::repeat;
/// A visitor that walks over the HIR and collects `Node`s into a HIR map.
pub(super) struct NodeCollector<'a, 'hir> {
arena: &'hir Arena<'hir>,
/// The crate
krate: &'hir Crate<'hir>,
/// Source map
source_map: &'a SourceMap,
/// The node map
map: HirEntryMap<'hir>,
map: IndexVec<DefIndex, HirOwnerData<'hir>>,
/// The parent of this node
parent_node: hir::HirId,
// These fields keep track of the currently relevant DepNodes during
// the visitor's traversal.
current_dep_node_owner: DefIndex,
current_signature_dep_index: DepNodeIndex,
current_full_dep_index: DepNodeIndex,
currently_in_body: bool,
dep_graph: &'a DepGraph,
definitions: &'a definitions::Definitions,
hir_to_node_id: &'a FxHashMap<HirId, NodeId>,
hcx: StableHashingContext<'a>,
// We are collecting `DepNode::HirBody` hashes here so we can compute the
// crate hash from then later on.
// We are collecting HIR hashes here so we can compute the
// crate hash from them later on.
hir_body_nodes: Vec<(DefPathHash, Fingerprint)>,
}
fn input_dep_node_and_hash(
dep_graph: &DepGraph,
hcx: &mut StableHashingContext<'_>,
dep_node: DepNode,
input: impl for<'a> HashStable<StableHashingContext<'a>>,
) -> (DepNodeIndex, Fingerprint) {
let dep_node_index = dep_graph.input_task(dep_node, &mut *hcx, &input).1;
let hash = if dep_graph.is_fully_enabled() {
dep_graph.fingerprint_of(dep_node_index)
} else {
let mut stable_hasher = StableHasher::new();
input.hash_stable(hcx, &mut stable_hasher);
stable_hasher.finish()
};
(dep_node_index, hash)
fn insert_vec_map<K: Idx, V: Clone>(map: &mut IndexVec<K, Option<V>>, k: K, v: V) {
let i = k.index();
let len = map.len();
if i >= len {
map.extend(repeat(None).take(i - len + 1));
}
map[k] = Some(v);
}
fn alloc_hir_dep_nodes(
dep_graph: &DepGraph,
fn hash(
hcx: &mut StableHashingContext<'_>,
input: impl for<'a> HashStable<StableHashingContext<'a>>,
) -> Fingerprint {
let mut stable_hasher = StableHasher::new();
input.hash_stable(hcx, &mut stable_hasher);
stable_hasher.finish()
}
fn hash_body(
hcx: &mut StableHashingContext<'_>,
def_path_hash: DefPathHash,
item_like: impl for<'a> HashStable<StableHashingContext<'a>>,
hir_body_nodes: &mut Vec<(DefPathHash, Fingerprint)>,
) -> (DepNodeIndex, DepNodeIndex) {
let sig = dep_graph
.input_task(
def_path_hash.to_dep_node(DepKind::Hir),
&mut *hcx,
HirItemLike { item_like: &item_like, hash_bodies: false },
)
.1;
let (full, hash) = input_dep_node_and_hash(
dep_graph,
hcx,
def_path_hash.to_dep_node(DepKind::HirBody),
HirItemLike { item_like: &item_like, hash_bodies: true },
);
) -> Fingerprint {
let hash = hash(hcx, HirItemLike { item_like: &item_like });
hir_body_nodes.push((def_path_hash, hash));
(sig, full)
hash
}
fn upstream_crates(cstore: &dyn CrateStore) -> Vec<(Symbol, Fingerprint, Svh)> {
@ -112,24 +93,18 @@ fn upstream_crates(cstore: &dyn CrateStore) -> Vec<(Symbol, Fingerprint, Svh)> {
impl<'a, 'hir> NodeCollector<'a, 'hir> {
pub(super) fn root(
sess: &'a Session,
arena: &'hir Arena<'hir>,
krate: &'hir Crate<'hir>,
dep_graph: &'a DepGraph,
definitions: &'a definitions::Definitions,
hir_to_node_id: &'a FxHashMap<HirId, NodeId>,
mut hcx: StableHashingContext<'a>,
) -> NodeCollector<'a, 'hir> {
let root_mod_def_path_hash = definitions.def_path_hash(CRATE_DEF_INDEX);
let mut hir_body_nodes = Vec::new();
// Allocate `DepNode`s for the root module.
let (root_mod_sig_dep_index, root_mod_full_dep_index) = {
let hash = {
let Crate {
ref module,
// Crate attributes are not copied over to the root `Mod`, so hash
// them explicitly here.
ref attrs,
span,
ref item,
// These fields are handled separately:
exported_macros: _,
non_exported_macro_attrs: _,
@ -143,45 +118,26 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
proc_macros: _,
} = *krate;
alloc_hir_dep_nodes(
dep_graph,
&mut hcx,
root_mod_def_path_hash,
(module, attrs, span),
&mut hir_body_nodes,
)
hash_body(&mut hcx, root_mod_def_path_hash, item, &mut hir_body_nodes)
};
{
dep_graph.input_task(
DepNode::new_no_params(DepKind::AllLocalTraitImpls),
&mut hcx,
&krate.trait_impls,
);
}
let mut collector = NodeCollector {
arena,
krate,
source_map: sess.source_map(),
map: IndexVec::from_elem_n(IndexVec::new(), definitions.def_index_count()),
parent_node: hir::CRATE_HIR_ID,
current_signature_dep_index: root_mod_sig_dep_index,
current_full_dep_index: root_mod_full_dep_index,
current_dep_node_owner: CRATE_DEF_INDEX,
currently_in_body: false,
dep_graph,
definitions,
hir_to_node_id,
hcx,
hir_body_nodes,
map: (0..definitions.def_index_count())
.map(|_| HirOwnerData { signature: None, with_bodies: None })
.collect(),
};
collector.insert_entry(
hir::CRATE_HIR_ID,
Entry {
parent: hir::CRATE_HIR_ID,
dep_node: root_mod_sig_dep_index,
node: Node::Crate,
},
Entry { parent: hir::CRATE_HIR_ID, node: Node::Crate(&krate.item) },
hash,
);
collector
@ -192,7 +148,13 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
crate_disambiguator: CrateDisambiguator,
cstore: &dyn CrateStore,
commandline_args_hash: u64,
) -> (HirEntryMap<'hir>, Svh) {
) -> (IndexVec<DefIndex, HirOwnerData<'hir>>, Svh) {
// Insert bodies into the map
for (id, body) in self.krate.bodies.iter() {
let bodies = &mut self.map[id.hir_id.owner].with_bodies.as_mut().unwrap().bodies;
assert!(bodies.insert(id.hir_id.local_id, body).is_none());
}
self.hir_body_nodes.sort_unstable_by_key(|bn| bn.0);
let node_hashes = self.hir_body_nodes.iter().fold(
@ -232,32 +194,53 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
(self.map, svh)
}
fn insert_entry(&mut self, id: HirId, entry: Entry<'hir>) {
debug!("hir_map: {:?} => {:?}", id, entry);
let local_map = &mut self.map[id.owner];
fn insert_entry(&mut self, id: HirId, entry: Entry<'hir>, hash: Fingerprint) {
let i = id.local_id.as_u32() as usize;
let len = local_map.len();
if i >= len {
local_map.extend(repeat(None).take(i - len + 1));
let arena = self.arena;
let data = &mut self.map[id.owner];
if data.with_bodies.is_none() {
data.with_bodies = Some(arena.alloc(HirOwnerItems {
hash,
items: IndexVec::new(),
bodies: FxHashMap::default(),
}));
}
let items = data.with_bodies.as_mut().unwrap();
if i == 0 {
// Overwrite the dummy hash with the real HIR owner hash.
items.hash = hash;
// FIXME: feature(impl_trait_in_bindings) broken and trigger this assert
//assert!(data.signature.is_none());
data.signature =
Some(self.arena.alloc(HirOwner { parent: entry.parent, node: entry.node }));
} else {
assert_eq!(entry.parent.owner, id.owner);
insert_vec_map(
&mut items.items,
id.local_id,
HirItem { parent: entry.parent.local_id, node: entry.node },
);
}
local_map[id.local_id] = Some(entry);
}
fn insert(&mut self, span: Span, hir_id: HirId, node: Node<'hir>) {
let entry = Entry {
parent: self.parent_node,
dep_node: if self.currently_in_body {
self.current_full_dep_index
} else {
self.current_signature_dep_index
},
node,
};
self.insert_with_hash(span, hir_id, node, Fingerprint::ZERO)
}
fn insert_with_hash(&mut self, span: Span, hir_id: HirId, node: Node<'hir>, hash: Fingerprint) {
let entry = Entry { parent: self.parent_node, node };
// Make sure that the DepNode of some node coincides with the HirId
// owner of that node.
if cfg!(debug_assertions) {
let node_id = self.hir_to_node_id[&hir_id];
let node_id = self.definitions.hir_to_node_id(hir_id);
assert_eq!(self.definitions.node_to_hir_id(node_id), hir_id);
if hir_id.owner != self.current_dep_node_owner {
@ -287,7 +270,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
}
}
self.insert_entry(hir_id, entry);
self.insert_entry(hir_id, entry, hash);
}
fn with_parent<F: FnOnce(&mut Self)>(&mut self, parent_node_id: HirId, f: F) {
@ -299,7 +282,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
fn with_dep_node_owner<
T: for<'b> HashStable<StableHashingContext<'b>>,
F: FnOnce(&mut Self),
F: FnOnce(&mut Self, Fingerprint),
>(
&mut self,
dep_node_owner: DefIndex,
@ -307,29 +290,14 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
f: F,
) {
let prev_owner = self.current_dep_node_owner;
let prev_signature_dep_index = self.current_signature_dep_index;
let prev_full_dep_index = self.current_full_dep_index;
let prev_in_body = self.currently_in_body;
let def_path_hash = self.definitions.def_path_hash(dep_node_owner);
let (signature_dep_index, full_dep_index) = alloc_hir_dep_nodes(
self.dep_graph,
&mut self.hcx,
def_path_hash,
item_like,
&mut self.hir_body_nodes,
);
self.current_signature_dep_index = signature_dep_index;
self.current_full_dep_index = full_dep_index;
let hash = hash_body(&mut self.hcx, def_path_hash, item_like, &mut self.hir_body_nodes);
self.current_dep_node_owner = dep_node_owner;
self.currently_in_body = false;
f(self);
self.currently_in_body = prev_in_body;
f(self, hash);
self.current_dep_node_owner = prev_owner;
self.current_full_dep_index = prev_full_dep_index;
self.current_signature_dep_index = prev_signature_dep_index;
}
}
@ -340,7 +308,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
/// deep walking so that we walk nested items in the context of
/// their outer items.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
panic!("`visit_nested_xxx` must be manually implemented in this visitor");
}
@ -358,10 +326,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
}
fn visit_nested_body(&mut self, id: BodyId) {
let prev_in_body = self.currently_in_body;
self.currently_in_body = true;
self.visit_body(self.krate.body(id));
self.currently_in_body = prev_in_body;
}
fn visit_param(&mut self, param: &'hir Param<'hir>) {
@ -376,10 +341,10 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
debug!("visit_item: {:?}", i);
debug_assert_eq!(
i.hir_id.owner,
self.definitions.opt_def_index(self.hir_to_node_id[&i.hir_id]).unwrap()
self.definitions.opt_def_index(self.definitions.hir_to_node_id(i.hir_id)).unwrap()
);
self.with_dep_node_owner(i.hir_id.owner, i, |this| {
this.insert(i.span, i.hir_id, Node::Item(i));
self.with_dep_node_owner(i.hir_id.owner, i, |this, hash| {
this.insert_with_hash(i.span, i.hir_id, Node::Item(i), hash);
this.with_parent(i.hir_id, |this| {
if let ItemKind::Struct(ref struct_def, _) = i.kind {
// If this is a tuple or unit-like struct, register the constructor.
@ -408,10 +373,10 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
fn visit_trait_item(&mut self, ti: &'hir TraitItem<'hir>) {
debug_assert_eq!(
ti.hir_id.owner,
self.definitions.opt_def_index(self.hir_to_node_id[&ti.hir_id]).unwrap()
self.definitions.opt_def_index(self.definitions.hir_to_node_id(ti.hir_id)).unwrap()
);
self.with_dep_node_owner(ti.hir_id.owner, ti, |this| {
this.insert(ti.span, ti.hir_id, Node::TraitItem(ti));
self.with_dep_node_owner(ti.hir_id.owner, ti, |this, hash| {
this.insert_with_hash(ti.span, ti.hir_id, Node::TraitItem(ti), hash);
this.with_parent(ti.hir_id, |this| {
intravisit::walk_trait_item(this, ti);
@ -422,10 +387,10 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
fn visit_impl_item(&mut self, ii: &'hir ImplItem<'hir>) {
debug_assert_eq!(
ii.hir_id.owner,
self.definitions.opt_def_index(self.hir_to_node_id[&ii.hir_id]).unwrap()
self.definitions.opt_def_index(self.definitions.hir_to_node_id(ii.hir_id)).unwrap()
);
self.with_dep_node_owner(ii.hir_id.owner, ii, |this| {
this.insert(ii.span, ii.hir_id, Node::ImplItem(ii));
self.with_dep_node_owner(ii.hir_id.owner, ii, |this, hash| {
this.insert_with_hash(ii.span, ii.hir_id, Node::ImplItem(ii), hash);
this.with_parent(ii.hir_id, |this| {
intravisit::walk_impl_item(this, ii);
@ -541,11 +506,16 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
}
fn visit_macro_def(&mut self, macro_def: &'hir MacroDef<'hir>) {
let node_id = self.hir_to_node_id[&macro_def.hir_id];
let node_id = self.definitions.hir_to_node_id(macro_def.hir_id);
let def_index = self.definitions.opt_def_index(node_id).unwrap();
self.with_dep_node_owner(def_index, macro_def, |this| {
this.insert(macro_def.span, macro_def.hir_id, Node::MacroDef(macro_def));
self.with_dep_node_owner(def_index, macro_def, |this, hash| {
this.insert_with_hash(
macro_def.span,
macro_def.hir_id,
Node::MacroDef(macro_def),
hash,
);
});
}
@ -584,11 +554,8 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
}
}
// This is a wrapper structure that allows determining if span values within
// the wrapped item should be hashed or not.
struct HirItemLike<T> {
item_like: T,
hash_bodies: bool,
}
impl<'hir, T> HashStable<StableHashingContext<'hir>> for HirItemLike<T>
@ -596,7 +563,7 @@ where
T: HashStable<StableHashingContext<'hir>>,
{
fn hash_stable(&self, hcx: &mut StableHashingContext<'hir>, hasher: &mut StableHasher) {
hcx.while_hashing_hir_bodies(self.hash_bodies, |hcx| {
hcx.while_hashing_hir_bodies(true, |hcx| {
self.item_like.hash_stable(hcx, hasher);
});
}

View file

@ -6,7 +6,6 @@
use rustc_ast::ast;
use rustc_ast::node_id::NodeMap;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_hir as hir;
@ -17,10 +16,11 @@ use rustc_span::hygiene::ExpnId;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use std::borrow::Borrow;
use std::fmt::Write;
use std::hash::Hash;
pub use rustc_hir::def_id::DefPathHash;
/// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa.
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`
/// stores the `DefIndex` of its parent.
@ -80,7 +80,11 @@ pub struct Definitions {
table: DefPathTable,
node_to_def_index: NodeMap<DefIndex>,
def_index_to_node: IndexVec<DefIndex, ast::NodeId>,
pub(super) node_to_hir_id: IndexVec<ast::NodeId, hir::HirId>,
/// The reverse mapping of `node_to_hir_id`.
pub(super) hir_to_node_id: FxHashMap<hir::HirId, ast::NodeId>,
/// If `ExpnId` is an ID of some macro expansion,
/// then `DefId` is the normal module (`mod`) in which the expanded macro was defined.
parent_modules_of_macro_defs: FxHashMap<ExpnId, DefId>,
@ -282,28 +286,6 @@ pub enum DefPathData {
ImplTrait,
}
#[derive(
Copy,
Clone,
Hash,
PartialEq,
Eq,
PartialOrd,
Ord,
Debug,
RustcEncodable,
RustcDecodable,
HashStable
)]
pub struct DefPathHash(pub Fingerprint);
impl Borrow<Fingerprint> for DefPathHash {
#[inline]
fn borrow(&self) -> &Fingerprint {
&self.0
}
}
impl Definitions {
pub fn def_path_table(&self) -> &DefPathTable {
&self.table
@ -368,6 +350,11 @@ impl Definitions {
}
}
#[inline]
pub fn hir_to_node_id(&self, hir_id: hir::HirId) -> ast::NodeId {
self.hir_to_node_id[&hir_id]
}
#[inline]
pub fn node_to_hir_id(&self, node_id: ast::NodeId) -> hir::HirId {
self.node_to_hir_id[node_id]
@ -494,6 +481,13 @@ impl Definitions {
"trying to initialize `NodeId` -> `HirId` mapping twice"
);
self.node_to_hir_id = mapping;
// Build the reverse mapping of `node_to_hir_id`.
self.hir_to_node_id = self
.node_to_hir_id
.iter_enumerated()
.map(|(node_id, &hir_id)| (hir_id, node_id))
.collect();
}
pub fn expansion_that_defined(&self, index: DefIndex) -> ExpnId {

View file

@ -1,4 +1,5 @@
use crate::hir::map::Map;
use crate::ty::TyCtxt;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::{par_iter, Lock, ParallelIterator};
use rustc_hir as hir;
@ -7,12 +8,13 @@ use rustc_hir::intravisit;
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_hir::{HirId, ItemLocalId};
pub fn check_crate(hir_map: &Map<'_>, sess: &rustc_session::Session) {
hir_map.dep_graph.assert_ignored();
pub fn check_crate(tcx: TyCtxt<'_>) {
tcx.dep_graph.assert_ignored();
let errors = Lock::new(Vec::new());
let hir_map = tcx.hir();
par_iter(&hir_map.krate.modules).for_each(|(module_id, _)| {
par_iter(&hir_map.krate().modules).for_each(|(module_id, _)| {
let local_def_id = hir_map.local_def_id(*module_id);
hir_map.visit_item_likes_in_module(
local_def_id,
@ -24,24 +26,24 @@ pub fn check_crate(hir_map: &Map<'_>, sess: &rustc_session::Session) {
if !errors.is_empty() {
let message = errors.iter().fold(String::new(), |s1, s2| s1 + "\n" + s2);
sess.delay_span_bug(rustc_span::DUMMY_SP, &message);
tcx.sess.delay_span_bug(rustc_span::DUMMY_SP, &message);
}
}
struct HirIdValidator<'a, 'hir> {
hir_map: &'a Map<'hir>,
hir_map: Map<'hir>,
owner_def_index: Option<DefIndex>,
hir_ids_seen: FxHashSet<ItemLocalId>,
errors: &'a Lock<Vec<String>>,
}
struct OuterVisitor<'a, 'hir> {
hir_map: &'a Map<'hir>,
hir_map: Map<'hir>,
errors: &'a Lock<Vec<String>>,
}
impl<'a, 'hir> OuterVisitor<'a, 'hir> {
fn new_inner_visitor(&self, hir_map: &'a Map<'hir>) -> HirIdValidator<'a, 'hir> {
fn new_inner_visitor(&self, hir_map: Map<'hir>) -> HirIdValidator<'a, 'hir> {
HirIdValidator {
hir_map,
owner_def_index: None,
@ -109,9 +111,9 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
trace!("missing hir id {:#?}", hir_id);
missing_items.push(format!(
"[local_id: {}, node:{}]",
"[local_id: {}, owner: {}]",
local_id,
self.hir_map.node_to_string(hir_id)
self.hir_map.def_path(DefId::local(owner_def_index)).to_string_no_crate()
));
}
self.error(|| {
@ -135,7 +137,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
type Map = Map<'hir>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::OnlyBodies(self.hir_map)
}

View file

@ -3,14 +3,13 @@ pub use self::definitions::{
DefKey, DefPath, DefPathData, DefPathHash, Definitions, DisambiguatedDefPathData,
};
use crate::dep_graph::{DepGraph, DepKind, DepNode, DepNodeIndex};
use crate::middle::cstore::CrateStoreDyn;
use crate::hir::{HirOwner, HirOwnerItems};
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
use rustc_ast::ast::{self, Name, NodeId};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, LOCAL_CRATE};
use rustc_hir::intravisit;
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_hir::print::Nested;
@ -26,131 +25,124 @@ pub mod blocks;
mod collector;
pub mod definitions;
mod hir_id_validator;
pub use hir_id_validator::check_crate;
/// Represents an entry and its parent `HirId`.
#[derive(Copy, Clone, Debug)]
pub struct Entry<'hir> {
parent: HirId,
dep_node: DepNodeIndex,
node: Node<'hir>,
}
impl<'hir> Entry<'hir> {
fn parent_node(self) -> Option<HirId> {
match self.node {
Node::Crate | Node::MacroDef(_) => None,
Node::Crate(_) | Node::MacroDef(_) => None,
_ => Some(self.parent),
}
}
fn fn_decl(&self) -> Option<&'hir FnDecl<'hir>> {
match self.node {
Node::Item(ref item) => match item.kind {
ItemKind::Fn(ref sig, _, _) => Some(&sig.decl),
_ => None,
},
Node::TraitItem(ref item) => match item.kind {
TraitItemKind::Fn(ref sig, _) => Some(&sig.decl),
_ => None,
},
Node::ImplItem(ref item) => match item.kind {
ImplItemKind::Method(ref sig, _) => Some(&sig.decl),
_ => None,
},
Node::Expr(ref expr) => match expr.kind {
ExprKind::Closure(_, ref fn_decl, ..) => Some(fn_decl),
_ => None,
},
_ => None,
}
}
fn fn_sig(&self) -> Option<&'hir FnSig<'hir>> {
match &self.node {
Node::Item(item) => match &item.kind {
ItemKind::Fn(sig, _, _) => Some(sig),
_ => None,
},
Node::TraitItem(item) => match &item.kind {
TraitItemKind::Fn(sig, _) => Some(sig),
_ => None,
},
Node::ImplItem(item) => match &item.kind {
ImplItemKind::Method(sig, _) => Some(sig),
_ => None,
},
_ => None,
}
}
fn associated_body(self) -> Option<BodyId> {
match self.node {
Node::Item(item) => match item.kind {
ItemKind::Const(_, body) | ItemKind::Static(.., body) | ItemKind::Fn(.., body) => {
Some(body)
}
_ => None,
},
Node::TraitItem(item) => match item.kind {
TraitItemKind::Const(_, Some(body))
| TraitItemKind::Fn(_, TraitMethod::Provided(body)) => Some(body),
_ => None,
},
Node::ImplItem(item) => match item.kind {
ImplItemKind::Const(_, body) | ImplItemKind::Method(_, body) => Some(body),
_ => None,
},
Node::AnonConst(constant) => Some(constant.body),
Node::Expr(expr) => match expr.kind {
ExprKind::Closure(.., body, _, _) => Some(body),
_ => None,
},
_ => None,
}
}
fn is_body_owner(self, hir_id: HirId) -> bool {
match self.associated_body() {
Some(b) => b.hir_id == hir_id,
None => false,
}
}
}
/// This type is effectively a `HashMap<HirId, Entry<'hir>>`,
/// but it is implemented as 2 layers of arrays.
/// - first we have `A = IndexVec<DefIndex, B>` mapping `DefIndex`s to an inner value
/// - which is `B = IndexVec<ItemLocalId, Option<Entry<'hir>>` which gives you the `Entry`.
pub(super) type HirEntryMap<'hir> = IndexVec<DefIndex, IndexVec<ItemLocalId, Option<Entry<'hir>>>>;
fn fn_decl<'hir>(node: Node<'hir>) -> Option<&'hir FnDecl<'hir>> {
match node {
Node::Item(ref item) => match item.kind {
ItemKind::Fn(ref sig, _, _) => Some(&sig.decl),
_ => None,
},
/// Represents a mapping from `NodeId`s to AST elements and their parent `NodeId`s.
#[derive(Clone)]
pub struct Map<'hir> {
krate: &'hir Crate<'hir>,
Node::TraitItem(ref item) => match item.kind {
TraitItemKind::Fn(ref sig, _) => Some(&sig.decl),
_ => None,
},
pub dep_graph: DepGraph,
Node::ImplItem(ref item) => match item.kind {
ImplItemKind::Method(ref sig, _) => Some(&sig.decl),
_ => None,
},
Node::Expr(ref expr) => match expr.kind {
ExprKind::Closure(_, ref fn_decl, ..) => Some(fn_decl),
_ => None,
},
_ => None,
}
}
fn fn_sig<'hir>(node: Node<'hir>) -> Option<&'hir FnSig<'hir>> {
match &node {
Node::Item(item) => match &item.kind {
ItemKind::Fn(sig, _, _) => Some(sig),
_ => None,
},
Node::TraitItem(item) => match &item.kind {
TraitItemKind::Fn(sig, _) => Some(sig),
_ => None,
},
Node::ImplItem(item) => match &item.kind {
ImplItemKind::Method(sig, _) => Some(sig),
_ => None,
},
_ => None,
}
}
fn associated_body<'hir>(node: Node<'hir>) -> Option<BodyId> {
match node {
Node::Item(item) => match item.kind {
ItemKind::Const(_, body) | ItemKind::Static(.., body) | ItemKind::Fn(.., body) => {
Some(body)
}
_ => None,
},
Node::TraitItem(item) => match item.kind {
TraitItemKind::Const(_, Some(body))
| TraitItemKind::Fn(_, TraitMethod::Provided(body)) => Some(body),
_ => None,
},
Node::ImplItem(item) => match item.kind {
ImplItemKind::Const(_, body) | ImplItemKind::Method(_, body) => Some(body),
_ => None,
},
Node::AnonConst(constant) => Some(constant.body),
Node::Expr(expr) => match expr.kind {
ExprKind::Closure(.., body, _, _) => Some(body),
_ => None,
},
_ => None,
}
}
fn is_body_owner<'hir>(node: Node<'hir>, hir_id: HirId) -> bool {
match associated_body(node) {
Some(b) => b.hir_id == hir_id,
None => false,
}
}
pub(super) struct HirOwnerData<'hir> {
pub(super) signature: Option<&'hir HirOwner<'hir>>,
pub(super) with_bodies: Option<&'hir mut HirOwnerItems<'hir>>,
}
pub struct IndexedHir<'hir> {
/// The SVH of the local crate.
pub crate_hash: Svh,
map: HirEntryMap<'hir>,
pub(super) map: IndexVec<DefIndex, HirOwnerData<'hir>>,
}
definitions: Definitions,
/// The reverse mapping of `node_to_hir_id`.
hir_to_node_id: FxHashMap<HirId, NodeId>,
#[derive(Copy, Clone)]
pub struct Map<'hir> {
pub(super) tcx: TyCtxt<'hir>,
}
/// An iterator that walks up the ancestor tree of a given `HirId`.
@ -186,42 +178,18 @@ impl<'hir> Iterator for ParentHirIterator<'_, 'hir> {
}
impl<'hir> Map<'hir> {
/// This is used internally in the dependency tracking system.
/// Use the `krate` method to ensure your dependency on the
/// crate is tracked.
pub fn untracked_krate(&self) -> &Crate<'hir> {
&self.krate
pub fn krate(&self) -> &'hir Crate<'hir> {
self.tcx.hir_crate(LOCAL_CRATE)
}
#[inline]
fn lookup(&self, id: HirId) -> Option<&Entry<'hir>> {
let local_map = self.map.get(id.owner)?;
local_map.get(id.local_id)?.as_ref()
}
/// Registers a read in the dependency graph of the AST node with
/// the given `id`. This needs to be called each time a public
/// function returns the HIR for a node -- in other words, when it
/// "reveals" the content of a node to the caller (who might not
/// otherwise have had access to those contents, and hence needs a
/// read recorded). If the function just returns a DefId or
/// HirId, no actual content was returned, so no read is needed.
pub fn read(&self, hir_id: HirId) {
if let Some(entry) = self.lookup(hir_id) {
self.dep_graph.read_index(entry.dep_node);
} else {
bug!("called `HirMap::read()` with invalid `HirId`: {:?}", hir_id)
}
}
#[inline]
pub fn definitions(&self) -> &Definitions {
&self.definitions
pub fn definitions(&self) -> &'hir Definitions {
&self.tcx.definitions
}
pub fn def_key(&self, def_id: DefId) -> DefKey {
assert!(def_id.is_local());
self.definitions.def_key(def_id.index)
self.tcx.definitions.def_key(def_id.index)
}
pub fn def_path_from_hir_id(&self, id: HirId) -> Option<DefPath> {
@ -230,7 +198,7 @@ impl<'hir> Map<'hir> {
pub fn def_path(&self, def_id: DefId) -> DefPath {
assert!(def_id.is_local());
self.definitions.def_path(def_id.index)
self.tcx.definitions.def_path(def_id.index)
}
#[inline]
@ -259,42 +227,42 @@ impl<'hir> Map<'hir> {
#[inline]
pub fn opt_local_def_id(&self, hir_id: HirId) -> Option<DefId> {
let node_id = self.hir_to_node_id(hir_id);
self.definitions.opt_local_def_id(node_id)
self.tcx.definitions.opt_local_def_id(node_id)
}
#[inline]
pub fn opt_local_def_id_from_node_id(&self, node: NodeId) -> Option<DefId> {
self.definitions.opt_local_def_id(node)
self.tcx.definitions.opt_local_def_id(node)
}
#[inline]
pub fn as_local_node_id(&self, def_id: DefId) -> Option<NodeId> {
self.definitions.as_local_node_id(def_id)
self.tcx.definitions.as_local_node_id(def_id)
}
#[inline]
pub fn as_local_hir_id(&self, def_id: DefId) -> Option<HirId> {
self.definitions.as_local_hir_id(def_id)
self.tcx.definitions.as_local_hir_id(def_id)
}
#[inline]
pub fn hir_to_node_id(&self, hir_id: HirId) -> NodeId {
self.hir_to_node_id[&hir_id]
self.tcx.definitions.hir_to_node_id(hir_id)
}
#[inline]
pub fn node_to_hir_id(&self, node_id: NodeId) -> HirId {
self.definitions.node_to_hir_id(node_id)
self.tcx.definitions.node_to_hir_id(node_id)
}
#[inline]
pub fn def_index_to_hir_id(&self, def_index: DefIndex) -> HirId {
self.definitions.def_index_to_hir_id(def_index)
self.tcx.definitions.def_index_to_hir_id(def_index)
}
#[inline]
pub fn local_def_id_to_hir_id(&self, def_id: LocalDefId) -> HirId {
self.definitions.def_index_to_hir_id(def_id.to_def_id().index)
self.tcx.definitions.def_index_to_hir_id(def_id.to_def_id().index)
}
pub fn def_kind(&self, hir_id: HirId) -> Option<DefKind> {
@ -362,7 +330,7 @@ impl<'hir> Map<'hir> {
| Node::Lifetime(_)
| Node::Visibility(_)
| Node::Block(_)
| Node::Crate => return None,
| Node::Crate(_) => return None,
Node::MacroDef(_) => DefKind::Macro(MacroKind::Bang),
Node::GenericParam(param) => match param.kind {
GenericParamKind::Lifetime { .. } => return None,
@ -373,54 +341,62 @@ impl<'hir> Map<'hir> {
}
fn find_entry(&self, id: HirId) -> Option<Entry<'hir>> {
self.lookup(id).cloned()
Some(self.get_entry(id))
}
fn get_entry(&self, id: HirId) -> Entry<'hir> {
if id.local_id == ItemLocalId::from_u32_const(0) {
let owner = self.tcx.hir_owner(id.owner_def_id());
Entry { parent: owner.parent, node: owner.node }
} else {
let owner = self.tcx.hir_owner_items(id.owner_def_id());
let item = owner.items[id.local_id].as_ref().unwrap();
Entry { parent: HirId { owner: id.owner, local_id: item.parent }, node: item.node }
}
}
pub fn item(&self, id: HirId) -> &'hir Item<'hir> {
self.read(id);
// N.B., intentionally bypass `self.krate()` so that we
// do not trigger a read of the whole krate here
self.krate.item(id)
match self.find(id).unwrap() {
Node::Item(item) => item,
_ => bug!(),
}
}
pub fn trait_item(&self, id: TraitItemId) -> &'hir TraitItem<'hir> {
self.read(id.hir_id);
// N.B., intentionally bypass `self.krate()` so that we
// do not trigger a read of the whole krate here
self.krate.trait_item(id)
match self.find(id.hir_id).unwrap() {
Node::TraitItem(item) => item,
_ => bug!(),
}
}
pub fn impl_item(&self, id: ImplItemId) -> &'hir ImplItem<'hir> {
self.read(id.hir_id);
// N.B., intentionally bypass `self.krate()` so that we
// do not trigger a read of the whole krate here
self.krate.impl_item(id)
match self.find(id.hir_id).unwrap() {
Node::ImplItem(item) => item,
_ => bug!(),
}
}
pub fn body(&self, id: BodyId) -> &'hir Body<'hir> {
self.read(id.hir_id);
// N.B., intentionally bypass `self.krate()` so that we
// do not trigger a read of the whole krate here
self.krate.body(id)
self.tcx
.hir_owner_items(DefId::local(id.hir_id.owner))
.bodies
.get(&id.hir_id.local_id)
.unwrap()
}
pub fn fn_decl_by_hir_id(&self, hir_id: HirId) -> Option<&'hir FnDecl<'hir>> {
if let Some(entry) = self.find_entry(hir_id) {
entry.fn_decl()
if let Some(node) = self.find(hir_id) {
fn_decl(node)
} else {
bug!("no entry for hir_id `{}`", hir_id)
bug!("no node for hir_id `{}`", hir_id)
}
}
pub fn fn_sig_by_hir_id(&self, hir_id: HirId) -> Option<&'hir FnSig<'hir>> {
if let Some(entry) = self.find_entry(hir_id) {
entry.fn_sig()
if let Some(node) = self.find(hir_id) {
fn_sig(node)
} else {
bug!("no entry for hir_id `{}`", hir_id)
bug!("no node for hir_id `{}`", hir_id)
}
}
@ -429,7 +405,7 @@ impl<'hir> Map<'hir> {
/// item (possibly associated), a closure, or a `hir::AnonConst`.
pub fn body_owner(&self, BodyId { hir_id }: BodyId) -> HirId {
let parent = self.get_parent_node(hir_id);
assert!(self.lookup(parent).map_or(false, |e| e.is_body_owner(hir_id)));
assert!(self.find(parent).map_or(false, |n| is_body_owner(n, hir_id)));
parent
}
@ -440,14 +416,8 @@ impl<'hir> Map<'hir> {
/// Given a `HirId`, returns the `BodyId` associated with it,
/// if the node is a body owner, otherwise returns `None`.
pub fn maybe_body_owned_by(&self, hir_id: HirId) -> Option<BodyId> {
if let Some(entry) = self.find_entry(hir_id) {
if self.dep_graph.is_fully_enabled() {
let hir_id_owner = hir_id.owner;
let def_path_hash = self.definitions.def_path_hash(hir_id_owner);
self.dep_graph.read(def_path_hash.to_dep_node(DepKind::HirBody));
}
entry.associated_body()
if let Some(node) = self.find(hir_id) {
associated_body(node)
} else {
bug!("no entry for id `{}`", hir_id)
}
@ -499,29 +469,24 @@ impl<'hir> Map<'hir> {
}
pub fn trait_impls(&self, trait_did: DefId) -> &'hir [HirId] {
self.dep_graph.read(DepNode::new_no_params(DepKind::AllLocalTraitImpls));
// N.B., intentionally bypass `self.krate()` so that we
// do not trigger a read of the whole krate here
self.krate.trait_impls.get(&trait_did).map_or(&[], |xs| &xs[..])
self.tcx.all_local_trait_impls(LOCAL_CRATE).get(&trait_did).map_or(&[], |xs| &xs[..])
}
/// Gets the attributes on the crate. This is preferable to
/// invoking `krate.attrs` because it registers a tighter
/// dep-graph access.
pub fn krate_attrs(&self) -> &'hir [ast::Attribute] {
let def_path_hash = self.definitions.def_path_hash(CRATE_DEF_INDEX);
self.dep_graph.read(def_path_hash.to_dep_node(DepKind::Hir));
&self.krate.attrs
match self.get_entry(CRATE_HIR_ID).node {
Node::Crate(item) => item.attrs,
_ => bug!(),
}
}
pub fn get_module(&self, module: DefId) -> (&'hir Mod<'hir>, Span, HirId) {
let hir_id = self.as_local_hir_id(module).unwrap();
self.read(hir_id);
match self.find_entry(hir_id).unwrap().node {
match self.get_entry(hir_id).node {
Node::Item(&Item { span, kind: ItemKind::Mod(ref m), .. }) => (m, span, hir_id),
Node::Crate => (&self.krate.module, self.krate.span, hir_id),
Node::Crate(item) => (&item.module, item.span, hir_id),
node => panic!("not a module: {:?}", node),
}
}
@ -530,15 +495,7 @@ impl<'hir> Map<'hir> {
where
V: ItemLikeVisitor<'hir>,
{
let hir_id = self.as_local_hir_id(module).unwrap();
// Read the module so we'll be re-executed if new items
// appear immediately under in the module. If some new item appears
// in some nested item in the module, we'll be re-executed due to reads
// in the expect_* calls the loops below
self.read(hir_id);
let module = &self.krate.modules[&hir_id];
let module = self.tcx.hir_module_items(module);
for id in &module.items {
visitor.visit_item(self.expect_item(*id));
@ -555,12 +512,11 @@ impl<'hir> Map<'hir> {
/// Retrieves the `Node` corresponding to `id`, panicking if it cannot be found.
pub fn get(&self, id: HirId) -> Node<'hir> {
// read recorded by `find`
self.find(id).unwrap_or_else(|| bug!("couldn't find hir id {} in the HIR map", id))
}
pub fn get_if_local(&self, id: DefId) -> Option<Node<'hir>> {
self.as_local_hir_id(id).map(|id| self.get(id)) // read recorded by `get`
self.as_local_hir_id(id).map(|id| self.get(id))
}
pub fn get_generics(&self, id: DefId) -> Option<&'hir Generics<'hir>> {
@ -584,13 +540,8 @@ impl<'hir> Map<'hir> {
/// Retrieves the `Node` corresponding to `id`, returning `None` if cannot be found.
pub fn find(&self, hir_id: HirId) -> Option<Node<'hir>> {
let result = self
.find_entry(hir_id)
.and_then(|entry| if let Node::Crate = entry.node { None } else { Some(entry.node) });
if result.is_some() {
self.read(hir_id);
}
result
let node = self.get_entry(hir_id).node;
if let Node::Crate(..) = node { None } else { Some(node) }
}
/// Similar to `get_parent`; returns the parent HIR Id, or just `hir_id` if there
@ -604,13 +555,7 @@ impl<'hir> Map<'hir> {
/// from a node to the root of the HIR (unless you get back the same ID here,
/// which can happen if the ID is not in the map itself or is just weird).
pub fn get_parent_node(&self, hir_id: HirId) -> HirId {
if self.dep_graph.is_fully_enabled() {
let hir_id_owner = hir_id.owner;
let def_path_hash = self.definitions.def_path_hash(hir_id_owner);
self.dep_graph.read(def_path_hash.to_dep_node(DepKind::HirBody));
}
self.find_entry(hir_id).and_then(|x| x.parent_node()).unwrap_or(hir_id)
self.get_entry(hir_id).parent_node().unwrap_or(hir_id)
}
/// Returns an iterator for the nodes in the ancestor tree of the `current_id`
@ -655,9 +600,9 @@ impl<'hir> Map<'hir> {
/// Whether `hir_id` corresponds to a `mod` or a crate.
pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
match self.lookup(hir_id) {
Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. })
| Some(Entry { node: Node::Crate, .. }) => true,
match self.get_entry(hir_id) {
Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. }
| Entry { node: Node::Crate(..), .. } => true,
_ => false,
}
}
@ -734,7 +679,7 @@ impl<'hir> Map<'hir> {
pub fn get_parent_item(&self, hir_id: HirId) -> HirId {
for (hir_id, node) in self.parent_iter(hir_id) {
match node {
Node::Crate
Node::Crate(_)
| Node::Item(_)
| Node::ForeignItem(_)
| Node::TraitItem(_)
@ -847,7 +792,6 @@ impl<'hir> Map<'hir> {
node: Node::Item(Item { kind: ItemKind::ForeignMod(ref nm), .. }), ..
} = entry
{
self.read(hir_id); // reveals some of the content of a node
return nm.abi;
}
}
@ -856,7 +800,6 @@ impl<'hir> Map<'hir> {
pub fn expect_item(&self, id: HirId) -> &'hir Item<'hir> {
match self.find(id) {
// read recorded by `find`
Some(Node::Item(item)) => item,
_ => bug!("expected item, found {}", self.node_to_string(id)),
}
@ -906,7 +849,6 @@ impl<'hir> Map<'hir> {
pub fn expect_expr(&self, id: HirId) -> &'hir Expr<'hir> {
match self.find(id) {
// read recorded by find
Some(Node::Expr(expr)) => expr,
_ => bug!("expected expr, found {}", self.node_to_string(id)),
}
@ -938,7 +880,6 @@ impl<'hir> Map<'hir> {
/// Given a node ID, gets a list of attributes associated with the AST
/// corresponding to the node-ID.
pub fn attrs(&self, id: HirId) -> &'hir [ast::Attribute] {
self.read(id); // reveals attributes on the node
let attrs = match self.find_entry(id).map(|entry| entry.node) {
Some(Node::Param(a)) => Some(&a.attrs[..]),
Some(Node::Local(l)) => Some(&l.attrs[..]),
@ -955,53 +896,13 @@ impl<'hir> Map<'hir> {
// Unit/tuple structs/variants take the attributes straight from
// the struct/variant definition.
Some(Node::Ctor(..)) => return self.attrs(self.get_parent_item(id)),
Some(Node::Crate) => Some(&self.krate.attrs[..]),
Some(Node::Crate(item)) => Some(&item.attrs[..]),
_ => None,
};
attrs.unwrap_or(&[])
}
/// Returns an iterator that yields all the hir ids in the map.
fn all_ids<'a>(&'a self) -> impl Iterator<Item = HirId> + 'a {
// This code is a bit awkward because the map is implemented as 2 levels of arrays,
// see the comment on `HirEntryMap`.
// Iterate over all the indices and return a reference to
// local maps and their index given that they exist.
self.map.iter_enumerated().flat_map(move |(owner, local_map)| {
// Iterate over each valid entry in the local map.
local_map.iter_enumerated().filter_map(move |(i, entry)| {
entry.map(move |_| {
// Reconstruct the `HirId` based on the 3 indices we used to find it.
HirId { owner, local_id: i }
})
})
})
}
/// Returns an iterator that yields the node id's with paths that
/// match `parts`. (Requires `parts` is non-empty.)
///
/// For example, if given `parts` equal to `["bar", "quux"]`, then
/// the iterator will produce node id's for items with paths
/// such as `foo::bar::quux`, `bar::quux`, `other::bar::quux`, and
/// any other such items it can find in the map.
pub fn nodes_matching_suffix<'a>(
&'a self,
parts: &'a [String],
) -> impl Iterator<Item = NodeId> + 'a {
let nodes = NodesMatchingSuffix {
map: self,
item_name: parts.last().unwrap(),
in_which: &parts[..parts.len() - 1],
};
self.all_ids()
.filter(move |hir| nodes.matches_suffix(*hir))
.map(move |hir| self.hir_to_node_id(hir))
}
pub fn span(&self, hir_id: HirId) -> Span {
self.read(hir_id); // reveals span from node
match self.find_entry(hir_id).map(|entry| entry.node) {
Some(Node::Param(param)) => param.span,
Some(Node::Item(item)) => item.span,
@ -1034,7 +935,7 @@ impl<'hir> Map<'hir> {
Some(Node::Visibility(v)) => bug!("unexpected Visibility {:?}", v),
Some(Node::Local(local)) => local.span,
Some(Node::MacroDef(macro_def)) => macro_def.span,
Some(Node::Crate) => self.krate.span,
Some(Node::Crate(item)) => item.span,
None => bug!("hir::map::Map::span: id not in map: {:?}", hir_id),
}
}
@ -1082,82 +983,6 @@ impl<'hir> intravisit::Map<'hir> for Map<'hir> {
}
}
pub struct NodesMatchingSuffix<'a> {
map: &'a Map<'a>,
item_name: &'a String,
in_which: &'a [String],
}
impl<'a> NodesMatchingSuffix<'a> {
/// Returns `true` only if some suffix of the module path for parent
/// matches `self.in_which`.
///
/// In other words: let `[x_0,x_1,...,x_k]` be `self.in_which`;
/// returns true if parent's path ends with the suffix
/// `x_0::x_1::...::x_k`.
fn suffix_matches(&self, parent: HirId) -> bool {
let mut cursor = parent;
for part in self.in_which.iter().rev() {
let (mod_id, mod_name) = match find_first_mod_parent(self.map, cursor) {
None => return false,
Some((node_id, name)) => (node_id, name),
};
if mod_name.as_str() != *part {
return false;
}
cursor = self.map.get_parent_item(mod_id);
}
return true;
// Finds the first mod in parent chain for `id`, along with
// that mod's name.
//
// If `id` itself is a mod named `m` with parent `p`, then
// returns `Some(id, m, p)`. If `id` has no mod in its parent
// chain, then returns `None`.
fn find_first_mod_parent(map: &Map<'_>, mut id: HirId) -> Option<(HirId, Name)> {
loop {
if let Node::Item(item) = map.find(id)? {
if item_is_mod(&item) {
return Some((id, item.ident.name));
}
}
let parent = map.get_parent_item(id);
if parent == id {
return None;
}
id = parent;
}
fn item_is_mod(item: &Item<'_>) -> bool {
match item.kind {
ItemKind::Mod(_) => true,
_ => false,
}
}
}
}
// We are looking at some node `n` with a given name and parent
// id; do their names match what I am seeking?
fn matches_names(&self, parent_of_n: HirId, name: Name) -> bool {
name.as_str() == *self.item_name && self.suffix_matches(parent_of_n)
}
fn matches_suffix(&self, hir: HirId) -> bool {
let name = match self.map.find_entry(hir).map(|entry| entry.node) {
Some(Node::Item(n)) => n.name(),
Some(Node::ForeignItem(n)) => n.name(),
Some(Node::TraitItem(n)) => n.name(),
Some(Node::ImplItem(n)) => n.name(),
Some(Node::Variant(n)) => n.name(),
Some(Node::Field(n)) => n.name(),
_ => return false,
};
self.matches_names(self.map.get_parent_item(hir), name)
}
}
trait Named {
fn name(&self) -> Name;
}
@ -1199,39 +1024,24 @@ impl Named for ImplItem<'_> {
}
}
pub fn map_crate<'hir>(
sess: &rustc_session::Session,
cstore: &CrateStoreDyn,
krate: &'hir Crate<'hir>,
dep_graph: DepGraph,
definitions: Definitions,
) -> Map<'hir> {
let _prof_timer = sess.prof.generic_activity("build_hir_map");
pub(super) fn index_hir<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> &'tcx IndexedHir<'tcx> {
assert_eq!(cnum, LOCAL_CRATE);
// Build the reverse mapping of `node_to_hir_id`.
let hir_to_node_id = definitions
.node_to_hir_id
.iter_enumerated()
.map(|(node_id, &hir_id)| (hir_id, node_id))
.collect();
let _prof_timer = tcx.sess.prof.generic_activity("build_hir_map");
let (map, crate_hash) = {
let hcx = crate::ich::StableHashingContext::new(sess, krate, &definitions, cstore);
let hcx = tcx.create_stable_hashing_context();
let mut collector =
NodeCollector::root(sess, krate, &dep_graph, &definitions, &hir_to_node_id, hcx);
intravisit::walk_crate(&mut collector, krate);
NodeCollector::root(tcx.sess, &**tcx.arena, tcx.untracked_crate, &tcx.definitions, hcx);
intravisit::walk_crate(&mut collector, tcx.untracked_crate);
let crate_disambiguator = sess.local_crate_disambiguator();
let cmdline_args = sess.opts.dep_tracking_hash();
collector.finalize_and_compute_crate_hash(crate_disambiguator, cstore, cmdline_args)
let crate_disambiguator = tcx.sess.local_crate_disambiguator();
let cmdline_args = tcx.sess.opts.dep_tracking_hash();
collector.finalize_and_compute_crate_hash(crate_disambiguator, &*tcx.cstore, cmdline_args)
};
let map = Map { krate, dep_graph, crate_hash, map, hir_to_node_id, definitions };
sess.time("validate_HIR_map", || {
hir_id_validator::check_crate(&map, sess);
});
let map = tcx.arena.alloc(IndexedHir { crate_hash, map });
map
}
@ -1342,7 +1152,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
Some(Node::GenericParam(ref param)) => format!("generic_param {:?}{}", param, id_str),
Some(Node::Visibility(ref vis)) => format!("visibility {:?}{}", vis, id_str),
Some(Node::MacroDef(_)) => format!("macro {}{}", path_str(), id_str),
Some(Node::Crate) => String::from("root_crate"),
Some(Node::Crate(..)) => String::from("root_crate"),
None => format!("unknown node{}", id_str),
}
}

View file

@ -5,46 +5,59 @@
pub mod exports;
pub mod map;
use crate::ich::StableHashingContext;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
use rustc_hir::print;
use rustc_hir::Crate;
use rustc_hir::Body;
use rustc_hir::HirId;
use std::ops::Deref;
use rustc_hir::ItemLocalId;
use rustc_hir::Node;
use rustc_index::vec::IndexVec;
pub struct HirOwner<'tcx> {
parent: HirId,
node: Node<'tcx>,
}
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for HirOwner<'tcx> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
let HirOwner { parent, node } = self;
hcx.while_hashing_hir_bodies(false, |hcx| {
parent.hash_stable(hcx, hasher);
node.hash_stable(hcx, hasher);
});
}
}
/// A wrapper type which allows you to access HIR.
#[derive(Clone)]
pub struct Hir<'tcx> {
tcx: TyCtxt<'tcx>,
map: &'tcx map::Map<'tcx>,
pub struct HirItem<'tcx> {
parent: ItemLocalId,
node: Node<'tcx>,
}
impl<'tcx> Hir<'tcx> {
pub fn krate(&self) -> &'tcx Crate<'tcx> {
self.tcx.hir_crate(LOCAL_CRATE)
}
pub struct HirOwnerItems<'tcx> {
hash: Fingerprint,
items: IndexVec<ItemLocalId, Option<HirItem<'tcx>>>,
bodies: FxHashMap<ItemLocalId, &'tcx Body<'tcx>>,
}
impl<'tcx> Deref for Hir<'tcx> {
type Target = &'tcx map::Map<'tcx>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.map
}
}
impl<'hir> print::PpAnn for Hir<'hir> {
fn nested(&self, state: &mut print::State<'_>, nested: print::Nested) {
self.map.nested(state, nested)
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for HirOwnerItems<'tcx> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
// We ignore the `items` and `bodies` fields since these refer to information included in
// `hash` which is hashed in the collector and used for the crate hash.
let HirOwnerItems { hash, items: _, bodies: _ } = *self;
hash.hash_stable(hcx, hasher);
}
}
impl<'tcx> TyCtxt<'tcx> {
#[inline(always)]
pub fn hir(self) -> Hir<'tcx> {
Hir { tcx: self, map: &self.hir_map }
pub fn hir(self) -> map::Map<'tcx> {
map::Map { tcx: self }
}
pub fn parent_module(self, id: HirId) -> DefId {
@ -57,6 +70,17 @@ pub fn provide(providers: &mut Providers<'_>) {
let hir = tcx.hir();
hir.local_def_id(hir.get_module_parent_node(hir.as_local_hir_id(id).unwrap()))
};
providers.hir_crate = |tcx, _| tcx.hir_map.untracked_krate();
providers.hir_crate = |tcx, _| tcx.untracked_crate;
providers.index_hir = map::index_hir;
providers.hir_module_items = |tcx, id| {
assert_eq!(id.krate, LOCAL_CRATE);
let hir = tcx.hir();
let module = hir.as_local_hir_id(id).unwrap();
&tcx.untracked_crate.modules[&module]
};
providers.hir_owner = |tcx, id| tcx.index_hir(id.krate).map[id.index].signature.unwrap();
providers.hir_owner_items = |tcx, id| {
tcx.index_hir(id.krate).map[id.index].with_bodies.as_ref().map(|items| &**items).unwrap()
};
map::provide(providers);
}

View file

@ -7,7 +7,7 @@ use crate::ty::{fast_reject, TyCtxt};
use rustc_ast::ast;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::Lrc;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, DefIndex};
@ -164,15 +164,6 @@ impl<'a> StableHashingContext<'a> {
}
IGNORED_ATTRIBUTES.with(|attrs| attrs.contains(&name))
}
pub fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F) {
let prev_hash_node_ids = self.node_id_hashing_mode;
self.node_id_hashing_mode = NodeIdHashingMode::Ignore;
f(self);
self.node_id_hashing_mode = prev_hash_node_ids;
}
}
/// Something that can provide a stable hashing context.
@ -206,19 +197,6 @@ impl<'a> StableHashingContextProvider<'a> for StableHashingContext<'a> {
impl<'a> crate::dep_graph::DepGraphSafe for StableHashingContext<'a> {}
impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::HirId {
type KeyType = (DefPathHash, hir::ItemLocalId);
#[inline]
fn to_stable_hash_key(
&self,
hcx: &StableHashingContext<'a>,
) -> (DefPathHash, hir::ItemLocalId) {
let def_path_hash = hcx.local_def_path_hash(self.owner);
(def_path_hash, self.local_id)
}
}
impl<'a> HashStable<StableHashingContext<'a>> for ast::NodeId {
fn hash_stable(&self, _: &mut StableHashingContext<'a>, _: &mut StableHasher) {
panic!("Node IDs should not appear in incremental state");

View file

@ -6,7 +6,7 @@ use crate::ich::{Fingerprint, NodeIdHashingMode, StableHashingContext};
use rustc_attr as attr;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_INDEX};
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
use smallvec::SmallVec;
use std::mem;
@ -105,6 +105,20 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
}
}
}
fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F) {
let prev_hash_node_ids = self.node_id_hashing_mode;
self.node_id_hashing_mode = NodeIdHashingMode::Ignore;
f(self);
self.node_id_hashing_mode = prev_hash_node_ids;
}
#[inline]
fn local_def_path_hash(&self, def_index: DefIndex) -> DefPathHash {
self.local_def_path_hash(def_index)
}
}
impl<'a> ToStableHashKey<StableHashingContext<'a>> for DefId {
@ -158,59 +172,6 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::ItemLocalId {
}
}
impl<'a> HashStable<StableHashingContext<'a>> for hir::TraitItem<'_> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
let hir::TraitItem { hir_id: _, ident, ref attrs, ref generics, ref kind, span } = *self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
generics.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);
});
}
}
impl<'a> HashStable<StableHashingContext<'a>> for hir::ImplItem<'_> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
let hir::ImplItem {
hir_id: _,
ident,
ref vis,
defaultness,
ref attrs,
ref generics,
ref kind,
span,
} = *self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
vis.hash_stable(hcx, hasher);
defaultness.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
generics.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);
});
}
}
impl<'a> HashStable<StableHashingContext<'a>> for hir::Item<'_> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
let hir::Item { ident, ref attrs, hir_id: _, ref kind, ref vis, span } = *self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
vis.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);
});
}
}
impl<'a> HashStable<StableHashingContext<'a>> for hir::Body<'_> {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
let hir::Body { params, value, generator_kind } = self;

View file

@ -55,6 +55,37 @@ rustc_queries! {
desc { "get the crate HIR" }
}
// The indexed HIR. This can be conveniently accessed by `tcx.hir()`.
// Avoid calling this query directly.
query index_hir(_: CrateNum) -> &'tcx map::IndexedHir<'tcx> {
eval_always
no_hash
desc { "index HIR" }
}
// The items in a module.
// This can be conveniently accessed by `tcx.hir().visit_item_likes_in_module`.
// Avoid calling this query directly.
query hir_module_items(key: DefId) -> &'tcx hir::ModuleItems {
eval_always
}
// An HIR item with a `DefId` that can own other HIR items which do not themselves have
// a `DefId`.
// This can be conveniently accessed by methods on `tcx.hir()`.
// Avoid calling this query directly.
query hir_owner(key: DefId) -> &'tcx HirOwner<'tcx> {
eval_always
}
// The HIR items which do not themselves have a `DefId` and are owned by another HIR item
// with a `DefId`.
// This can be conveniently accessed by methods on `tcx.hir()`.
// Avoid calling this query directly.
query hir_owner_items(key: DefId) -> &'tcx HirOwnerItems<'tcx> {
eval_always
}
/// Records the type of every item.
query type_of(key: DefId) -> Ty<'tcx> {
cache_on_disk_if { key.is_local() }
@ -653,6 +684,9 @@ rustc_queries! {
}
TypeChecking {
query all_local_trait_impls(key: CrateNum) -> &'tcx BTreeMap<DefId, Vec<hir::HirId>> {
desc { "local trait impls" }
}
query trait_impls_of(key: DefId) -> &'tcx ty::trait_def::TraitImpls {
desc { |tcx| "trait impls of `{}`", tcx.def_path_str(key) }
}

View file

@ -5,6 +5,7 @@ use crate::dep_graph::DepGraph;
use crate::dep_graph::{self, DepConstructor};
use crate::hir::exports::Export;
use crate::hir::map as hir_map;
use crate::hir::map::definitions::Definitions;
use crate::hir::map::{DefPathData, DefPathHash};
use crate::ich::{NodeIdHashingMode, StableHashingContext};
use crate::infer::canonical::{Canonical, CanonicalVarInfo, CanonicalVarInfos};
@ -938,7 +939,7 @@ pub struct GlobalCtxt<'tcx> {
interners: CtxtInterners<'tcx>,
cstore: Box<CrateStoreDyn>,
pub(crate) cstore: Box<CrateStoreDyn>,
pub sess: &'tcx Session,
@ -971,8 +972,8 @@ pub struct GlobalCtxt<'tcx> {
/// Export map produced by name resolution.
export_map: FxHashMap<DefId, Vec<Export<hir::HirId>>>,
/// This should usually be accessed with the `tcx.hir()` method.
pub(crate) hir_map: hir_map::Map<'tcx>,
pub(crate) untracked_crate: &'tcx hir::Crate<'tcx>,
pub(crate) definitions: &'tcx Definitions,
/// A map from `DefPathHash` -> `DefId`. Includes `DefId`s from the local crate
/// as well as all upstream crates. Only populated in incremental mode.
@ -1116,7 +1117,9 @@ impl<'tcx> TyCtxt<'tcx> {
extern_providers: ty::query::Providers<'tcx>,
arena: &'tcx WorkerLocal<Arena<'tcx>>,
resolutions: ty::ResolverOutputs,
hir: hir_map::Map<'tcx>,
krate: &'tcx hir::Crate<'tcx>,
definitions: &'tcx Definitions,
dep_graph: DepGraph,
on_disk_query_result_cache: query::OnDiskCache<'tcx>,
crate_name: &str,
output_filenames: &OutputFilenames,
@ -1128,7 +1131,6 @@ impl<'tcx> TyCtxt<'tcx> {
let common_types = CommonTypes::new(&interners);
let common_lifetimes = CommonLifetimes::new(&interners);
let common_consts = CommonConsts::new(&interners, &common_types);
let dep_graph = hir.dep_graph.clone();
let cstore = resolutions.cstore;
let crates = cstore.crates_untracked();
let max_cnum = crates.iter().map(|c| c.as_usize()).max().unwrap_or(0);
@ -1139,7 +1141,7 @@ impl<'tcx> TyCtxt<'tcx> {
let def_path_tables = crates
.iter()
.map(|&cnum| (cnum, cstore.def_path_table(cnum)))
.chain(iter::once((LOCAL_CRATE, hir.definitions().def_path_table())));
.chain(iter::once((LOCAL_CRATE, definitions.def_path_table())));
// Precompute the capacity of the hashmap so we don't have to
// re-allocate when populating it.
@ -1159,11 +1161,11 @@ impl<'tcx> TyCtxt<'tcx> {
let mut trait_map: FxHashMap<_, FxHashMap<_, _>> = FxHashMap::default();
for (k, v) in resolutions.trait_map {
let hir_id = hir.node_to_hir_id(k);
let hir_id = definitions.node_to_hir_id(k);
let map = trait_map.entry(hir_id.owner).or_default();
let v = v
.into_iter()
.map(|tc| tc.map_import_ids(|id| hir.definitions().node_to_hir_id(id)))
.map(|tc| tc.map_import_ids(|id| definitions.node_to_hir_id(id)))
.collect();
map.insert(hir_id.local_id, StableVec::new(v));
}
@ -1185,28 +1187,31 @@ impl<'tcx> TyCtxt<'tcx> {
.export_map
.into_iter()
.map(|(k, v)| {
let exports: Vec<_> =
v.into_iter().map(|e| e.map_id(|id| hir.node_to_hir_id(id))).collect();
let exports: Vec<_> = v
.into_iter()
.map(|e| e.map_id(|id| definitions.node_to_hir_id(id)))
.collect();
(k, exports)
})
.collect(),
maybe_unused_trait_imports: resolutions
.maybe_unused_trait_imports
.into_iter()
.map(|id| hir.local_def_id_from_node_id(id))
.map(|id| definitions.local_def_id(id))
.collect(),
maybe_unused_extern_crates: resolutions
.maybe_unused_extern_crates
.into_iter()
.map(|(id, sp)| (hir.local_def_id_from_node_id(id), sp))
.map(|(id, sp)| (definitions.local_def_id(id), sp))
.collect(),
glob_map: resolutions
.glob_map
.into_iter()
.map(|(id, names)| (hir.local_def_id_from_node_id(id), names))
.map(|(id, names)| (definitions.local_def_id(id), names))
.collect(),
extern_prelude: resolutions.extern_prelude,
hir_map: hir,
untracked_crate: krate,
definitions,
def_path_hash_to_def_id,
queries: query::Queries::new(providers, extern_providers, on_disk_query_result_cache),
rcache: Default::default(),
@ -1286,7 +1291,7 @@ impl<'tcx> TyCtxt<'tcx> {
#[inline]
pub fn def_path_hash(self, def_id: DefId) -> hir_map::DefPathHash {
if def_id.is_local() {
self.hir().definitions().def_path_hash(def_id.index)
self.definitions.def_path_hash(def_id.index)
} else {
self.cstore.def_path_hash(def_id)
}
@ -1333,9 +1338,9 @@ impl<'tcx> TyCtxt<'tcx> {
#[inline(always)]
pub fn create_stable_hashing_context(self) -> StableHashingContext<'tcx> {
let krate = self.gcx.hir_map.untracked_krate();
let krate = self.gcx.untracked_crate;
StableHashingContext::new(self.sess, krate, self.hir().definitions(), &*self.cstore)
StableHashingContext::new(self.sess, krate, self.definitions, &*self.cstore)
}
// This method makes sure that we have a DepNode and a Fingerprint for

View file

@ -3142,8 +3142,11 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
context::provide(providers);
erase_regions::provide(providers);
layout::provide(providers);
*providers =
ty::query::Providers { trait_impls_of: trait_def::trait_impls_of_provider, ..*providers };
*providers = ty::query::Providers {
trait_impls_of: trait_def::trait_impls_of_provider,
all_local_trait_impls: trait_def::all_local_trait_impls,
..*providers
};
}
/// A map for the local crate mapping each type to a vector of its

View file

@ -1,5 +1,7 @@
use crate::dep_graph::{self, DepConstructor, DepNode, DepNodeParams};
use crate::hir::exports::Export;
use crate::hir::map;
use crate::hir::{HirOwner, HirOwnerItems};
use crate::infer::canonical::{self, Canonical};
use crate::lint::LintLevelMap;
use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
@ -54,6 +56,7 @@ use rustc_attr as attr;
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::ops::Deref;
use std::sync::Arc;
@ -176,10 +179,7 @@ pub fn force_from_dep_node<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> bool
rustc_dep_node_force!([dep_node, tcx]
// These are inputs that are expected to be pre-allocated and that
// should therefore always be red or green already.
DepKind::AllLocalTraitImpls |
DepKind::CrateMetadata |
DepKind::HirBody |
DepKind::Hir |
// These are anonymous nodes.
DepKind::TraitSelect |

View file

@ -5,11 +5,13 @@ use crate::ty::fast_reject;
use crate::ty::fold::TypeFoldable;
use crate::ty::{Ty, TyCtxt};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::def_id::{CrateNum, DefId};
use rustc_hir::HirId;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_macros::HashStable;
use std::collections::BTreeMap;
/// A trait's definition with type information.
#[derive(HashStable)]
@ -146,6 +148,14 @@ impl<'tcx> TyCtxt<'tcx> {
}
}
// Query provider for `all_local_trait_impls`.
pub(super) fn all_local_trait_impls<'tcx>(
tcx: TyCtxt<'tcx>,
krate: CrateNum,
) -> &'tcx BTreeMap<DefId, Vec<HirId>> {
&tcx.hir_crate(krate).trait_impls
}
// Query provider for `trait_impls_of`.
pub(super) fn trait_impls_of_provider(tcx: TyCtxt<'_>, trait_id: DefId) -> &TraitImpls {
let mut impls = TraitImpls::default();

View file

@ -535,9 +535,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
self.resolver.definitions().init_node_id_to_hir_id_mapping(self.node_id_to_hir_id);
hir::Crate {
module,
attrs,
span: c.span,
item: hir::CrateItem { module, attrs, span: c.span },
exported_macros: self.arena.alloc_from_iter(self.exported_macros),
non_exported_macro_attrs: self.arena.alloc_from_iter(self.non_exported_macro_attrs),
items: self.items,
@ -1464,7 +1462,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
impl<'r, 'a, 'v, 'hir> intravisit::Visitor<'v> for ImplTraitLifetimeCollector<'r, 'a, 'hir> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}

View file

@ -341,9 +341,9 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
let crate_name = tcx.crate_name(LOCAL_CRATE);
let crate_hash = tcx.crate_hash(LOCAL_CRATE);
let no_builtins = attr::contains_name(&tcx.hir().krate().attrs, sym::no_builtins);
let no_builtins = attr::contains_name(&tcx.hir().krate().item.attrs, sym::no_builtins);
let subsystem =
attr::first_attr_value_str_by_name(&tcx.hir().krate().attrs, sym::windows_subsystem);
attr::first_attr_value_str_by_name(&tcx.hir().krate().item.attrs, sym::windows_subsystem);
let windows_subsystem = subsystem.map(|subsystem| {
if subsystem != sym::windows && subsystem != sym::console {
tcx.sess.fatal(&format!(

View file

@ -106,7 +106,7 @@ trait HirPrinterSupport<'hir>: pprust_hir::PpAnn {
/// Provides a uniform interface for re-extracting a reference to an
/// `hir_map::Map` from a value that now owns it.
fn hir_map(&self) -> Option<&hir_map::Map<'hir>>;
fn hir_map(&self) -> Option<hir_map::Map<'hir>>;
/// Produces the pretty-print annotation object.
///
@ -142,8 +142,8 @@ impl<'hir> HirPrinterSupport<'hir> for NoAnn<'hir> {
self.sess
}
fn hir_map(&self) -> Option<&hir_map::Map<'hir>> {
self.tcx.map(|tcx| *tcx.hir())
fn hir_map(&self) -> Option<hir_map::Map<'hir>> {
self.tcx.map(|tcx| tcx.hir())
}
fn pp_ann(&self) -> &dyn pprust_hir::PpAnn {
@ -155,7 +155,7 @@ impl<'hir> pprust::PpAnn for NoAnn<'hir> {}
impl<'hir> pprust_hir::PpAnn for NoAnn<'hir> {
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested) {
if let Some(tcx) = self.tcx {
pprust_hir::PpAnn::nested(*tcx.hir(), state, nested)
pprust_hir::PpAnn::nested(&tcx.hir(), state, nested)
}
}
}
@ -216,8 +216,8 @@ impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
self.sess
}
fn hir_map(&self) -> Option<&hir_map::Map<'hir>> {
self.tcx.map(|tcx| *tcx.hir())
fn hir_map(&self) -> Option<hir_map::Map<'hir>> {
self.tcx.map(|tcx| tcx.hir())
}
fn pp_ann(&self) -> &dyn pprust_hir::PpAnn {
@ -228,7 +228,7 @@ impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
impl<'hir> pprust_hir::PpAnn for IdentifiedAnnotation<'hir> {
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested) {
if let Some(ref tcx) = self.tcx {
pprust_hir::PpAnn::nested(*tcx.hir(), state, nested)
pprust_hir::PpAnn::nested(&tcx.hir(), state, nested)
}
}
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) {
@ -315,8 +315,8 @@ impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
&self.tcx.sess
}
fn hir_map(&self) -> Option<&hir_map::Map<'tcx>> {
Some(&self.tcx.hir())
fn hir_map(&self) -> Option<hir_map::Map<'tcx>> {
Some(self.tcx.hir())
}
fn pp_ann(&self) -> &dyn pprust_hir::PpAnn {
@ -334,7 +334,7 @@ impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
if let pprust_hir::Nested::Body(id) = nested {
self.tables.set(self.tcx.body_tables(id));
}
pprust_hir::PpAnn::nested(*self.tcx.hir(), state, nested);
pprust_hir::PpAnn::nested(&self.tcx.hir(), state, nested);
self.tables.set(old_tables);
}
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) {

View file

@ -596,7 +596,7 @@ pub struct WhereEqPredicate<'hir> {
pub rhs_ty: &'hir Ty<'hir>,
}
#[derive(RustcEncodable, RustcDecodable, Debug)]
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
pub struct ModuleItems {
// Use BTreeSets here so items are in the same order as in the
// list of all items in Crate
@ -605,6 +605,14 @@ pub struct ModuleItems {
pub impl_items: BTreeSet<ImplItemId>,
}
/// A type representing only the top-level module.
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
pub struct CrateItem<'hir> {
pub module: Mod<'hir>,
pub attrs: &'hir [Attribute],
pub span: Span,
}
/// The top-level data structure that stores the entire contents of
/// the crate currently being compiled.
///
@ -613,9 +621,7 @@ pub struct ModuleItems {
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
#[derive(RustcEncodable, RustcDecodable, Debug)]
pub struct Crate<'hir> {
pub module: Mod<'hir>,
pub attrs: &'hir [Attribute],
pub span: Span,
pub item: CrateItem<'hir>,
pub exported_macros: &'hir [MacroDef<'hir>],
// Attributes from non-exported macros, kept only for collecting the library feature list.
pub non_exported_macro_attrs: &'hir [Attribute],
@ -2651,7 +2657,7 @@ pub type TraitMap<ID = HirId> = NodeMap<Vec<TraitCandidate<ID>>>;
// imported.
pub type GlobMap = NodeMap<FxHashSet<Name>>;
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, HashStable_Generic)]
pub enum Node<'hir> {
Param(&'hir Param<'hir>),
Item(&'hir Item<'hir>),
@ -2681,7 +2687,7 @@ pub enum Node<'hir> {
GenericParam(&'hir GenericParam<'hir>),
Visibility(&'hir Visibility<'hir>),
Crate,
Crate(&'hir CrateItem<'hir>),
}
impl Node<'_> {

View file

@ -134,7 +134,7 @@ pub trait Map<'hir> {
///
/// See the comments on `ItemLikeVisitor` for more details on the overall
/// visit strategy.
pub enum NestedVisitorMap<'this, M> {
pub enum NestedVisitorMap<M> {
/// Do not visit any nested things. When you add a new
/// "non-nested" thing, you will want to audit such uses to see if
/// they remain valid.
@ -151,20 +151,20 @@ pub enum NestedVisitorMap<'this, M> {
/// to use `visit_all_item_likes()` as an outer loop,
/// and to have the visitor that visits the contents of each item
/// using this setting.
OnlyBodies(&'this M),
OnlyBodies(M),
/// Visits all nested things, including item-likes.
///
/// **This is an unusual choice.** It is used when you want to
/// process everything within their lexical context. Typically you
/// kick off the visit by doing `walk_krate()`.
All(&'this M),
All(M),
}
impl<'this, M> NestedVisitorMap<'this, M> {
impl<M> NestedVisitorMap<M> {
/// Returns the map to use for an "intra item-like" thing (if any).
/// E.g., function body.
fn intra(self) -> Option<&'this M> {
fn intra(self) -> Option<M> {
match self {
NestedVisitorMap::None => None,
NestedVisitorMap::OnlyBodies(map) => Some(map),
@ -174,7 +174,7 @@ impl<'this, M> NestedVisitorMap<'this, M> {
/// Returns the map to use for an "item-like" thing (if any).
/// E.g., item, impl-item.
fn inter(self) -> Option<&'this M> {
fn inter(self) -> Option<M> {
match self {
NestedVisitorMap::None => None,
NestedVisitorMap::OnlyBodies(_) => None,
@ -221,7 +221,7 @@ pub trait Visitor<'v>: Sized {
/// `panic!()`. This way, if a new `visit_nested_XXX` variant is
/// added in the future, we will see the panic in your code and
/// fix it appropriately.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map>;
/// Invoked when a nested item is encountered. By default does
/// nothing unless you override `nested_visit_map` to return other than
@ -438,8 +438,8 @@ pub trait Visitor<'v>: Sized {
/// Walks the contents of a crate. See also `Crate::visit_all_items`.
pub fn walk_crate<'v, V: Visitor<'v>>(visitor: &mut V, krate: &'v Crate<'v>) {
visitor.visit_mod(&krate.module, krate.span, CRATE_HIR_ID);
walk_list!(visitor, visit_attribute, krate.attrs);
visitor.visit_mod(&krate.item.module, krate.item.span, CRATE_HIR_ID);
walk_list!(visitor, visit_attribute, krate.item.attrs);
walk_list!(visitor, visit_macro_def, krate.exported_macros);
}

View file

@ -102,7 +102,7 @@ impl<'a> State<'a> {
Node::Ctor(..) => panic!("cannot print isolated Ctor"),
Node::Local(a) => self.print_local_decl(&a),
Node::MacroDef(_) => panic!("cannot print MacroDef"),
Node::Crate => panic!("cannot print Crate"),
Node::Crate(..) => panic!("cannot print Crate"),
}
}
}
@ -151,7 +151,7 @@ pub fn print_crate<'a>(
// When printing the AST, we sometimes need to inject `#[no_std]` here.
// Since you can't compile the HIR, it's not necessary.
s.print_mod(&krate.module, &krate.attrs);
s.print_mod(&krate.item.module, &krate.item.attrs);
s.print_remaining_comments();
s.s.eof()
}

View file

@ -1,7 +1,11 @@
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
use crate::hir::{BodyId, Expr, ImplItemId, ItemId, Mod, TraitItemId, Ty, VisibilityKind};
use crate::hir_id::HirId;
use crate::hir::{
BodyId, Expr, ImplItem, ImplItemId, Item, ItemId, Mod, TraitItem, TraitItemId, Ty,
VisibilityKind,
};
use crate::hir_id::{HirId, ItemLocalId};
use rustc_span::def_id::{DefIndex, DefPathHash};
/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
@ -16,6 +20,36 @@ pub trait HashStableContext:
fn hash_hir_expr(&mut self, _: &Expr<'_>, hasher: &mut StableHasher);
fn hash_hir_ty(&mut self, _: &Ty<'_>, hasher: &mut StableHasher);
fn hash_hir_visibility_kind(&mut self, _: &VisibilityKind<'_>, hasher: &mut StableHasher);
fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F);
fn local_def_path_hash(&self, def_index: DefIndex) -> DefPathHash;
}
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for HirId {
type KeyType = (DefPathHash, ItemLocalId);
#[inline]
fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) {
let def_path_hash = hcx.local_def_path_hash(self.owner);
(def_path_hash, self.local_id)
}
}
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for TraitItemId {
type KeyType = (DefPathHash, ItemLocalId);
#[inline]
fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) {
self.hir_id.to_stable_hash_key(hcx)
}
}
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ImplItemId {
type KeyType = (DefPathHash, ItemLocalId);
#[inline]
fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) {
self.hir_id.to_stable_hash_key(hcx)
}
}
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for HirId {
@ -78,3 +112,56 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for VisibilityKind<'_>
hcx.hash_hir_visibility_kind(self, hasher)
}
}
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItem<'_> {
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
let TraitItem { hir_id: _, ident, ref attrs, ref generics, ref kind, span } = *self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
generics.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);
});
}
}
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItem<'_> {
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
let ImplItem {
hir_id: _,
ident,
ref vis,
defaultness,
ref attrs,
ref generics,
ref kind,
span,
} = *self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
vis.hash_stable(hcx, hasher);
defaultness.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
generics.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);
});
}
}
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Item<'_> {
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
let Item { ident, ref attrs, hir_id: _, ref kind, ref vis, span } = *self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
vis.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);
});
}
}

View file

@ -68,7 +68,7 @@ pub fn assert_dep_graph(tcx: TyCtxt<'_>) {
let (if_this_changed, then_this_would_need) = {
let mut visitor =
IfThisChanged { tcx, if_this_changed: vec![], then_this_would_need: vec![] };
visitor.process_attrs(hir::CRATE_HIR_ID, &tcx.hir().krate().attrs);
visitor.process_attrs(hir::CRATE_HIR_ID, &tcx.hir().krate().item.attrs);
tcx.hir().krate().visit_all_item_likes(&mut visitor.as_deep_visitor());
(visitor.if_this_changed, visitor.then_this_would_need)
};
@ -120,7 +120,7 @@ impl IfThisChanged<'tcx> {
if attr.check_name(sym::rustc_if_this_changed) {
let dep_node_interned = self.argument(attr);
let dep_node = match dep_node_interned {
None => def_path_hash.to_dep_node(DepKind::Hir),
None => DepNode::from_def_path_hash(def_path_hash, DepKind::hir_owner),
Some(n) => match DepNode::from_label_string(&n.as_str(), def_path_hash) {
Ok(n) => n,
Err(()) => {
@ -162,8 +162,8 @@ impl IfThisChanged<'tcx> {
impl Visitor<'tcx> for IfThisChanged<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {

View file

@ -44,7 +44,7 @@ pub fn assert_module_sources(tcx: TyCtxt<'_>) {
let ams = AssertModuleSource { tcx, available_cgus };
for attr in tcx.hir().krate().attrs {
for attr in tcx.hir().krate().item.attrs {
ams.check_attr(attr);
}
})

View file

@ -53,9 +53,9 @@ const BASE_FN: &[&str] = &[
/// DepNodes for Hir, which is pretty much everything
const BASE_HIR: &[&str] = &[
// Hir and HirBody should be computed for all nodes
label_strs::Hir,
label_strs::HirBody,
// hir_owner and hir_owner_items should be computed for all nodes
label_strs::hir_owner,
label_strs::hir_owner_items,
];
/// `impl` implementation of struct/trait
@ -548,8 +548,8 @@ impl FindAllAttrs<'tcx> {
impl intravisit::Visitor<'tcx> for FindAllAttrs<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
intravisit::NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::All(self.tcx.hir())
}
fn visit_attribute(&mut self, attr: &'tcx Attribute) {

View file

@ -16,7 +16,7 @@ use std::borrow::Cow;
struct FindLocalByTypeVisitor<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>,
target_ty: Ty<'tcx>,
hir_map: &'a Map<'tcx>,
hir_map: Map<'tcx>,
found_local_pattern: Option<&'tcx Pat<'tcx>>,
found_arg_pattern: Option<&'tcx Pat<'tcx>>,
found_ty: Option<Ty<'tcx>>,
@ -25,7 +25,7 @@ struct FindLocalByTypeVisitor<'a, 'tcx> {
}
impl<'a, 'tcx> FindLocalByTypeVisitor<'a, 'tcx> {
fn new(infcx: &'a InferCtxt<'a, 'tcx>, target_ty: Ty<'tcx>, hir_map: &'a Map<'tcx>) -> Self {
fn new(infcx: &'a InferCtxt<'a, 'tcx>, target_ty: Ty<'tcx>, hir_map: Map<'tcx>) -> Self {
Self {
infcx,
target_ty,
@ -69,8 +69,8 @@ impl<'a, 'tcx> FindLocalByTypeVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for FindLocalByTypeVisitor<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.hir_map)
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.hir_map)
}
fn visit_local(&mut self, local: &'tcx Local<'tcx>) {
@ -223,7 +223,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
let ty = self.resolve_vars_if_possible(&ty);
let (name, name_sp, descr, parent_name, parent_descr) = self.extract_type_name(&ty, None);
let mut local_visitor = FindLocalByTypeVisitor::new(&self, ty, &self.tcx.hir());
let mut local_visitor = FindLocalByTypeVisitor::new(&self, ty, self.tcx.hir());
let ty_to_string = |ty: Ty<'tcx>| -> String {
let mut s = String::new();
let mut printer = ty::print::FmtPrinter::new(self.tcx, &mut s, Namespace::TypeNS);

View file

@ -93,8 +93,8 @@ struct FindNestedTypeVisitor<'tcx> {
impl Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_ty(&mut self, arg: &'tcx hir::Ty<'tcx>) {
@ -212,8 +212,8 @@ struct TyPathVisitor<'tcx> {
impl Visitor<'tcx> for TyPathVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, Map<'tcx>> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Map<'tcx>> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_lifetime(&mut self, lifetime: &hir::Lifetime) {

View file

@ -5,7 +5,7 @@ use crate::util;
use log::{info, log_enabled, warn};
use rustc::arena::Arena;
use rustc::dep_graph::DepGraph;
use rustc::hir::map;
use rustc::hir::map::Definitions;
use rustc::lint;
use rustc::middle;
use rustc::middle::cstore::{CrateStore, MetadataLoader, MetadataLoaderDyn};
@ -713,10 +713,7 @@ pub fn create_global_ctxt<'tcx>(
arena: &'tcx WorkerLocal<Arena<'tcx>>,
) -> QueryContext<'tcx> {
let sess = &compiler.session();
let defs = mem::take(&mut resolver_outputs.definitions);
// Construct the HIR map.
let hir_map = map::map_crate(sess, &*resolver_outputs.cstore, krate, dep_graph, defs);
let defs: &'tcx Definitions = arena.alloc(mem::take(&mut resolver_outputs.definitions));
let query_result_on_disk_cache = rustc_incremental::load_query_result_cache(sess);
@ -742,7 +739,9 @@ pub fn create_global_ctxt<'tcx>(
extern_providers,
arena,
resolver_outputs,
hir_map,
krate,
defs,
dep_graph,
query_result_on_disk_cache,
&crate_name,
&outputs,
@ -763,6 +762,8 @@ pub fn create_global_ctxt<'tcx>(
fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
assert_eq!(cnum, LOCAL_CRATE);
rustc::hir::map::check_crate(tcx);
let sess = tcx.sess;
let mut entry_point = None;

View file

@ -399,7 +399,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
}
fn check_crate(&mut self, cx: &LateContext<'_, '_>, krate: &hir::Crate<'_>) {
self.check_missing_docs_attrs(cx, None, &krate.attrs, krate.span, "crate");
self.check_missing_docs_attrs(cx, None, &krate.item.attrs, krate.item.span, "crate");
for macro_def in krate.exported_macros {
let has_doc = macro_def.attrs.iter().any(|a| has_doc(a));
@ -1073,7 +1073,7 @@ impl TypeAliasBounds {
impl<'a, 'db, 'v> Visitor<'v> for WalkAssocTypes<'a, 'db> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}

View file

@ -99,8 +99,8 @@ impl<'a, 'tcx, T: LateLintPass<'a, 'tcx>> hir_visit::Visitor<'tcx>
/// Because lints are scoped lexically, we want to walk nested
/// items in the context of the outer item, so enable
/// deep-walking.
fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<'_, Self::Map> {
hir_visit::NestedVisitorMap::All(&self.context.tcx.hir())
fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<Self::Map> {
hir_visit::NestedVisitorMap::All(self.context.tcx.hir())
}
fn visit_nested_body(&mut self, body: hir::BodyId) {
@ -419,7 +419,7 @@ fn late_lint_pass_crate<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(tcx: TyCtxt<'tc
let mut cx = LateContextAndPass { context, pass };
// Visit the whole crate.
cx.with_lint_attrs(hir::CRATE_HIR_ID, &krate.attrs, |cx| {
cx.with_lint_attrs(hir::CRATE_HIR_ID, &krate.item.attrs, |cx| {
// since the root module isn't visited as an item (because it isn't an
// item), warn for it here.
lint_callback!(cx, check_crate, krate);

View file

@ -29,7 +29,7 @@ fn lint_levels(tcx: TyCtxt<'_>, cnum: CrateNum) -> &LintLevelMap {
let mut builder = LintLevelMapBuilder { levels, tcx, store };
let krate = tcx.hir().krate();
let push = builder.levels.push(&krate.attrs, &store);
let push = builder.levels.push(&krate.item.attrs, &store);
builder.levels.register_id(hir::CRATE_HIR_ID);
for macro_def in krate.exported_macros {
builder.levels.register_id(macro_def.hir_id);
@ -438,8 +438,8 @@ impl LintLevelMapBuilder<'_, '_> {
impl<'tcx> intravisit::Visitor<'tcx> for LintLevelMapBuilder<'_, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
intravisit::NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::All(self.tcx.hir())
}
fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) {

View file

@ -8,7 +8,7 @@ crate fn collect(tcx: TyCtxt<'_>) -> Vec<String> {
let mut collector = Collector { args: Vec::new() };
tcx.hir().krate().visit_all_item_likes(&mut collector);
for attr in tcx.hir().krate().attrs.iter() {
for attr in tcx.hir().krate().item.attrs.iter() {
if attr.has_name(sym::link_args) {
if let Some(linkarg) = attr.value_str() {
collector.add_link_args(&linkarg.as_str());

View file

@ -4,7 +4,7 @@ use crate::creader::CrateMetadataRef;
use crate::rmeta::table::{FixedSizeEncoding, Table};
use crate::rmeta::*;
use rustc::dep_graph::{self, DepNodeIndex};
use rustc::dep_graph::{self, DepNode, DepNodeIndex};
use rustc::hir::exports::Export;
use rustc::hir::map::definitions::DefPathTable;
use rustc::hir::map::{DefKey, DefPath, DefPathData, DefPathHash};
@ -1607,7 +1607,8 @@ impl CrateMetadata {
// would always write the same value.
let def_path_hash = self.def_path_hash(CRATE_DEF_INDEX);
let dep_node = def_path_hash.to_dep_node(dep_graph::DepKind::CrateMetadata);
let dep_node =
DepNode::from_def_path_hash(def_path_hash, dep_graph::DepKind::CrateMetadata);
dep_node_index = tcx.dep_graph.dep_node_index_of(&dep_node);
assert!(dep_node_index != DepNodeIndex::INVALID);

View file

@ -140,7 +140,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
cdata.get_deprecation(def_id.index).map(DeprecationEntry::external)
}
item_attrs => { cdata.get_item_attrs(def_id.index, tcx.sess) }
// FIXME(#38501) We've skipped a `read` on the `HirBody` of
// FIXME(#38501) We've skipped a `read` on the `hir_owner_items` of
// a `fn` when encoding, so the dep-tracking wouldn't work.
// This is only used by rustdoc anyway, which shouldn't have
// incremental recompilation ever enabled.

View file

@ -331,7 +331,7 @@ impl<'tcx> EncodeContext<'tcx> {
fn encode_info_for_items(&mut self) {
let krate = self.tcx.hir().krate();
let vis = Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Public };
self.encode_info_for_mod(hir::CRATE_HIR_ID, &krate.module, &krate.attrs, &vis);
self.encode_info_for_mod(hir::CRATE_HIR_ID, &krate.item.module, &krate.item.attrs, &vis);
krate.visit_all_item_likes(&mut self.as_deep_visitor());
for macro_def in krate.exported_macros {
self.visit_macro_def(macro_def);
@ -1502,8 +1502,8 @@ impl EncodeContext<'tcx> {
impl Visitor<'tcx> for EncodeContext<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) {
intravisit::walk_expr(self, ex);

View file

@ -453,7 +453,7 @@ struct UnusedUnsafeVisitor<'a> {
impl<'a, 'tcx> intravisit::Visitor<'tcx> for UnusedUnsafeVisitor<'a> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}

View file

@ -87,7 +87,7 @@ fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &DefIdSet {
intravisit::walk_struct_def(self, v)
}
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}

View file

@ -45,7 +45,7 @@ struct MatchVisitor<'a, 'tcx> {
impl<'tcx> Visitor<'tcx> for MatchVisitor<'_, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -755,7 +755,7 @@ fn check_legality_of_bindings_in_at_patterns(cx: &MatchVisitor<'_, '_>, pat: &Pa
impl<'v> Visitor<'v> for AtBindingPatternVisitor<'_, '_, '_> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -418,8 +418,8 @@ impl CheckAttrVisitor<'tcx> {
impl Visitor<'tcx> for CheckAttrVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx Item<'tcx>) {

View file

@ -8,7 +8,6 @@
//! through, but errors for structured control flow in a `const` should be emitted here.
use rustc::hir::map::Map;
use rustc::hir::Hir;
use rustc::session::config::nightly_options;
use rustc::session::parse::feature_err;
use rustc::ty::query::Providers;
@ -75,7 +74,7 @@ enum ConstKind {
}
impl ConstKind {
fn for_body(body: &hir::Body<'_>, hir_map: Hir<'_>) -> Option<Self> {
fn for_body(body: &hir::Body<'_>, hir_map: Map<'_>) -> Option<Self> {
let is_const_fn = |id| hir_map.fn_sig_by_hir_id(id).unwrap().header.is_const();
let owner = hir_map.body_owner(body.id());
@ -202,8 +201,8 @@ impl<'tcx> CheckConstVisitor<'tcx> {
impl<'tcx> Visitor<'tcx> for CheckConstVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_anon_const(&mut self, anon: &'tcx hir::AnonConst) {

View file

@ -212,7 +212,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -568,8 +568,8 @@ impl Visitor<'tcx> for DeadVisitor<'tcx> {
/// on inner functions when the outer function is already getting
/// an error. We could do this also by checking the parents, but
/// this is how the code is setup and it seems harmless enough.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {

View file

@ -1,4 +1,4 @@
use rustc::hir::Hir;
use rustc::hir::map::Map;
use rustc::session::config::EntryFnType;
use rustc::session::{config, Session};
use rustc::ty::query::Providers;
@ -15,7 +15,7 @@ use rustc_span::{Span, DUMMY_SP};
struct EntryContext<'a, 'tcx> {
session: &'a Session,
map: Hir<'tcx>,
map: Map<'tcx>,
/// The top-level function called `main`.
main_fn: Option<(HirId, Span)>,
@ -59,7 +59,7 @@ fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(DefId, EntryFnType)> {
}
// If the user wants no main function at all, then stop here.
if attr::contains_name(&tcx.hir().krate().attrs, sym::no_main) {
if attr::contains_name(&tcx.hir().krate().item.attrs, sym::no_main) {
return None;
}
@ -157,7 +157,7 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) -> Option<(De
}
fn no_main_err(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) {
let sp = tcx.hir().krate().span;
let sp = tcx.hir().krate().item.span;
if *tcx.sess.parse_sess.reached_eof.borrow() {
// There's an unclosed brace that made the parser reach `Eof`, we shouldn't complain about
// the missing `fn main()` then as it might have been hidden inside an unclosed block.

View file

@ -95,7 +95,7 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<Self::Map> {
panic!("visit_nested_xxx must be manually implemented in this visitor")
}

View file

@ -124,7 +124,7 @@ impl ExprVisitor<'tcx> {
impl Visitor<'tcx> for ItemVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -141,7 +141,7 @@ impl Visitor<'tcx> for ItemVisitor<'tcx> {
impl Visitor<'tcx> for ExprVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -114,8 +114,8 @@ impl LibFeatureCollector<'tcx> {
impl Visitor<'tcx> for LibFeatureCollector<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_attribute(&mut self, attr: &'tcx Attribute) {

View file

@ -156,8 +156,8 @@ fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_>) -> String {
impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_fn(
@ -1361,7 +1361,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for Liveness<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -24,15 +24,14 @@ enum Context {
#[derive(Copy, Clone)]
struct CheckLoopVisitor<'a, 'hir> {
sess: &'a Session,
hir_map: &'a Map<'hir>,
hir_map: Map<'hir>,
cx: Context,
}
fn check_mod_loops(tcx: TyCtxt<'_>, module_def_id: DefId) {
tcx.hir().visit_item_likes_in_module(
module_def_id,
&mut CheckLoopVisitor { sess: &tcx.sess, hir_map: &tcx.hir(), cx: Normal }
.as_deep_visitor(),
&mut CheckLoopVisitor { sess: &tcx.sess, hir_map: tcx.hir(), cx: Normal }.as_deep_visitor(),
);
}
@ -43,8 +42,8 @@ pub(crate) fn provide(providers: &mut Providers<'_>) {
impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
type Map = Map<'hir>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.hir_map)
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.hir_map)
}
fn visit_anon_const(&mut self, c: &'hir hir::AnonConst) {

View file

@ -85,7 +85,7 @@ struct ReachableContext<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for ReachableContext<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -698,7 +698,7 @@ impl<'tcx> RegionResolutionVisitor<'tcx> {
impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -259,8 +259,8 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
/// deep-walking.
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_item(&mut self, i: &'tcx Item<'tcx>) {
@ -350,8 +350,8 @@ impl<'a, 'tcx> MissingStabilityAnnotations<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, i: &'tcx Item<'tcx>) {
@ -459,8 +459,8 @@ fn new_index(tcx: TyCtxt<'tcx>) -> Index<'tcx> {
annotator.annotate(
hir::CRATE_HIR_ID,
&krate.attrs,
krate.span,
&krate.item.attrs,
krate.item.span,
AnnotationKind::Required,
|v| intravisit::walk_crate(v, krate),
);
@ -492,8 +492,8 @@ impl Visitor<'tcx> for Checker<'tcx> {
/// Because stability levels are scoped lexically, we want to walk
/// nested items in the context of the outer item, so enable
/// deep-walking.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
@ -585,7 +585,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
if tcx.stability().staged_api[&LOCAL_CRATE] {
let krate = tcx.hir().krate();
let mut missing = MissingStabilityAnnotations { tcx, access_levels };
missing.check_missing_stability(hir::CRATE_HIR_ID, krate.span, "crate");
missing.check_missing_stability(hir::CRATE_HIR_ID, krate.item.span, "crate");
intravisit::walk_crate(&mut missing, krate);
krate.visit_all_item_likes(&mut missing.as_deep_visitor());
}

View file

@ -46,7 +46,7 @@ struct LocalCollector {
impl Visitor<'tcx> for LocalCollector {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -75,7 +75,7 @@ impl CaptureCollector<'_, '_> {
impl Visitor<'tcx> for CaptureCollector<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -87,7 +87,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
type Map = Map<'v>;
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, Map<'v>> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Map<'v>> {
NestedVisitorMap::None
}

View file

@ -373,8 +373,8 @@ struct PubRestrictedVisitor<'tcx> {
impl Visitor<'tcx> for PubRestrictedVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_vis(&mut self, vis: &'tcx hir::Visibility<'tcx>) {
self.has_pub_restricted = self.has_pub_restricted || vis.node.is_pub_restricted();
@ -678,8 +678,8 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
/// We want to visit items in the context of their containing
/// module and so forth, so supply a crate for doing a deep walk.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
@ -1049,8 +1049,8 @@ impl<'a, 'tcx> Visitor<'tcx> for NamePrivacyVisitor<'a, 'tcx> {
/// We want to visit items in the context of their containing
/// module and so forth, so supply a crate for doing a deep walk.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_mod(&mut self, _m: &'tcx hir::Mod<'tcx>, _s: Span, _n: hir::HirId) {
@ -1191,8 +1191,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx> {
/// We want to visit items in the context of their containing
/// module and so forth, so supply a crate for doing a deep walk.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_mod(&mut self, _m: &'tcx hir::Mod<'tcx>, _s: Span, _n: hir::HirId) {
@ -1449,7 +1449,7 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
impl<'a, 'b, 'tcx, 'v> Visitor<'v> for ObsoleteCheckTypeForPrivatenessVisitor<'a, 'b, 'tcx> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -1479,8 +1479,8 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
/// We want to visit items in the context of their containing
/// module and so forth, so supply a crate for doing a deep walk.
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
@ -1925,8 +1925,8 @@ impl<'a, 'tcx> PrivateItemsInPublicInterfacesVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {

View file

@ -367,8 +367,8 @@ fn sub_items_have_self_param(node: &hir::ItemKind<'_>) -> bool {
impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::All(self.tcx.hir())
}
// We want to nest trait/impl items in their parent, but nothing else.
@ -1125,7 +1125,7 @@ fn extract_labels(ctxt: &mut LifetimeContext<'_, '_>, body: &hir::Body<'_>) {
impl<'v, 'a, 'tcx> Visitor<'v> for GatherLabels<'a, 'tcx> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -2174,7 +2174,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
impl<'a> Visitor<'a> for SelfVisitor<'a> {
type Map = Map<'a>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -2265,7 +2265,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
impl<'v, 'a> Visitor<'v> for GatherLifetimes<'a> {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -2854,7 +2854,7 @@ fn insert_late_bound_lifetimes(
impl<'v> Visitor<'v> for ConstrainedCollector {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
@ -2897,7 +2897,7 @@ fn insert_late_bound_lifetimes(
impl<'v> Visitor<'v> for AllCollector {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -1,8 +1,11 @@
use crate::HashStableContext;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::AtomicRef;
use rustc_index::vec::Idx;
use rustc_macros::HashStable_Generic;
use rustc_serialize::{Decoder, Encoder};
use std::borrow::Borrow;
use std::fmt;
use std::{u32, u64};
@ -102,6 +105,28 @@ impl ::std::fmt::Debug for CrateNum {
}
}
#[derive(
Copy,
Clone,
Hash,
PartialEq,
Eq,
PartialOrd,
Ord,
Debug,
RustcEncodable,
RustcDecodable,
HashStable_Generic
)]
pub struct DefPathHash(pub Fingerprint);
impl Borrow<Fingerprint> for DefPathHash {
#[inline]
fn borrow(&self) -> &Fingerprint {
&self.0
}
}
rustc_index::newtype_index! {
/// A DefIndex is an index into the hir-map for a crate, identifying a
/// particular definition. It should really be considered an interned

View file

@ -282,7 +282,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
}
}
hir::Node::Crate => return,
hir::Node::Crate(..) => return,
_ => {}
}
@ -1569,7 +1569,7 @@ struct ReturnsVisitor<'v> {
impl<'v> Visitor<'v> for ReturnsVisitor<'v> {
type Map = rustc::hir::map::Map<'v>;
fn nested_visit_map(&mut self) -> hir::intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> hir::intravisit::NestedVisitorMap<Self::Map> {
hir::intravisit::NestedVisitorMap::None
}

View file

@ -603,8 +603,8 @@ impl ClauseDumper<'tcx> {
impl Visitor<'tcx> for ClauseDumper<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {

View file

@ -273,8 +273,7 @@ fn original_crate_name(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Symbol {
}
fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh {
assert_eq!(crate_num, LOCAL_CRATE);
tcx.hir().crate_hash
tcx.index_hir(crate_num).crate_hash
}
fn instance_def_size_estimate<'tcx>(

View file

@ -893,7 +893,7 @@ fn compare_synthetic_generics<'tcx>(
type Map = Map<'v>;
fn nested_visit_map(
&mut self,
) -> intravisit::NestedVisitorMap<'_, Self::Map>
) -> intravisit::NestedVisitorMap<Self::Map>
{
intravisit::NestedVisitorMap::None
}

View file

@ -211,7 +211,7 @@ pub fn resolve_interior<'a, 'tcx>(
impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -1349,7 +1349,7 @@ impl intravisit::Visitor<'tcx> for UsePlacementFinder<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::None
}
}

View file

@ -1179,7 +1179,7 @@ impl<'a, 'tcx> GatherLocalsVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -419,7 +419,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionCtxt<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -62,7 +62,7 @@ struct InferBorrowKindVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for InferBorrowKindVisitor<'a, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -246,7 +246,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
impl<'cx, 'tcx> Visitor<'tcx> for WritebackCx<'cx, 'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -107,7 +107,7 @@ crate struct PlaceholderHirTyCollector(crate Vec<Span>);
impl<'v> Visitor<'v> for PlaceholderHirTyCollector {
type Map = Map<'v>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
fn visit_ty(&mut self, t: &'v hir::Ty<'v>) {
@ -201,8 +201,8 @@ fn reject_placeholder_type_signatures_in_item(tcx: TyCtxt<'tcx>, item: &'tcx hir
impl Visitor<'tcx> for CollectItemTypesVisitor<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::OnlyBodies(self.tcx.hir())
}
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
@ -1047,7 +1047,7 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
impl Visitor<'tcx> for LateBoundRegionsDetector<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}

View file

@ -529,8 +529,8 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
impl<'tcx> intravisit::Visitor<'tcx> for ConstraintLocator<'tcx> {
type Map = Map<'tcx>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
intravisit::NestedVisitorMap::All(&self.tcx.hir())
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::All(self.tcx.hir())
}
fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>) {
if let hir::ExprKind::Closure(..) = ex.kind {

View file

@ -141,6 +141,7 @@ impl Clean<ExternalCrate> for CrateNum {
cx.tcx
.hir()
.krate()
.item
.module
.item_ids
.iter()
@ -194,6 +195,7 @@ impl Clean<ExternalCrate> for CrateNum {
cx.tcx
.hir()
.krate()
.item
.module
.item_ids
.iter()

View file

@ -107,12 +107,12 @@ pub fn run(options: Options) -> i32 {
let mut hir_collector = HirCollector {
sess: compiler.session(),
collector: &mut collector,
map: *tcx.hir(),
map: tcx.hir(),
codes: ErrorCodes::from(
compiler.session().opts.unstable_features.is_nightly_build(),
),
};
hir_collector.visit_testable("".to_string(), &krate.attrs, |this| {
hir_collector.visit_testable("".to_string(), &krate.item.attrs, |this| {
intravisit::walk_crate(this, krate);
});
});
@ -146,6 +146,7 @@ fn scrape_test_config(krate: &::rustc_hir::Crate) -> TestOptions {
TestOptions { no_crate_inject: false, display_warnings: false, attrs: Vec::new() };
let test_attrs: Vec<_> = krate
.item
.attrs
.iter()
.filter(|a| a.check_name(sym::doc))
@ -855,7 +856,7 @@ impl Tester for Collector {
struct HirCollector<'a, 'hir> {
sess: &'a session::Session,
collector: &'a mut Collector,
map: &'a Map<'hir>,
map: Map<'hir>,
codes: ErrorCodes,
}
@ -903,8 +904,8 @@ impl<'a, 'hir> HirCollector<'a, 'hir> {
impl<'a, 'hir> intravisit::Visitor<'hir> for HirCollector<'a, 'hir> {
type Map = Map<'hir>;
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
intravisit::NestedVisitorMap::All(&self.map)
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
intravisit::NestedVisitorMap::All(self.map)
}
fn visit_item(&mut self, item: &'hir hir::Item) {

View file

@ -64,11 +64,11 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
pub fn visit(mut self, krate: &'tcx hir::Crate) -> Module<'tcx> {
let mut module = self.visit_mod_contents(
krate.span,
krate.attrs,
krate.item.span,
krate.item.attrs,
&Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Public },
hir::CRATE_HIR_ID,
&krate.module,
&krate.item.module,
None,
);
// Attach the crate's exported macros to the top-level module:

View file

@ -25,7 +25,7 @@ pub fn change_callee_function() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_callee_function() {
callee2(1, 2)
@ -40,7 +40,7 @@ pub fn change_argument_function() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_function() {
callee1(1, 3)
@ -55,10 +55,10 @@ mod change_callee_indirectly_function {
#[cfg(not(cfail1))]
use super::callee2 as callee;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
pub fn change_callee_indirectly_function() {
@ -81,7 +81,7 @@ pub fn change_callee_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_callee_method() {
let s = Struct;
@ -98,7 +98,7 @@ pub fn change_argument_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_method() {
let s = Struct;
@ -115,7 +115,7 @@ pub fn change_ufcs_callee_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_ufcs_callee_method() {
let s = Struct;
@ -132,7 +132,7 @@ pub fn change_argument_method_ufcs() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_method_ufcs() {
let s = Struct;
@ -149,10 +149,10 @@ pub fn change_to_ufcs() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
// One might think this would be expanded in the HirBody/Mir, but it actually
// results in slightly different Hir/Mir.
// One might think this would be expanded in the hir_owner_items/Mir, but it actually
// results in slightly different hir_owner/Mir.
pub fn change_to_ufcs() {
let s = Struct;
Struct::method1(&s, 'x', true);
@ -171,7 +171,7 @@ pub mod change_ufcs_callee_indirectly {
#[cfg(not(cfail1))]
use super::Struct2 as Struct;
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]

View file

@ -21,7 +21,7 @@ pub fn change_closure_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn change_closure_body() {
let _ = || 3u32;
@ -37,7 +37,7 @@ pub fn add_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_parameter() {
let x = 0u32;
@ -53,7 +53,7 @@ pub fn change_parameter_pattern() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_pattern() {
let _ = |(x,): (u32,)| x;
@ -68,7 +68,7 @@ pub fn add_move() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_move() {
let _ = move || 1;
@ -84,7 +84,7 @@ pub fn add_type_ascription_to_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_type_ascription_to_parameter() {
let closure = |x: u32| x + 1u32;
@ -101,7 +101,7 @@ pub fn change_parameter_type() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_type() {
let closure = |x: u16| (x as u64) + 1;

View file

@ -19,7 +19,7 @@
const CONST_VISIBILITY: u8 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub const CONST_VISIBILITY: u8 = 0;
@ -29,7 +29,7 @@ pub const CONST_VISIBILITY: u8 = 0;
const CONST_CHANGE_TYPE_1: i32 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_TYPE_1: u32 = 0;
@ -39,13 +39,13 @@ const CONST_CHANGE_TYPE_1: u32 = 0;
const CONST_CHANGE_TYPE_2: Option<u32> = None;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_TYPE_2: Option<u64> = None;
// Change value between simple literals
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_VALUE_1: i16 = {
#[cfg(cfail1)]
@ -57,7 +57,7 @@ const CONST_CHANGE_VALUE_1: i16 = {
// Change value between expressions
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_VALUE_2: i16 = {
#[cfg(cfail1)]
@ -67,7 +67,7 @@ const CONST_CHANGE_VALUE_2: i16 = {
{ 1 + 2 }
};
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_VALUE_3: i16 = {
#[cfg(cfail1)]
@ -77,7 +77,7 @@ const CONST_CHANGE_VALUE_3: i16 = {
{ 2 * 3 }
};
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_VALUE_4: i16 = {
#[cfg(cfail1)]
@ -99,11 +99,11 @@ mod const_change_type_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedType2 as Type;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_TYPE_INDIRECTLY_1: Type = Type;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
const CONST_CHANGE_TYPE_INDIRECTLY_2: Option<Type> = None;
}

View file

@ -34,7 +34,7 @@ pub fn change_field_value_struct_like() -> Enum {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_struct_like() -> Enum {
Enum::Struct {
@ -57,7 +57,7 @@ pub fn change_field_order_struct_like() -> Enum {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
// FIXME(michaelwoerister):Interesting. I would have thought that that changes the MIR. And it
// would if it were not all constants
@ -96,7 +96,7 @@ pub fn change_constructor_path_struct_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_struct_like() {
let _ = Enum2::Struct {
@ -119,7 +119,7 @@ pub fn change_constructor_variant_struct_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_struct_like() {
let _ = Enum2::Struct2 {
@ -139,7 +139,7 @@ pub mod change_constructor_path_indirectly_struct_like {
#[rustc_clean(
cfg="cfail2",
except="fn_sig,Hir,HirBody,optimized_mir,mir_built,\
except="fn_sig,hir_owner,hir_owner_items,optimized_mir,mir_built,\
typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
@ -161,7 +161,7 @@ pub mod change_constructor_variant_indirectly_struct_like {
#[cfg(not(cfail1))]
use super::Enum2::Struct2 as Variant;
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Enum2 {
Variant {
@ -180,7 +180,7 @@ pub fn change_field_value_tuple_like() -> Enum {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_tuple_like() -> Enum {
Enum::Tuple(0, 1, 3)
@ -197,7 +197,7 @@ pub fn change_constructor_path_tuple_like() {
#[cfg(not(cfail1))]
#[rustc_clean(
cfg="cfail2",
except="HirBody,optimized_mir,mir_built,typeck_tables_of"
except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_tuple_like() {
@ -215,7 +215,7 @@ pub fn change_constructor_variant_tuple_like() {
#[cfg(not(cfail1))]
#[rustc_clean(
cfg="cfail2",
except="HirBody,optimized_mir,mir_built,typeck_tables_of"
except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_tuple_like() {
@ -232,7 +232,7 @@ pub mod change_constructor_path_indirectly_tuple_like {
#[rustc_clean(
cfg="cfail2",
except="fn_sig,Hir,HirBody,optimized_mir,mir_built,\
except="fn_sig,hir_owner,hir_owner_items,optimized_mir,mir_built,\
typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
@ -251,7 +251,7 @@ pub mod change_constructor_variant_indirectly_tuple_like {
#[cfg(not(cfail1))]
use super::Enum2::Tuple2 as Variant;
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Enum2 {
Variant(0, 1, 2)
@ -278,7 +278,7 @@ pub fn change_constructor_path_c_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_c_like() {
let _ = Clike2::B;
@ -293,7 +293,7 @@ pub fn change_constructor_variant_c_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_c_like() {
let _ = Clike::C;
@ -309,7 +309,7 @@ pub mod change_constructor_path_indirectly_c_like {
#[rustc_clean(
cfg="cfail2",
except="fn_sig,Hir,HirBody,optimized_mir,mir_built,\
except="fn_sig,hir_owner,hir_owner_items,optimized_mir,mir_built,\
typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
@ -328,7 +328,7 @@ pub mod change_constructor_variant_indirectly_c_like {
#[cfg(not(cfail1))]
use super::Clike::B as Variant;
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Clike {
Variant

View file

@ -26,7 +26,7 @@
enum EnumVisibility { A }
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub enum EnumVisibility {
A
@ -42,7 +42,7 @@ enum EnumChangeNameCStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeNameCStyleVariant {
Variant1,
@ -59,7 +59,7 @@ enum EnumChangeNameTupleStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeNameTupleStyleVariant {
Variant1,
@ -76,7 +76,7 @@ enum EnumChangeNameStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeNameStructStyleVariant {
Variant1,
@ -93,7 +93,7 @@ enum EnumChangeValueCStyleVariant0 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeValueCStyleVariant0 {
Variant1,
@ -109,7 +109,7 @@ enum EnumChangeValueCStyleVariant1 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeValueCStyleVariant1 {
Variant1,
@ -125,7 +125,7 @@ enum EnumAddCStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddCStyleVariant {
Variant1,
@ -142,7 +142,7 @@ enum EnumRemoveCStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumRemoveCStyleVariant {
Variant1,
@ -157,7 +157,7 @@ enum EnumAddTupleStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddTupleStyleVariant {
Variant1,
@ -174,7 +174,7 @@ enum EnumRemoveTupleStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumRemoveTupleStyleVariant {
Variant1,
@ -189,7 +189,7 @@ enum EnumAddStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddStructStyleVariant {
Variant1,
@ -206,7 +206,7 @@ enum EnumRemoveStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumRemoveStructStyleVariant {
Variant1,
@ -221,7 +221,7 @@ enum EnumChangeFieldTypeTupleStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeFieldTypeTupleStyleVariant {
Variant1(u32,
@ -238,7 +238,7 @@ enum EnumChangeFieldTypeStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeFieldTypeStructStyleVariant {
Variant1,
@ -257,7 +257,7 @@ enum EnumChangeFieldNameStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeFieldNameStructStyleVariant {
Variant1 { a: u32, c: u32 },
@ -272,7 +272,7 @@ enum EnumChangeOrderTupleStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeOrderTupleStyleVariant {
Variant1(
@ -289,7 +289,7 @@ enum EnumChangeFieldOrderStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumChangeFieldOrderStructStyleVariant {
Variant1 { b: f32, a: u32 },
@ -304,7 +304,7 @@ enum EnumAddFieldTupleStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddFieldTupleStyleVariant {
Variant1(u32, u32, u32),
@ -319,7 +319,7 @@ enum EnumAddFieldStructStyleVariant {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
enum EnumAddFieldStructStyleVariant {
Variant1 { a: u32, b: u32, c: u32 },
@ -335,7 +335,7 @@ enum EnumAddMustUse {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
#[must_use]
enum EnumAddMustUse {
@ -353,7 +353,7 @@ enum EnumAddReprC {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
#[repr(C)]
enum EnumAddReprC {
@ -531,7 +531,7 @@ enum EnumSwapUsageTypeParameters<A, B> {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum EnumSwapUsageTypeParameters<A, B> {
Variant1 {
@ -552,7 +552,7 @@ enum EnumSwapUsageLifetimeParameters<'a, 'b> {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum EnumSwapUsageLifetimeParameters<'a, 'b> {
Variant1 {
@ -577,7 +577,7 @@ mod change_field_type_indirectly_tuple_style {
#[cfg(not(cfail1))]
use super::ReferencedType2 as FieldType;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum TupleStyle {
Variant1(
@ -595,7 +595,7 @@ mod change_field_type_indirectly_struct_style {
#[cfg(not(cfail1))]
use super::ReferencedType2 as FieldType;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
enum StructStyle {
Variant1 {
@ -618,7 +618,7 @@ mod change_trait_bound_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,predicates_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,predicates_of")]
#[rustc_clean(cfg="cfail3")]
enum Enum<T: Trait> {
Variant1(T)
@ -634,7 +634,7 @@ mod change_trait_bound_indirectly_where {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,predicates_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,predicates_of")]
#[rustc_clean(cfg="cfail3")]
enum Enum<T> where T: Trait {
Variant1(T)

View file

@ -7,8 +7,8 @@
#![crate_type="rlib"]
// Case 1: The function body is not exported to metadata. If the body changes,
// the hash of the HirBody node should change, but not the hash of
// either the Hir or the Metadata node.
// the hash of the hir_owner_items node should change, but not the hash of
// either the hir_owner or the Metadata node.
#[cfg(cfail1)]
pub fn body_not_exported_to_metadata() -> u32 {
@ -16,7 +16,7 @@ pub fn body_not_exported_to_metadata() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn body_not_exported_to_metadata() -> u32 {
2
@ -25,7 +25,7 @@ pub fn body_not_exported_to_metadata() -> u32 {
// Case 2: The function body *is* exported to metadata because the function is
// marked as #[inline]. Only the hash of the Hir depnode should be
// marked as #[inline]. Only the hash of the hir_owner depnode should be
// unaffected by a change to the body.
#[cfg(cfail1)]
@ -35,7 +35,7 @@ pub fn body_exported_to_metadata_because_of_inline() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_inline() -> u32 {
@ -45,7 +45,7 @@ pub fn body_exported_to_metadata_because_of_inline() -> u32 {
// Case 2: The function body *is* exported to metadata because the function is
// generic. Only the hash of the Hir depnode should be
// generic. Only the hash of the hir_owner depnode should be
// unaffected by a change to the body.
#[cfg(cfail1)]
@ -55,7 +55,7 @@ pub fn body_exported_to_metadata_because_of_generic() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_generic() -> u32 {

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -48,7 +48,7 @@ pub fn change_iteration_variable_name() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iteration_variable_name() {
let mut _x = 0;
@ -71,7 +71,7 @@ pub fn change_iteration_variable_pattern() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iteration_variable_pattern() {
let mut _x = 0;
@ -94,7 +94,7 @@ pub fn change_iterable() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, promoted_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, promoted_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iterable() {
let mut _x = 0;
@ -116,7 +116,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -139,7 +139,7 @@ pub fn add_loop_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label() {
let mut _x = 0;
@ -162,7 +162,7 @@ pub fn add_loop_label_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_break() {
let mut _x = 0;
@ -187,7 +187,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -212,7 +212,7 @@ pub fn add_loop_label_to_continue() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_continue() {
let mut _x = 0;
@ -237,7 +237,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -262,7 +262,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -9,198 +9,196 @@
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(linkage)]
#![feature(rustc_attrs)]
#![crate_type = "rlib"]
// Add Parameter ---------------------------------------------------------------
#[cfg(cfail1)]
pub fn add_parameter() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn add_parameter(p: i32) {}
// Add Return Type -------------------------------------------------------------
#[cfg(cfail1)]
pub fn add_return_type() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items")]
#[rustc_clean(cfg = "cfail3")]
pub fn add_return_type() -> () {}
// Change Parameter Type -------------------------------------------------------
#[cfg(cfail1)]
pub fn type_of_parameter(p: i32) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn type_of_parameter(p: i64) {}
// Change Parameter Type Reference ---------------------------------------------
#[cfg(cfail1)]
pub fn type_of_parameter_ref(p: &i32) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn type_of_parameter_ref(p: &mut i32) {}
// Change Parameter Order ------------------------------------------------------
#[cfg(cfail1)]
pub fn order_of_parameters(p1: i32, p2: i64) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn order_of_parameters(p2: i64, p1: i32) {}
// Unsafe ----------------------------------------------------------------------
#[cfg(cfail1)]
pub fn make_unsafe() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub unsafe fn make_unsafe() {}
// Extern ----------------------------------------------------------------------
#[cfg(cfail1)]
pub fn make_extern() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, typeck_tables_of, fn_sig")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, typeck_tables_of, fn_sig")]
#[rustc_clean(cfg = "cfail3")]
pub extern "C" fn make_extern() {}
// Type Parameter --------------------------------------------------------------
#[cfg(cfail1)]
pub fn type_parameter() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, generics_of, type_of, predicates_of")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn type_parameter<T>() {}
// Lifetime Parameter ----------------------------------------------------------
#[cfg(cfail1)]
pub fn lifetime_parameter() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, generics_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, generics_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn lifetime_parameter<'a>() {}
// Trait Bound -----------------------------------------------------------------
#[cfg(cfail1)]
pub fn trait_bound<T>() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, predicates_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, predicates_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn trait_bound<T: Eq>() {}
// Builtin Bound ---------------------------------------------------------------
#[cfg(cfail1)]
pub fn builtin_bound<T>() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, predicates_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, predicates_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn builtin_bound<T: Send>() {}
// Lifetime Bound --------------------------------------------------------------
#[cfg(cfail1)]
pub fn lifetime_bound<'a, T>() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, generics_of, type_of, predicates_of")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn lifetime_bound<'a, T: 'a>() {}
// Second Trait Bound ----------------------------------------------------------
#[cfg(cfail1)]
pub fn second_trait_bound<T: Eq>() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, predicates_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, predicates_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn second_trait_bound<T: Eq + Clone>() {}
// Second Builtin Bound --------------------------------------------------------
#[cfg(cfail1)]
pub fn second_builtin_bound<T: Send>() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, predicates_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, predicates_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn second_builtin_bound<T: Send + Sized>() {}
// Second Lifetime Bound -------------------------------------------------------
#[cfg(cfail1)]
pub fn second_lifetime_bound<'a, 'b, T: 'a>() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, generics_of, type_of, predicates_of")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn second_lifetime_bound<'a, 'b, T: 'a + 'b>() {}
// Inline ----------------------------------------------------------------------
#[cfg(cfail1)]
pub fn inline() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items")]
#[rustc_clean(cfg = "cfail3")]
#[inline]
pub fn inline() {}
// Inline Never ----------------------------------------------------------------
#[cfg(cfail1)]
@ -208,36 +206,33 @@ pub fn inline() {}
pub fn inline_never() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items")]
#[rustc_clean(cfg = "cfail3")]
#[inline(never)]
pub fn inline_never() {}
// No Mangle -------------------------------------------------------------------
#[cfg(cfail1)]
pub fn no_mangle() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items")]
#[rustc_clean(cfg = "cfail3")]
#[no_mangle]
pub fn no_mangle() {}
// Linkage ---------------------------------------------------------------------
#[cfg(cfail1)]
pub fn linkage() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items")]
#[rustc_clean(cfg = "cfail3")]
#[linkage = "weak_odr"]
pub fn linkage() {}
// Return Impl Trait -----------------------------------------------------------
#[cfg(cfail1)]
@ -246,13 +241,12 @@ pub fn return_impl_trait() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, typeck_tables_of, fn_sig")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, typeck_tables_of, fn_sig")]
#[rustc_clean(cfg = "cfail3")]
pub fn return_impl_trait() -> impl Clone {
0
}
// Change Return Impl Trait ----------------------------------------------------
#[cfg(cfail1)]
@ -267,7 +261,6 @@ pub fn change_return_impl_trait() -> impl Copy {
0u32
}
// Change Return Type Indirectly -----------------------------------------------
pub struct ReferencedType1;
@ -279,15 +272,16 @@ pub mod change_return_type_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedType2 as ReturnType;
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_return_type() -> ReturnType {
ReturnType {}
}
}
// Change Parameter Type Indirectly --------------------------------------------
pub mod change_parameter_type_indirectly {
@ -296,13 +290,14 @@ pub mod change_parameter_type_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedType2 as ParameterType;
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
#[rustc_clean(
cfg = "cfail2",
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
)]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_parameter_type(p: ParameterType) {}
}
// Change Trait Bound Indirectly -----------------------------------------------
pub trait ReferencedTrait1 {}
@ -314,12 +309,11 @@ pub mod change_trait_bound_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, predicates_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, predicates_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_trait_bound<T: Trait>(p: T) {}
}
// Change Trait Bound Indirectly In Where Clause -------------------------------
pub mod change_trait_bound_indirectly_in_where_clause {
@ -328,7 +322,7 @@ pub mod change_trait_bound_indirectly_in_where_clause {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, predicates_of")]
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_items, predicates_of")]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_trait_bound_where<T>(p: T)
where

View file

@ -25,7 +25,7 @@ pub fn change_condition(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_condition(x: bool) -> u32 {
if !x {
@ -46,7 +46,7 @@ pub fn change_then_branch(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_then_branch(x: bool) -> u32 {
if x {
@ -69,7 +69,7 @@ pub fn change_else_branch(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_else_branch(x: bool) -> u32 {
if x {
@ -94,7 +94,7 @@ pub fn add_else_branch(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_else_branch(x: bool) -> u32 {
let mut ret = 1;
@ -120,7 +120,7 @@ pub fn change_condition_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_condition_if_let(x: Option<u32>) -> u32 {
if let Some(_) = x {
@ -143,7 +143,7 @@ pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
if let Some(x) = x {
@ -166,7 +166,7 @@ pub fn change_else_branch_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_else_branch_if_let(x: Option<u32>) -> u32 {
if let Some(x) = x {
@ -191,7 +191,7 @@ pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
let mut ret = 1;

View file

@ -20,10 +20,10 @@ fn change_simple_index(slice: &[u32]) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn change_simple_index(slice: &[u32]) -> u32 {
slice[4]
}
@ -37,10 +37,10 @@ fn change_lower_bound(slice: &[u32]) -> &[u32] {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn change_lower_bound(slice: &[u32]) -> &[u32] {
&slice[2..5]
}
@ -54,10 +54,10 @@ fn change_upper_bound(slice: &[u32]) -> &[u32] {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn change_upper_bound(slice: &[u32]) -> &[u32] {
&slice[3..7]
}
@ -71,10 +71,10 @@ fn add_lower_bound(slice: &[u32]) -> &[u32] {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn add_lower_bound(slice: &[u32]) -> &[u32] {
&slice[3..4]
}
@ -88,10 +88,10 @@ fn add_upper_bound(slice: &[u32]) -> &[u32] {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn add_upper_bound(slice: &[u32]) -> &[u32] {
&slice[3..7]
}
@ -105,10 +105,10 @@ fn change_mutability(slice: &mut [u32]) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn change_mutability(slice: &mut [u32]) -> u32 {
(&slice[3..5])[0]
}
@ -122,10 +122,10 @@ fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
&slice[3..=7]
}

View file

@ -23,7 +23,7 @@ impl Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,associated_item_def_ids")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,associated_item_def_ids")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail3")]
@ -44,7 +44,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="HirBody,optimized_mir,promoted_mir,mir_built,typeck_tables_of"
except="hir_owner_items,optimized_mir,promoted_mir,mir_built,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
pub fn method_body() {
@ -68,7 +68,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="HirBody,optimized_mir,promoted_mir,mir_built,typeck_tables_of"
except="hir_owner_items,optimized_mir,promoted_mir,mir_built,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
#[inline]
@ -85,10 +85,10 @@ impl Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="associated_item,Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="associated_item,hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
fn method_privacy() { }
}
@ -100,7 +100,7 @@ impl Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_dirty(cfg="cfail2", except="type_of,predicates_of,promoted_mir")]
@ -120,7 +120,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,fn_sig,typeck_tables_of,optimized_mir,mir_built"
except="hir_owner,hir_owner_items,fn_sig,typeck_tables_of,optimized_mir,mir_built"
)]
#[rustc_clean(cfg="cfail3")]
pub fn method_selfmutness(&mut self) { }
@ -135,7 +135,7 @@ impl Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,associated_item_def_ids")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,associated_item_def_ids")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2")]
@ -160,7 +160,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,fn_sig,typeck_tables_of,optimized_mir,mir_built"
except="hir_owner,hir_owner_items,fn_sig,typeck_tables_of,optimized_mir,mir_built"
)]
#[rustc_clean(cfg="cfail3")]
pub fn add_method_parameter(&self, _: i32) { }
@ -178,7 +178,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_method_parameter_name(&self, b: i64) { }
}
@ -197,7 +197,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,fn_sig,optimized_mir,mir_built,typeck_tables_of")]
except="hir_owner,hir_owner_items,fn_sig,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_method_return_type(&self) -> u8 { 0 }
}
@ -214,7 +214,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn make_method_inline(&self) -> u8 { 0 }
@ -232,7 +232,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_method_parameter_order(&self, b: i64, a: i64) { }
}
@ -251,7 +251,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,fn_sig,typeck_tables_of,optimized_mir,mir_built"
except="hir_owner,hir_owner_items,fn_sig,typeck_tables_of,optimized_mir,mir_built"
)]
#[rustc_clean(cfg="cfail3")]
pub unsafe fn make_method_unsafe(&self) { }
@ -269,7 +269,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,fn_sig,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,fn_sig,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub extern fn make_method_extern(&self) { }
}
@ -286,7 +286,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,fn_sig,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,fn_sig,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub extern "system" fn change_method_calling_convention(&self) { }
}
@ -312,7 +312,7 @@ impl Foo {
// if we lower generics before the body, then the `HirId` for
// things in the body will be affected. So if you start to see
// `typeck_tables_of` appear dirty, that might be the cause. -nmatsakis
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_lifetime_parameter_to_method<'a>(&self) { }
}
@ -340,7 +340,7 @@ impl Foo {
// appear dirty, that might be the cause. -nmatsakis
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,generics_of,predicates_of,type_of",
except="hir_owner,hir_owner_items,generics_of,predicates_of,type_of",
)]
#[rustc_clean(cfg="cfail3")]
pub fn add_type_parameter_to_method<T>(&self) { }
@ -360,7 +360,7 @@ impl Foo {
impl Foo {
#[rustc_clean(
cfg="cfail2",
except="Hir,HirBody,generics_of,predicates_of,type_of,typeck_tables_of"
except="hir_owner,hir_owner_items,generics_of,predicates_of,type_of,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
pub fn add_lifetime_bound_to_lifetime_param_of_method<'a, 'b: 'a>(&self) { }
@ -387,7 +387,7 @@ impl Foo {
// generics before the body, then the `HirId` for things in the
// body will be affected. So if you start to see `typeck_tables_of`
// appear dirty, that might be the cause. -nmatsakis
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,generics_of,predicates_of,\
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,generics_of,predicates_of,\
type_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_lifetime_bound_to_type_param_of_method<'a, T: 'a>(&self) { }
@ -414,7 +414,7 @@ impl Foo {
// generics before the body, then the `HirId` for things in the
// body will be affected. So if you start to see `typeck_tables_of`
// appear dirty, that might be the cause. -nmatsakis
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,predicates_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,predicates_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_trait_bound_to_type_param_of_method<T: Clone>(&self) { }
}
@ -431,7 +431,7 @@ impl Foo {
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
impl Foo {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
#[no_mangle]
pub fn add_no_mangle_to_method(&self) { }
@ -448,7 +448,7 @@ impl Bar<u32> {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,generics_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,generics_of")]
#[rustc_clean(cfg="cfail3")]
impl<T> Bar<T> {
#[rustc_clean(
@ -468,7 +468,7 @@ impl Bar<u32> {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
impl Bar<u64> {
#[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,mir_built,typeck_tables_of")]
@ -485,7 +485,7 @@ impl<T> Bar<T> {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
impl<T: 'static> Bar<T> {
#[rustc_clean(cfg="cfail2")]
@ -502,7 +502,7 @@ impl<T> Bar<T> {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
impl<T: Clone> Bar<T> {
#[rustc_clean(cfg="cfail2")]

View file

@ -33,7 +33,7 @@ pub fn change_template(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_template(a: i32) -> i32 {
@ -69,7 +69,7 @@ pub fn change_output(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_output(a: i32) -> i32 {
@ -105,7 +105,7 @@ pub fn change_input(_a: i32, _b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_input(_a: i32, _b: i32) -> i32 {
@ -140,7 +140,7 @@ pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
@ -175,7 +175,7 @@ pub fn change_clobber(_a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_clobber(_a: i32) -> i32 {
@ -210,7 +210,7 @@ pub fn change_options(_a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn change_options(_a: i32) -> i32 {

View file

@ -22,7 +22,7 @@ pub fn change_name() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name() {
let _y = 2u64;
@ -38,7 +38,7 @@ pub fn add_type() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn add_type() {
let _x: u32 = 2u32;
@ -54,7 +54,7 @@ pub fn change_type() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_type() {
let _x: u8 = 2;
@ -70,7 +70,7 @@ pub fn change_mutability_of_reference_type() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_reference_type() {
let _x: &mut u64;
@ -86,7 +86,7 @@ pub fn change_mutability_of_slot() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_slot() {
let _x: u64 = 0;
@ -102,7 +102,7 @@ pub fn change_simple_binding_to_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_simple_binding_to_pattern() {
let (_a, _b) = (0u8, 'x');
@ -118,7 +118,7 @@ pub fn change_name_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name_in_pattern() {
let (_a, _c) = (1u8, 'y');
@ -134,7 +134,7 @@ pub fn add_ref_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn add_ref_in_pattern() {
let (ref _a, _b) = (1u8, 'y');
@ -150,7 +150,7 @@ pub fn add_amp_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn add_amp_in_pattern() {
let (&_a, _b) = (&1u8, 'y');
@ -166,7 +166,7 @@ pub fn change_mutability_of_binding_in_pattern() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_binding_in_pattern() {
let (mut _a, _b) = (99u8, 'q');
@ -182,7 +182,7 @@ pub fn add_initializer() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,typeck_tables_of,mir_built,optimized_mir")]
except="hir_owner_items,typeck_tables_of,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn add_initializer() {
let _x: i16 = 3i16;
@ -198,7 +198,7 @@ pub fn change_initializer() {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_initializer() {
let _x = 5u16;

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -47,7 +47,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -70,7 +70,7 @@ pub fn add_loop_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label() {
let mut _x = 0;
@ -93,7 +93,7 @@ pub fn add_loop_label_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_break() {
let mut _x = 0;
@ -118,7 +118,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -143,7 +143,7 @@ pub fn add_loop_label_to_continue() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_continue() {
let mut _x = 0;
@ -168,7 +168,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -193,7 +193,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -26,7 +26,7 @@ pub fn add_arm(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_arm(x: u32) -> u32 {
match x {
@ -51,7 +51,7 @@ pub fn change_order_of_arms(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_order_of_arms(x: u32) -> u32 {
match x {
@ -75,7 +75,7 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_guard_clause(x: u32, y: bool) -> u32 {
match x {
@ -99,7 +99,7 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_guard_clause(x: u32, y: bool) -> u32 {
match x {
@ -123,7 +123,7 @@ pub fn add_at_binding(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_at_binding(x: u32) -> u32 {
match x {
@ -147,7 +147,7 @@ pub fn change_name_of_at_binding(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name_of_at_binding(x: u32) -> u32 {
match x {
@ -170,7 +170,7 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_simple_name_to_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -193,7 +193,7 @@ pub fn change_name_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_name_in_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -216,7 +216,7 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -238,7 +238,7 @@ pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
match (x, x & 1) {
@ -260,7 +260,7 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
match (&x, x & 1) {
@ -283,7 +283,7 @@ pub fn change_rhs_of_arm(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir")]
except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_rhs_of_arm(x: u32) -> u32 {
match x {
@ -307,7 +307,7 @@ pub fn add_alternative_to_arm(x: u32) -> u32 {
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2",
except="HirBody,mir_built,optimized_mir,typeck_tables_of")]
except="hir_owner_items,mir_built,optimized_mir,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_alternative_to_arm(x: u32) -> u32 {
match x {

View file

@ -18,7 +18,7 @@
// Indexing expression
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn indexing(slice: &[u8]) -> u8 {
#[cfg(cfail1)]
@ -33,7 +33,7 @@ pub fn indexing(slice: &[u8]) -> u8 {
// Arithmetic overflow plus
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_plus(val: i32) -> i32 {
#[cfg(cfail1)]
@ -48,7 +48,7 @@ pub fn arithmetic_overflow_plus(val: i32) -> i32 {
// Arithmetic overflow minus
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_minus(val: i32) -> i32 {
#[cfg(cfail1)]
@ -63,7 +63,7 @@ pub fn arithmetic_overflow_minus(val: i32) -> i32 {
// Arithmetic overflow mult
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_mult(val: i32) -> i32 {
#[cfg(cfail1)]
@ -78,7 +78,7 @@ pub fn arithmetic_overflow_mult(val: i32) -> i32 {
// Arithmetic overflow negation
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_negation(val: i32) -> i32 {
#[cfg(cfail1)]
@ -93,7 +93,7 @@ pub fn arithmetic_overflow_negation(val: i32) -> i32 {
// Division by zero
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn division_by_zero(val: i32) -> i32 {
#[cfg(cfail1)]
@ -107,7 +107,7 @@ pub fn division_by_zero(val: i32) -> i32 {
}
// Division by zero
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn mod_by_zero(val: i32) -> i32 {
#[cfg(cfail1)]
@ -122,7 +122,7 @@ pub fn mod_by_zero(val: i32) -> i32 {
// shift left
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn shift_left(val: i32, shift: usize) -> i32 {
#[cfg(cfail1)]
@ -137,7 +137,7 @@ pub fn shift_left(val: i32, shift: usize) -> i32 {
// shift right
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn shift_right(val: i32, shift: usize) -> i32 {
#[cfg(cfail1)]

View file

@ -21,7 +21,7 @@
static STATIC_VISIBILITY: u8 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub static STATIC_VISIBILITY: u8 = 0;
@ -31,7 +31,7 @@ pub static STATIC_VISIBILITY: u8 = 0;
static STATIC_MUTABILITY: u8 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
static mut STATIC_MUTABILITY: u8 = 0;
@ -41,7 +41,7 @@ static mut STATIC_MUTABILITY: u8 = 0;
static STATIC_LINKAGE: u8 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
#[linkage="weak_odr"]
static STATIC_LINKAGE: u8 = 0;
@ -52,7 +52,7 @@ static STATIC_LINKAGE: u8 = 0;
static STATIC_NO_MANGLE: u8 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
#[no_mangle]
static STATIC_NO_MANGLE: u8 = 0;
@ -63,7 +63,7 @@ static STATIC_NO_MANGLE: u8 = 0;
static STATIC_THREAD_LOCAL: u8 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
#[thread_local]
static STATIC_THREAD_LOCAL: u8 = 0;
@ -74,7 +74,7 @@ static STATIC_THREAD_LOCAL: u8 = 0;
static STATIC_CHANGE_TYPE_1: i16 = 0;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_TYPE_1: u64 = 0;
@ -84,13 +84,13 @@ static STATIC_CHANGE_TYPE_1: u64 = 0;
static STATIC_CHANGE_TYPE_2: Option<i8> = None;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_TYPE_2: Option<u16> = None;
// Change value between simple literals
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_VALUE_1: i16 = {
#[cfg(cfail1)]
@ -102,7 +102,7 @@ static STATIC_CHANGE_VALUE_1: i16 = {
// Change value between expressions
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_VALUE_2: i16 = {
#[cfg(cfail1)]
@ -112,7 +112,7 @@ static STATIC_CHANGE_VALUE_2: i16 = {
{ 1 + 2 }
};
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_VALUE_3: i16 = {
#[cfg(cfail1)]
@ -122,7 +122,7 @@ static STATIC_CHANGE_VALUE_3: i16 = {
{ 2 * 3 }
};
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_VALUE_4: i16 = {
#[cfg(cfail1)]
@ -144,11 +144,11 @@ mod static_change_type_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedType2 as Type;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_TYPE_INDIRECTLY_1: Type = Type;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody,type_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items,type_of")]
#[rustc_clean(cfg="cfail3")]
static STATIC_CHANGE_TYPE_INDIRECTLY_2: Option<Type> = None;
}

View file

@ -31,7 +31,7 @@ pub fn change_field_value_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_regular_struct() -> RegularStruct {
RegularStruct {
@ -54,7 +54,7 @@ pub fn change_field_order_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_order_regular_struct() -> RegularStruct {
RegularStruct {
@ -82,7 +82,7 @@ pub fn add_field_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_field_regular_struct() -> RegularStruct {
let struct1 = RegularStruct {
@ -117,7 +117,7 @@ pub fn change_field_label_regular_struct() -> RegularStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_label_regular_struct() -> RegularStruct {
let struct1 = RegularStruct {
@ -152,7 +152,7 @@ pub fn change_constructor_path_regular_struct() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_regular_struct() {
let _ = RegularStruct2 {
@ -173,7 +173,7 @@ pub mod change_constructor_path_indirectly_regular_struct {
#[rustc_clean(
cfg="cfail2",
except="fn_sig,Hir,HirBody,optimized_mir,mir_built,typeck_tables_of"
except="fn_sig,hir_owner,hir_owner_items,optimized_mir,mir_built,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Struct {
@ -196,7 +196,7 @@ pub fn change_field_value_tuple_struct() -> TupleStruct {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_tuple_struct() -> TupleStruct {
TupleStruct(0, 1, 3)
@ -213,7 +213,7 @@ pub fn change_constructor_path_tuple_struct() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_tuple_struct() {
let _ = TupleStruct2(0, 1, 2);
@ -230,7 +230,7 @@ pub mod change_constructor_path_indirectly_tuple_struct {
#[rustc_clean(
cfg="cfail2",
except="fn_sig,Hir,HirBody,optimized_mir,mir_built,typeck_tables_of"
except="fn_sig,hir_owner,hir_owner_items,optimized_mir,mir_built,typeck_tables_of"
)]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Struct {

View file

@ -24,13 +24,13 @@
pub struct LayoutPacked;
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -41,13 +41,13 @@ pub struct LayoutPacked;
struct LayoutC;
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -61,13 +61,13 @@ struct LayoutC;
struct TupleStructFieldType(i32);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -84,13 +84,13 @@ struct TupleStructFieldType(
struct TupleStructAddField(i32);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -106,13 +106,13 @@ struct TupleStructAddField(
struct TupleStructFieldVisibility(char);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -125,13 +125,13 @@ struct TupleStructFieldVisibility(pub char);
struct RecordStructFieldType { x: f32 }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -148,13 +148,13 @@ struct RecordStructFieldType {
struct RecordStructFieldName { x: f32 }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -167,13 +167,13 @@ struct RecordStructFieldName { y: f32 }
struct RecordStructAddField { x: f32 }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -188,13 +188,13 @@ struct RecordStructAddField {
struct RecordStructFieldVisibility { x: f32 }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -209,13 +209,13 @@ struct RecordStructFieldVisibility {
struct AddLifetimeParameter<'a>(&'a f32, &'a f64);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_dirty(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -228,13 +228,13 @@ struct AddLifetimeParameter<'a, 'b>(&'a f32, &'b f64);
struct AddLifetimeParameterBound<'a, 'b>(&'a f32, &'b f64);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -247,13 +247,13 @@ struct AddLifetimeParameterBound<'a, 'b: 'a>(
struct AddLifetimeParameterBoundWhereClause<'a, 'b>(&'a f32, &'b f64);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -269,13 +269,13 @@ struct AddLifetimeParameterBoundWhereClause<'a, 'b>(
struct AddTypeParameter<T1>(T1, T1);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_dirty(label="type_of", cfg="cfail2")]
#[rustc_dirty(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -293,13 +293,13 @@ struct AddTypeParameter<T1, T2>(
struct AddTypeParameterBound<T>(T);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -312,13 +312,13 @@ struct AddTypeParameterBound<T: Send>(
struct AddTypeParameterBoundWhereClause<T>(T);
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -332,13 +332,13 @@ struct AddTypeParameterBoundWhereClause<T>(
// fingerprint is stable (i.e., that there are no random influences like memory
// addresses taken into account by the hashing algorithm).
// Note: there is no #[cfg(...)], so this is ALWAYS compiled
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -351,13 +351,13 @@ pub struct EmptyStruct;
struct Visibility;
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -373,13 +373,13 @@ mod tuple_struct_change_field_type_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedType2 as FieldType;
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -396,13 +396,13 @@ mod record_struct_change_field_type_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedType2 as FieldType;
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_clean(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -424,13 +424,13 @@ mod change_trait_bound_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]
@ -444,13 +444,13 @@ mod change_trait_bound_indirectly_in_where_clause {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="type_of", cfg="cfail2")]
#[rustc_clean(label="generics_of", cfg="cfail2")]
#[rustc_dirty(label="predicates_of", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[rustc_clean(label="type_of", cfg="cfail3")]
#[rustc_clean(label="generics_of", cfg="cfail3")]
#[rustc_clean(label="predicates_of", cfg="cfail3")]

View file

@ -25,8 +25,8 @@
trait TraitVisibility { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
pub trait TraitVisibility { }
@ -36,8 +36,8 @@ pub trait TraitVisibility { }
trait TraitUnsafety { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
unsafe trait TraitUnsafety { }
@ -48,8 +48,8 @@ trait TraitAddMethod {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
pub trait TraitAddMethod {
fn method();
}
@ -63,8 +63,8 @@ trait TraitChangeMethodName {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeMethodName {
fn methodChanged();
}
@ -78,11 +78,11 @@ trait TraitAddReturnType {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddReturnType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method() -> u32;
}
@ -95,11 +95,11 @@ trait TraitChangeReturnType {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeReturnType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method() -> u64;
}
@ -112,11 +112,11 @@ trait TraitAddParameterToMethod {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddParameterToMethod {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(a: u32);
}
@ -130,18 +130,18 @@ trait TraitChangeMethodParameterName {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeMethodParameterName {
// FIXME(#38501) This should preferably always be clean.
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(b: u32);
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn with_default(y: i32) {}
}
@ -154,11 +154,11 @@ trait TraitChangeMethodParameterType {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeMethodParameterType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(a: i64);
}
@ -171,11 +171,11 @@ trait TraitChangeMethodParameterTypeRef {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeMethodParameterTypeRef {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(a: &mut i32);
}
@ -188,11 +188,11 @@ trait TraitChangeMethodParametersOrder {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeMethodParametersOrder {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(b: i64, a: i32);
}
@ -205,11 +205,11 @@ trait TraitAddMethodAutoImplementation {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddMethodAutoImplementation {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method() { }
}
@ -223,8 +223,8 @@ trait TraitChangeOrderOfMethods {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeOrderOfMethods {
fn method1();
fn method0();
@ -239,11 +239,11 @@ trait TraitChangeModeSelfRefToMut {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeModeSelfRefToMut {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(&mut self);
}
@ -255,13 +255,13 @@ trait TraitChangeModeSelfOwnToMut: Sized {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeModeSelfOwnToMut: Sized {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn method(mut self) {}
}
@ -273,11 +273,11 @@ trait TraitChangeModeSelfOwnToRef {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeModeSelfOwnToRef {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(&self);
}
@ -290,11 +290,11 @@ trait TraitAddUnsafeModifier {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddUnsafeModifier {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
unsafe fn method();
}
@ -307,11 +307,11 @@ trait TraitAddExternModifier {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddExternModifier {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
extern fn method();
}
@ -324,11 +324,11 @@ trait TraitChangeExternCToRustIntrinsic {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeExternCToRustIntrinsic {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
extern "stdcall" fn method();
}
@ -341,11 +341,11 @@ trait TraitAddTypeParameterToMethod {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTypeParameterToMethod {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T>();
}
@ -358,11 +358,11 @@ trait TraitAddLifetimeParameterToMethod {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeParameterToMethod {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<'a>();
}
@ -379,11 +379,11 @@ trait TraitAddTraitBoundToMethodTypeParameter {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTraitBoundToMethodTypeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T: ReferencedTrait0>();
}
@ -396,11 +396,11 @@ trait TraitAddBuiltinBoundToMethodTypeParameter {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddBuiltinBoundToMethodTypeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T: Sized>();
}
@ -413,11 +413,11 @@ trait TraitAddLifetimeBoundToMethodLifetimeParameter {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeBoundToMethodLifetimeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32);
}
@ -430,11 +430,11 @@ trait TraitAddSecondTraitBoundToMethodTypeParameter {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondTraitBoundToMethodTypeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T: ReferencedTrait0 + ReferencedTrait1>();
}
@ -447,11 +447,11 @@ trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T: Sized + Sync>();
}
@ -464,11 +464,11 @@ trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32);
}
@ -478,14 +478,14 @@ trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
#[cfg(cfail1)]
trait TraitAddAssociatedType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method();
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddAssociatedType {
type Associated;
@ -506,11 +506,11 @@ trait TraitAddTraitBoundToAssociatedType {
// Apparently the type bound contributes to the predicates of the trait, but
// does not change the associated item itself.
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTraitBoundToAssociatedType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
type Associated: ReferencedTrait0;
fn method();
@ -527,11 +527,11 @@ trait TraitAddLifetimeBoundToAssociatedType<'a> {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeBoundToAssociatedType<'a> {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
type Associated: 'a;
fn method();
@ -548,11 +548,11 @@ trait TraitAddDefaultToAssociatedType {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddDefaultToAssociatedType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
type Associated = ReferenceType0;
fn method();
@ -567,8 +567,8 @@ trait TraitAddAssociatedConstant {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddAssociatedConstant {
const Value: u32;
@ -586,15 +586,15 @@ trait TraitAddInitializerToAssociatedConstant {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddInitializerToAssociatedConstant {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
const Value: u32 = 1;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method();
}
@ -609,15 +609,15 @@ trait TraitChangeTypeOfAssociatedConstant {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeTypeOfAssociatedConstant {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
const Value: f64;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method();
}
@ -628,8 +628,8 @@ trait TraitChangeTypeOfAssociatedConstant {
trait TraitAddSuperTrait { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSuperTrait : ReferencedTrait0 { }
@ -639,8 +639,8 @@ trait TraitAddSuperTrait : ReferencedTrait0 { }
trait TraitAddBuiltiBound { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddBuiltiBound : Send { }
@ -650,8 +650,8 @@ trait TraitAddBuiltiBound : Send { }
trait TraitAddStaticLifetimeBound { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddStaticLifetimeBound : 'static { }
@ -661,16 +661,16 @@ trait TraitAddStaticLifetimeBound : 'static { }
trait TraitAddTraitAsSecondBound : ReferencedTrait0 { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { }
#[cfg(cfail1)]
trait TraitAddTraitAsSecondBoundFromBuiltin : Send { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { }
@ -680,16 +680,16 @@ trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { }
trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { }
#[cfg(cfail1)]
trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { }
@ -699,16 +699,16 @@ trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { }
trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { }
#[cfg(cfail1)]
trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { }
@ -718,8 +718,8 @@ trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { }
trait TraitAddTypeParameterToTrait { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTypeParameterToTrait<T> { }
@ -729,8 +729,8 @@ trait TraitAddTypeParameterToTrait<T> { }
trait TraitAddLifetimeParameterToTrait { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeParameterToTrait<'a> { }
@ -740,8 +740,8 @@ trait TraitAddLifetimeParameterToTrait<'a> { }
trait TraitAddTraitBoundToTypeParameterOfTrait<T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
@ -751,8 +751,8 @@ trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
@ -762,8 +762,8 @@ trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { }
@ -773,8 +773,8 @@ trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { }
trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { }
@ -784,8 +784,8 @@ trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { }
trait TraitAddSecondTypeParameterToTrait<T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondTypeParameterToTrait<T, S> { }
@ -795,8 +795,8 @@ trait TraitAddSecondTypeParameterToTrait<T, S> { }
trait TraitAddSecondLifetimeParameterToTrait<'a> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { }
@ -806,8 +806,8 @@ trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { }
trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { }
@ -817,8 +817,8 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + Refer
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
@ -828,8 +828,8 @@ trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { }
@ -839,8 +839,8 @@ trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c>
trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { }
@ -855,8 +855,8 @@ struct ReferenceType1 {}
trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
@ -866,8 +866,8 @@ trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
@ -877,8 +877,8 @@ trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { }
@ -888,8 +888,8 @@ trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b
trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
@ -899,8 +899,8 @@ trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
where T: ReferencedTrait0 + ReferencedTrait1 { }
@ -911,8 +911,8 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
@ -922,8 +922,8 @@ trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T:
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { }
@ -933,8 +933,8 @@ trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> whe
trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
@ -945,11 +945,11 @@ mod change_return_type_of_method_indirectly_use {
#[cfg(not(cfail1))]
use super::ReferenceType1 as ReturnType;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeReturnType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method() -> ReturnType;
}
}
@ -963,11 +963,11 @@ mod change_method_parameter_type_indirectly_by_use {
#[cfg(not(cfail1))]
use super::ReferenceType1 as ArgType;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeArgType {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method(a: ArgType);
}
}
@ -981,11 +981,11 @@ mod change_method_parameter_type_bound_indirectly_by_use {
#[cfg(not(cfail1))]
use super::ReferencedTrait1 as Bound;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeBoundOfMethodTypeParameter {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T: Bound>(a: T);
}
}
@ -1000,11 +1000,11 @@ mod change_method_parameter_type_bound_indirectly_by_use_where {
#[cfg(not(cfail1))]
use super::ReferencedTrait1 as Bound;
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeBoundOfMethodTypeParameterWhere {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method<T>(a: T) where T: Bound;
}
}
@ -1018,8 +1018,8 @@ mod change_method_type_parameter_bound_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedTrait1 as Bound;
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeTraitBound<T: Bound> {
fn method(a: T);
}
@ -1035,8 +1035,8 @@ mod change_method_type_parameter_bound_indirectly_where {
#[cfg(not(cfail1))]
use super::ReferencedTrait1 as Bound;
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
trait TraitChangeTraitBoundWhere<T> where T: Bound {
fn method(a: T);
}

View file

@ -30,18 +30,18 @@ impl ChangeMethodNameTrait for Foo {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
pub trait ChangeMethodNameTrait {
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name2();
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeMethodNameTrait for Foo {
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name2() { }
}
@ -59,13 +59,13 @@ impl ChangeMethodBodyTrait for Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeMethodBodyTrait for Foo {
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
fn method_name() {
()
}
@ -86,13 +86,13 @@ impl ChangeMethodBodyTraitInlined for Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeMethodBodyTraitInlined for Foo {
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
#[inline]
fn method_name() {
panic!()
@ -117,11 +117,11 @@ pub trait ChangeMethodSelfnessTrait {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeMethodSelfnessTrait for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name(&self) {
()
}
@ -145,11 +145,11 @@ pub trait RemoveMethodSelfnessTrait {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl RemoveMethodSelfnessTrait for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name() {}
}
@ -171,11 +171,11 @@ pub trait ChangeMethodSelfmutnessTrait {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeMethodSelfmutnessTrait for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name(&mut self) {}
}
@ -197,8 +197,8 @@ pub trait ChangeItemKindTrait {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeItemKindTrait for Foo {
type name = ();
}
@ -223,8 +223,8 @@ pub trait RemoveItemTrait {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl RemoveItemTrait for Foo {
type TypeName = ();
}
@ -248,8 +248,8 @@ pub trait AddItemTrait {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl AddItemTrait for Foo {
type TypeName = ();
fn method_name() { }
@ -268,17 +268,17 @@ impl ChangeHasValueTrait for Foo {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
pub trait ChangeHasValueTrait {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name() { }
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeHasValueTrait for Foo {
fn method_name() { }
}
@ -295,11 +295,11 @@ impl AddDefaultTrait for Foo {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl AddDefaultTrait for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
default fn method_name() { }
}
@ -321,11 +321,11 @@ pub trait AddArgumentTrait {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl AddArgumentTrait for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name(&self, _x: u32) { }
}
@ -347,11 +347,11 @@ pub trait ChangeArgumentTypeTrait {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeArgumentTypeTrait for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn method_name(&self, _x: char) { }
}
@ -370,11 +370,11 @@ impl AddTypeParameterToImpl<u32> for Bar<u32> {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl<T> AddTypeParameterToImpl<T> for Bar<T> {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn id(t: T) -> T { t }
}
@ -391,11 +391,11 @@ impl ChangeSelfTypeOfImpl for u32 {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl ChangeSelfTypeOfImpl for u64 {
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn id(self) -> Self { self }
}
@ -412,11 +412,11 @@ impl<T> AddLifetimeBoundToImplParameter for T {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl<T: 'static> AddLifetimeBoundToImplParameter for T {
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn id(self) -> Self { self }
}
@ -433,11 +433,11 @@ impl<T> AddTraitBoundToImplParameter for T {
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl<T: Clone> AddTraitBoundToImplParameter for T {
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
fn id(self) -> Self { self }
}
@ -454,11 +454,11 @@ impl AddNoMangleToMethod for Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl AddNoMangleToMethod for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[no_mangle]
fn add_no_mangle_to_method(&self) { }
}
@ -475,11 +475,11 @@ impl MakeMethodInline for Foo {
}
#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_clean(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
impl MakeMethodInline for Foo {
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="hir_owner", cfg="cfail2")]
#[rustc_clean(label="hir_owner", cfg="cfail3")]
#[inline]
fn make_method_inline(&self) -> u8 { 0 }
}

View file

@ -24,7 +24,7 @@
type ChangePrimitiveType = i32;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangePrimitiveType = i64;
@ -35,7 +35,7 @@ type ChangePrimitiveType = i64;
type ChangeMutability = &'static i32;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeMutability = &'static mut i32;
@ -46,7 +46,7 @@ type ChangeMutability = &'static mut i32;
type ChangeLifetime<'a> = (&'static i32, &'a i32);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeLifetime<'a> = (&'a i32, &'a i32);
@ -60,7 +60,7 @@ struct Struct2;
type ChangeTypeStruct = Struct1;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeTypeStruct = Struct2;
@ -71,7 +71,7 @@ type ChangeTypeStruct = Struct2;
type ChangeTypeTuple = (u32, u64);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeTypeTuple = (u32, i64);
@ -91,7 +91,7 @@ enum Enum2 {
type ChangeTypeEnum = Enum1;
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeTypeEnum = Enum2;
@ -102,7 +102,7 @@ type ChangeTypeEnum = Enum2;
type AddTupleField = (i32, i64);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddTupleField = (i32, i64, i16);
@ -113,7 +113,7 @@ type AddTupleField = (i32, i64, i16);
type ChangeNestedTupleField = (i32, (i64, i16));
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeNestedTupleField = (i32, (i64, i8));
@ -124,7 +124,7 @@ type ChangeNestedTupleField = (i32, (i64, i8));
type AddTypeParam<T1> = (T1, T1);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddTypeParam<T1, T2> = (T1, T2);
@ -135,7 +135,7 @@ type AddTypeParam<T1, T2> = (T1, T2);
type AddTypeParamBound<T1> = (T1, u32);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddTypeParamBound<T1: Clone> = (T1, u32);
@ -146,7 +146,7 @@ type AddTypeParamBound<T1: Clone> = (T1, u32);
type AddTypeParamBoundWhereClause<T1> where T1: Clone = (T1, u32);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddTypeParamBoundWhereClause<T1> where T1: Clone+Copy = (T1, u32);
@ -157,7 +157,7 @@ type AddTypeParamBoundWhereClause<T1> where T1: Clone+Copy = (T1, u32);
type AddLifetimeParam<'a> = (&'a u32, &'a u32);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddLifetimeParam<'a, 'b> = (&'a u32, &'b u32);
@ -168,7 +168,7 @@ type AddLifetimeParam<'a, 'b> = (&'a u32, &'b u32);
type AddLifetimeParamBound<'a, 'b> = (&'a u32, &'b u32);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddLifetimeParamBound<'a, 'b: 'a> = (&'a u32, &'b u32);
@ -181,7 +181,7 @@ where 'b: 'a
= (&'a u32, &'b u32, &'c u32);
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type AddLifetimeParamBoundWhereClause<'a, 'b, 'c>
where 'b: 'a,
@ -200,7 +200,7 @@ mod change_trait_bound_indirectly {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeTraitBoundIndirectly<T: Trait> = (T, u32);
}
@ -214,7 +214,7 @@ mod change_trait_bound_indirectly_in_where_clause {
#[cfg(not(cfail1))]
use super::ReferencedTrait2 as Trait;
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
type ChangeTraitBoundIndirectly<T> where T : Trait = (T, u32);
}

View file

@ -21,7 +21,7 @@ pub fn const_negation() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn const_negation() -> i32 {
-1
@ -36,7 +36,7 @@ pub fn const_bitwise_not() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn const_bitwise_not() -> i32 {
!99
@ -51,7 +51,7 @@ pub fn var_negation(x: i32, y: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn var_negation(x: i32, y: i32) -> i32 {
-y
@ -66,7 +66,7 @@ pub fn var_bitwise_not(x: i32, y: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn var_bitwise_not(x: i32, y: i32) -> i32 {
!y
@ -81,7 +81,7 @@ pub fn var_deref(x: &i32, y: &i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn var_deref(x: &i32, y: &i32) -> i32 {
*y
@ -96,7 +96,7 @@ pub fn first_const_add() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn first_const_add() -> i32 {
2 + 3
@ -111,7 +111,7 @@ pub fn second_const_add() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn second_const_add() -> i32 {
1 + 3
@ -126,7 +126,7 @@ pub fn first_var_add(a: i32, b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn first_var_add(a: i32, b: i32) -> i32 {
b + 2
@ -141,7 +141,7 @@ pub fn second_var_add(a: i32, b: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn second_var_add(a: i32, b: i32) -> i32 {
1 + b
@ -156,7 +156,7 @@ pub fn plus_to_minus(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_minus(a: i32) -> i32 {
1 - a
@ -171,7 +171,7 @@ pub fn plus_to_mult(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_mult(a: i32) -> i32 {
1 * a
@ -186,7 +186,7 @@ pub fn plus_to_div(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_div(a: i32) -> i32 {
1 / a
@ -201,7 +201,7 @@ pub fn plus_to_mod(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn plus_to_mod(a: i32) -> i32 {
1 % a
@ -216,7 +216,7 @@ pub fn and_to_or(a: bool, b: bool) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn and_to_or(a: bool, b: bool) -> bool {
a || b
@ -231,7 +231,7 @@ pub fn bitwise_and_to_bitwise_or(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_bitwise_or(a: i32) -> i32 {
1 | a
@ -246,7 +246,7 @@ pub fn bitwise_and_to_bitwise_xor(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_bitwise_xor(a: i32) -> i32 {
1 ^ a
@ -261,7 +261,7 @@ pub fn bitwise_and_to_lshift(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_lshift(a: i32) -> i32 {
a << 1
@ -276,7 +276,7 @@ pub fn bitwise_and_to_rshift(a: i32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise_and_to_rshift(a: i32) -> i32 {
a >> 1
@ -291,7 +291,7 @@ pub fn eq_to_uneq(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_uneq(a: i32) -> bool {
a != 1
@ -306,7 +306,7 @@ pub fn eq_to_lt(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_lt(a: i32) -> bool {
a < 1
@ -321,7 +321,7 @@ pub fn eq_to_gt(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_gt(a: i32) -> bool {
a > 1
@ -336,7 +336,7 @@ pub fn eq_to_le(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_le(a: i32) -> bool {
a <= 1
@ -351,7 +351,7 @@ pub fn eq_to_ge(a: i32) -> bool {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn eq_to_ge(a: i32) -> bool {
a >= 1
@ -368,7 +368,7 @@ pub fn type_cast(a: u8) -> u64 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn type_cast(a: u8) -> u64 {
let b = a as u32;
@ -385,7 +385,7 @@ pub fn value_cast(a: u32) -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn value_cast(a: u32) -> i32 {
2 as i32
@ -403,7 +403,7 @@ pub fn place() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn place() -> i32 {
let mut x = 10;
@ -423,7 +423,7 @@ pub fn rvalue() -> i32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn rvalue() -> i32 {
let mut x = 10;
@ -440,7 +440,7 @@ pub fn index_to_slice(s: &[u8], i: usize, j: usize) -> u8 {
}
#[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(except="hir_owner_items,optimized_mir,mir_built", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn index_to_slice(s: &[u8], i: usize, j: usize) -> u8 {
s[j]

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -48,7 +48,7 @@ pub fn change_loop_condition() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_condition() {
let mut _x = 0;
@ -70,7 +70,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -93,7 +93,7 @@ pub fn add_loop_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label() {
let mut _x = 0;
@ -116,7 +116,7 @@ pub fn add_loop_label_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_break() {
let mut _x = 0;
@ -141,7 +141,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -166,7 +166,7 @@ pub fn add_loop_label_to_continue() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_continue() {
let mut _x = 0;
@ -191,7 +191,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -216,7 +216,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
@ -48,7 +48,7 @@ pub fn change_loop_condition() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_condition() {
let mut _x = 0;
@ -70,7 +70,7 @@ pub fn add_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir, typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
@ -93,7 +93,7 @@ pub fn add_loop_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label() {
let mut _x = 0;
@ -116,7 +116,7 @@ pub fn add_loop_label_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_break() {
let mut _x = 0;
@ -141,7 +141,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
@ -166,7 +166,7 @@ pub fn add_loop_label_to_continue() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_continue() {
let mut _x = 0;
@ -191,7 +191,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
@ -216,7 +216,7 @@ pub fn change_continue_to_break() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;

View file

@ -26,15 +26,15 @@ mod mod3 {
#[cfg(rpass2)]
use Trait2;
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
#[rustc_clean(label="hir_owner", cfg="rpass2")]
#[rustc_clean(label="hir_owner_items", cfg="rpass2")]
#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")]
fn bar() {
().method();
}
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
#[rustc_clean(label="hir_owner", cfg="rpass2")]
#[rustc_clean(label="hir_owner_items", cfg="rpass2")]
#[rustc_clean(label="typeck_tables_of", cfg="rpass2")]
fn baz() {
22; // no method call, traits in scope don't matter

View file

@ -7,18 +7,21 @@
#![crate_type = "rlib"]
#![feature(rustc_attrs)]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label = "hir_owner", cfg = "cfail2")]
#[rustc_dirty(label = "hir_owner_items", cfg = "cfail2")]
pub fn foo() {
#[cfg(cfail1)]
pub fn baz() { } // order is different...
pub fn baz() {} // order is different...
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail2")]
pub fn bar() { } // but that doesn't matter.
// FIXME: Make "hir_owner" use `rustc_clean` here. Currently "hir_owner" includes a reference to
// the parent node, which is the statement holding this item. Changing the position of
// `bar` in `foo` will update that reference and make `hir_owner(bar)` dirty.
#[rustc_dirty(label = "hir_owner", cfg = "cfail2")]
#[rustc_clean(label = "hir_owner_items", cfg = "cfail2")]
pub fn bar() {} // but that doesn't matter.
#[cfg(cfail2)]
pub fn baz() { } // order is different...
pub fn baz() {} // order is different...
pub fn bap() { } // neither does adding a new item
pub fn bap() {} // neither does adding a new item
}

View file

@ -28,18 +28,18 @@ mod mod3 {
#[cfg(rpass3)]
use mod2::Foo;
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
#[rustc_clean(label="Hir", cfg="rpass3")]
#[rustc_dirty(label="HirBody", cfg="rpass3")]
#[rustc_clean(label="hir_owner", cfg="rpass2")]
#[rustc_clean(label="hir_owner_items", cfg="rpass2")]
#[rustc_clean(label="hir_owner", cfg="rpass3")]
#[rustc_dirty(label="hir_owner_items", cfg="rpass3")]
fn in_expr() {
Foo(0);
}
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
#[rustc_clean(label="Hir", cfg="rpass3")]
#[rustc_dirty(label="HirBody", cfg="rpass3")]
#[rustc_clean(label="hir_owner", cfg="rpass2")]
#[rustc_clean(label="hir_owner_items", cfg="rpass2")]
#[rustc_clean(label="hir_owner", cfg="rpass3")]
#[rustc_dirty(label="hir_owner_items", cfg="rpass3")]
fn in_type() {
test::<Foo>();
}

View file

@ -1,6 +1,6 @@
// Regression test for #34991: an ICE occurred here because we inline
// some of the vector routines and give them a local def-id `X`. This
// got hashed after codegen (`Hir(X)`). When we load back up, we get an
// got hashed after codegen (`hir_owner(X)`). When we load back up, we get an
// error because the `X` is remapped to the original def-id (in
// libstd), and we can't hash a HIR node from std.

View file

@ -0,0 +1,21 @@
// revisions: rpass1 rpass2
#![allow(unused_imports)]
#[macro_export]
macro_rules! a_macro {
() => {};
}
#[cfg(rpass1)]
use a_macro as same_name;
mod same_name {}
mod needed_mod {
fn _crash() {
use super::same_name;
}
}
fn main() {}

Some files were not shown because too many files have changed in this diff Show more