Commit 72f8d4e2 authored by John Kåre Alsaker's avatar John Kåre Alsaker

Add no_hash to query macro and move some queries over

parent 0c8700b9
......@@ -2811,6 +2811,7 @@ dependencies = [
name = "rustc_macros"
version = "0.1.0"
dependencies = [
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
......
......@@ -461,11 +461,6 @@ rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
// Represents the MIR for a fn; also used as the task node for
// things read/modify that MIR.
[] MirConstQualif(DefId),
[] MirBuilt(DefId),
[] MirConst(DefId),
[] MirValidated(DefId),
[] MirOptimized(DefId),
[] MirShim { instance_def: InstanceDef<'tcx> },
[] BorrowCheckKrate,
......@@ -485,7 +480,6 @@ rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
[] CollectModItemTypes(DefId),
[] Reachability,
[] MirKeys,
[eval_always] CrateVariances,
// Nodes representing bits of computed IR in the tcx. Each shared
......
......@@ -63,4 +63,47 @@ rustc_queries! {
desc { "checking if the crate is_panic_runtime" }
}
}
Codegen {
/// Set of all the `DefId`s in this crate that have MIR associated with
/// them. This includes all the body owners, but also things like struct
/// constructors.
query mir_keys(_: CrateNum) -> Lrc<DefIdSet> {
desc { "getting a list of all mir_keys" }
}
/// Maps DefId's that have an associated Mir to the result
/// of the MIR qualify_consts pass. The actual meaning of
/// the value isn't known except to the pass itself.
query mir_const_qualif(key: DefId) -> (u8, Lrc<BitSet<mir::Local>>) {
cache { key.is_local() }
}
/// Fetch the MIR for a given `DefId` right after it's built - this includes
/// unreachable code.
query mir_built(_: DefId) -> &'tcx Steal<mir::Mir<'tcx>> {}
/// Fetch the MIR for a given `DefId` up till the point where it is
/// ready for const evaluation.
///
/// See the README for the `mir` module for details.
query mir_const(_: DefId) -> &'tcx Steal<mir::Mir<'tcx>> {
no_hash
}
query mir_validated(_: DefId) -> &'tcx Steal<mir::Mir<'tcx>> {
no_hash
}
/// MIR after our optimization passes have run. This is MIR that is ready
/// for codegen. This is also the only query that can fetch non-local MIR, at present.
query optimized_mir(key: DefId) -> &'tcx mir::Mir<'tcx> {
cache { key.is_local() }
load_cached(tcx, id) {
let mir: Option<crate::mir::Mir<'tcx>> = tcx.queries.on_disk_cache
.try_load_query_result(tcx, id);
mir.map(|x| tcx.alloc_mir(x))
}
}
}
}
......@@ -431,12 +431,6 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> {
}
}
impl<'tcx> QueryDescription<'tcx> for queries::mir_keys<'tcx> {
fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> {
"getting a list of all mir_keys".into()
}
}
impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
fn describe(_tcx: TyCtxt<'_, '_, '_>, instance: ty::Instance<'tcx>) -> Cow<'static, str> {
format!("computing the symbol for `{}`", instance).into()
......@@ -898,21 +892,6 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
}
}
impl<'tcx> QueryDescription<'tcx> for queries::optimized_mir<'tcx> {
#[inline]
fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, def_id: Self::Key) -> bool {
def_id.is_local()
}
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
id: SerializedDepNodeIndex)
-> Option<Self::Value> {
let mir: Option<crate::mir::Mir<'tcx>> = tcx.queries.on_disk_cache
.try_load_query_result(tcx, id);
mir.map(|x| tcx.alloc_mir(x))
}
}
impl<'tcx> QueryDescription<'tcx> for queries::substitute_normalize_and_test_predicates<'tcx> {
fn describe(tcx: TyCtxt<'_, '_, '_>, key: (DefId, SubstsRef<'tcx>)) -> Cow<'static, str> {
format!("testing substituted normalized predicates:`{}`", tcx.def_path_str(key.0)).into()
......@@ -997,7 +976,6 @@ impl_disk_cacheable_query!(mir_borrowck, |tcx, def_id| {
impl_disk_cacheable_query!(unsafety_check_result, |_, def_id| def_id.is_local());
impl_disk_cacheable_query!(borrowck, |_, def_id| def_id.is_local());
impl_disk_cacheable_query!(mir_const_qualif, |_, def_id| def_id.is_local());
impl_disk_cacheable_query!(check_match, |_, def_id| def_id.is_local());
impl_disk_cacheable_query!(def_symbol_name, |_, _| true);
impl_disk_cacheable_query!(predicates_of, |_, def_id| def_id.is_local());
......
......@@ -205,34 +205,6 @@ rustc_query_append! { [define_queries!][ <'tcx>
[] fn inherent_impls: InherentImpls(DefId) -> Lrc<Vec<DefId>>,
},
Codegen {
/// Set of all the `DefId`s in this crate that have MIR associated with
/// them. This includes all the body owners, but also things like struct
/// constructors.
[] fn mir_keys: mir_keys(CrateNum) -> Lrc<DefIdSet>,
/// Maps DefId's that have an associated Mir to the result
/// of the MIR qualify_consts pass. The actual meaning of
/// the value isn't known except to the pass itself.
[] fn mir_const_qualif: MirConstQualif(DefId) -> (u8, Lrc<BitSet<mir::Local>>),
/// Fetch the MIR for a given `DefId` right after it's built - this includes
/// unreachable code.
[] fn mir_built: MirBuilt(DefId) -> &'tcx Steal<mir::Mir<'tcx>>,
/// Fetch the MIR for a given `DefId` up till the point where it is
/// ready for const evaluation.
///
/// See the README for the `mir` module for details.
[no_hash] fn mir_const: MirConst(DefId) -> &'tcx Steal<mir::Mir<'tcx>>,
[no_hash] fn mir_validated: MirValidated(DefId) -> &'tcx Steal<mir::Mir<'tcx>>,
/// MIR after our optimization passes have run. This is MIR that is ready
/// for codegen. This is also the only query that can fetch non-local MIR, at present.
[] fn optimized_mir: MirOptimized(DefId) -> &'tcx mir::Mir<'tcx>,
},
TypeChecking {
/// The result of unsafety-checking this `DefId`.
[] fn unsafety_check_result: UnsafetyCheckResult(DefId) -> mir::UnsafetyCheckResult,
......@@ -796,10 +768,6 @@ fn const_eval_raw_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>
DepConstructor::ConstEvalRaw { param_env }
}
fn mir_keys<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
DepConstructor::MirKeys
}
fn crate_variances<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
DepConstructor::CrateVariances
}
......
......@@ -1262,11 +1262,6 @@ pub fn force_from_dep_node<'tcx>(
},
DepKind::PrivacyAccessLevels => { force!(privacy_access_levels, LOCAL_CRATE); }
DepKind::CheckPrivateInPublic => { force!(check_private_in_public, LOCAL_CRATE); }
DepKind::MirBuilt => { force!(mir_built, def_id!()); }
DepKind::MirConstQualif => { force!(mir_const_qualif, def_id!()); }
DepKind::MirConst => { force!(mir_const, def_id!()); }
DepKind::MirValidated => { force!(mir_validated, def_id!()); }
DepKind::MirOptimized => { force!(optimized_mir, def_id!()); }
DepKind::BorrowCheck => { force!(borrowck, def_id!()); }
DepKind::MirBorrowCheck => { force!(mir_borrowck, def_id!()); }
......@@ -1282,7 +1277,6 @@ pub fn force_from_dep_node<'tcx>(
DepKind::CheckModImplWf => { force!(check_mod_impl_wf, def_id!()); }
DepKind::CollectModItemTypes => { force!(collect_mod_item_types, def_id!()); }
DepKind::Reachability => { force!(reachable_set, LOCAL_CRATE); }
DepKind::MirKeys => { force!(mir_keys, LOCAL_CRATE); }
DepKind::CrateVariances => { force!(crate_variances, LOCAL_CRATE); }
DepKind::AssociatedItems => { force!(associated_item, def_id!()); }
DepKind::PredicatesDefinedOnItem => { force!(predicates_defined_on, def_id!()); }
......@@ -1491,11 +1485,11 @@ macro_rules! impl_load_from_cache {
impl_load_from_cache!(
TypeckTables => typeck_tables_of,
MirOptimized => optimized_mir,
optimized_mir => optimized_mir,
UnsafetyCheckResult => unsafety_check_result,
BorrowCheck => borrowck,
MirBorrowCheck => mir_borrowck,
MirConstQualif => mir_const_qualif,
mir_const_qualif => mir_const_qualif,
SymbolName => def_symbol_name,
ConstIsRvaluePromotableToStatic => const_is_rvalue_promotable_to_static,
CheckMatch => check_match,
......
......@@ -66,11 +66,11 @@ const BASE_IMPL: &[&str] = &[
label_strs::ImplTraitRef,
];
/// DepNodes for MirBuilt/Optimized, which is relevant in "executable"
/// DepNodes for mir_built/Optimized, which is relevant in "executable"
/// code, i.e., functions+methods
const BASE_MIR: &[&str] = &[
label_strs::MirOptimized,
label_strs::MirBuilt,
label_strs::optimized_mir,
label_strs::mir_built,
];
/// Struct, Enum and Union DepNodes
......
......@@ -12,3 +12,4 @@ synstructure = "0.10.1"
syn = { version = "0.15.22", features = ["full"] }
proc-macro2 = "0.4.24"
quote = "0.6.10"
itertools = "0.8"
......@@ -8,6 +8,7 @@ use syn::parse::{Result, Parse, ParseStream};
use syn::punctuated::Punctuated;
use syn;
use quote::quote;
use itertools::Itertools;
#[allow(non_camel_case_types)]
mod kw {
......@@ -41,6 +42,9 @@ enum QueryModifier {
/// A cycle error for this query aborting the compilation with a fatal error.
FatalCycle,
/// Don't hash the result, instead just mark a query red if it runs
NoHash,
}
impl Parse for QueryModifier {
......@@ -88,6 +92,8 @@ impl Parse for QueryModifier {
Ok(QueryModifier::LoadCached(tcx, id, block))
} else if modifier == "fatal_cycle" {
Ok(QueryModifier::FatalCycle)
} else if modifier == "no_hash" {
Ok(QueryModifier::NoHash)
} else {
Err(Error::new(modifier.span(), "unknown query modifier"))
}
......@@ -185,6 +191,9 @@ struct QueryModifiers {
/// A cycle error for this query aborting the compilation with a fatal error.
fatal_cycle: bool,
/// Don't hash the result, instead just mark a query red if it runs
no_hash: bool,
}
/// Process query modifiers into a struct, erroring on duplicates
......@@ -193,6 +202,7 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers {
let mut cache = None;
let mut desc = None;
let mut fatal_cycle = false;
let mut no_hash = false;
for modifier in query.modifiers.0.drain(..) {
match modifier {
QueryModifier::LoadCached(tcx, id, block) => {
......@@ -219,6 +229,12 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers {
}
fatal_cycle = true;
}
QueryModifier::NoHash => {
if no_hash {
panic!("duplicate modifier `no_hash` for query `{}`", query.name);
}
no_hash = true;
}
}
}
QueryModifiers {
......@@ -226,6 +242,7 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers {
cache,
desc,
fatal_cycle,
no_hash,
}
}
......@@ -325,16 +342,26 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
_ => quote! { #result_full },
};
let mut attributes = Vec::new();
// Pass on the fatal_cycle modifier
let fatal_cycle = if modifiers.fatal_cycle {
quote! { fatal_cycle }
} else {
quote! {}
if modifiers.fatal_cycle {
attributes.push(quote! { fatal_cycle });
};
// Pass on the no_hash modifier
if modifiers.no_hash {
attributes.push(quote! { no_hash });
};
let mut attribute_stream = quote! {};
for e in attributes.into_iter().intersperse(quote! {,}) {
attribute_stream.extend(e);
}
// Add the query to the group
group_stream.extend(quote! {
[#fatal_cycle] fn #name: #name(#arg) #result,
[#attribute_stream] fn #name: #name(#arg) #result,
});
add_query_description_impl(&query, modifiers, &mut query_description_stream);
......
......@@ -25,7 +25,7 @@ pub fn change_callee_function() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")]
#[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,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_function() {
callee1(1, 3)
......@@ -81,7 +81,7 @@ pub fn change_callee_method() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")]
#[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,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,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,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")]
#[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,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_argument_method_ufcs() {
let s = Struct;
......@@ -149,7 +149,7 @@ pub fn change_to_ufcs() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
// One might think this would be expanded in the HirBody/Mir, but it actually
// results in slightly different Hir/Mir.
......@@ -171,7 +171,7 @@ pub mod change_ufcs_callee_indirectly {
#[cfg(not(cfail1))]
use super::Struct2 as Struct;
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")]
#[rustc_clean(cfg="cfail3")]
......
......@@ -37,7 +37,7 @@ pub fn add_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")]
#[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, MirBuilt, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_pattern() {
let _ = |&x: &u32| x;
......@@ -84,7 +84,7 @@ pub fn add_type_ascription_to_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, TypeckTables")]
#[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, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_type() {
let closure = |x: u16| (x as u64) + 1;
......
......@@ -34,7 +34,7 @@ pub fn change_field_value_struct_like() -> Enum {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_field_value_struct_like() -> Enum {
Enum::Struct {
......@@ -96,7 +96,7 @@ pub fn change_constructor_path_struct_like() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")]
#[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,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail2", except="HirBody,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="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,\
except="FnSignature,Hir,HirBody,optimized_mir,mir_built,\
TypeckTables"
)]
#[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,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail2", except="HirBody,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,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail2", except="HirBody,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,MirOptimized,MirBuilt,TypeckTables"
except="HirBody,optimized_mir,mir_built,TypeckTables"
)]
#[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,MirOptimized,MirBuilt,TypeckTables"
except="HirBody,optimized_mir,mir_built,TypeckTables"
)]
#[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="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,\
except="FnSignature,Hir,HirBody,optimized_mir,mir_built,\
TypeckTables"
)]
#[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,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")]
#[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,MirOptimized,MirBuilt,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")]
#[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,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail2", except="HirBody,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="FnSignature,Hir,HirBody,MirOptimized,MirBuilt,\
except="FnSignature,Hir,HirBody,optimized_mir,mir_built,\
TypeckTables"
)]
#[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,MirOptimized,MirBuilt")]
#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn function() -> Clike {
Variant
......
......@@ -16,7 +16,7 @@ pub fn body_not_exported_to_metadata() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn body_not_exported_to_metadata() -> u32 {
2
......@@ -35,7 +35,7 @@ pub fn body_exported_to_metadata_because_of_inline() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_inline() -> u32 {
......@@ -55,7 +55,7 @@ pub fn body_exported_to_metadata_because_of_generic() -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir")]
#[rustc_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_generic() -> u32 {
......
......@@ -25,7 +25,7 @@ pub fn change_loop_body() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, 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, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, 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, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")]
#[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, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_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, MirBuilt, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
......@@ -187,7 +187,7 @@ pub fn change_break_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
......@@ -237,7 +237,7 @@ pub fn change_continue_label() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, 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, MirBuilt, MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;
......
......@@ -24,7 +24,7 @@ pub fn add_parameter() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn add_parameter(p: i32) {}
......@@ -47,7 +47,7 @@ pub fn type_of_parameter(p: i32) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn type_of_parameter(p: i64) {}
......@@ -59,7 +59,7 @@ pub fn type_of_parameter_ref(p: &i32) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn type_of_parameter_ref(p: &mut i32) {}
......@@ -71,7 +71,7 @@ pub fn order_of_parameters(p1: i32, p2: i64) {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn order_of_parameters(p2: i64, p1: i32) {}
......@@ -83,7 +83,7 @@ pub fn make_unsafe() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub unsafe fn make_unsafe() {}
......@@ -94,7 +94,7 @@ pub unsafe fn make_unsafe() {}
pub fn make_extern() {}
#[cfg(not(cfail1))]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, MirBuilt, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, mir_built, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub extern "C" fn make_extern() {}
......@@ -292,7 +292,7 @@ pub mod change_return_type_indirectly {
use super::ReferencedType2 as ReturnType;
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_return_type() -> ReturnType {
ReturnType {}
......@@ -309,7 +309,7 @@ pub mod change_parameter_type_indirectly {
use super::ReferencedType2 as ParameterType;
#[rustc_clean(cfg = "cfail2",
except = "Hir, HirBody, MirBuilt, MirOptimized, TypeckTables, FnSignature")]
except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")]
#[rustc_clean(cfg = "cfail3")]
pub fn indirect_parameter_type(p: ParameterType) {}
}
......
......@@ -25,7 +25,7 @@ pub fn change_condition(x: bool) -> u32 {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirBuilt,MirOptimized,TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")]
#[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,MirBuilt,MirOptimized")]
#[rustc_clean(cfg="cfail2", except="HirBody,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 {
}