2016-10-03 13:28:44 -05:00
|
|
|
// This test case tests the incremental compilation hash (ICH) implementation
|
|
|
|
// for function interfaces.
|
|
|
|
|
|
|
|
// The general pattern followed here is: Change one thing between rev1 and rev2
|
|
|
|
// and make sure that the hash has changed, then change nothing between rev2 and
|
|
|
|
// rev3 and make sure that the hash has not changed.
|
|
|
|
|
2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2021-04-22 14:33:16 -05:00
|
|
|
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
|
2022-05-27 20:17:39 -05:00
|
|
|
// compile-flags: -Z query-dep-graph -O
|
2021-04-22 14:33:16 -05:00
|
|
|
// [cfail1]compile-flags: -Zincremental-ignore-spans
|
|
|
|
// [cfail2]compile-flags: -Zincremental-ignore-spans
|
|
|
|
// [cfail3]compile-flags: -Zincremental-ignore-spans
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(linkage)]
|
|
|
|
#![feature(rustc_attrs)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#![crate_type = "rlib"]
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Add Parameter ---------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn add_parameter() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn add_parameter(p: i32) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Add Return Type -------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn add_return_type() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, optimized_mir")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn add_return_type() -> () {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Change Parameter Type -------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn type_of_parameter(p: i32) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn type_of_parameter(p: i64) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Change Parameter Type Reference ---------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn type_of_parameter_ref(p: &i32) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn type_of_parameter_ref(p: &mut i32) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Change Parameter Order ------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn order_of_parameters(p1: i32, p2: i64) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn order_of_parameters(p2: i64, p1: i32) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Unsafe ----------------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn make_unsafe() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub unsafe fn make_unsafe() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Extern ----------------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn make_extern() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-07-17 03:47:04 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, typeck, fn_sig")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, typeck, fn_sig")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 17:27:14 -06:00
|
|
|
pub extern "C" fn make_extern() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Type Parameter --------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn type_parameter () {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-03-17 20:48:17 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn type_parameter<T>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Lifetime Parameter ----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn lifetime_parameter () {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-10-26 13:18:31 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, generics_of,fn_sig")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, generics_of,fn_sig")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn lifetime_parameter<'a>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Trait Bound -----------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn trait_bound<T >() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn trait_bound<T: Eq>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Builtin Bound ---------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn builtin_bound<T >() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn builtin_bound<T: Send>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Lifetime Bound --------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn lifetime_bound<'a, T>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-10-26 13:18:31 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig,optimized_mir"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn lifetime_bound<'a, T: 'a>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Second Trait Bound ----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn second_trait_bound<T: Eq >() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn second_trait_bound<T: Eq + Clone>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Second Builtin Bound --------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn second_builtin_bound<T: Send >() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn second_builtin_bound<T: Send + Sized>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Second Lifetime Bound -------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn second_lifetime_bound<'a, 'b, T: 'a >() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-10-26 13:18:31 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn second_lifetime_bound<'a, 'b, T: 'a + 'b>() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Inline ----------------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn inline() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-11-28 13:56:52 -06:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2016-10-03 13:28:44 -05:00
|
|
|
#[inline]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn inline() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Inline Never ----------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-10-05 16:17:58 -05:00
|
|
|
#[inline(always)]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn inline_never() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-11-28 13:56:52 -06:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2016-10-03 13:28:44 -05:00
|
|
|
#[inline(never)]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn inline_never() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// No Mangle -------------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn no_mangle() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-11-28 13:56:52 -06:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2016-10-03 13:28:44 -05:00
|
|
|
#[no_mangle]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn no_mangle() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Linkage ---------------------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn linkage() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2020-11-28 13:56:52 -06:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[linkage = "weak_odr"]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn linkage() {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
|
|
|
// Return Impl Trait -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
|
|
|
pub fn return_impl_trait() -> i32 {
|
2016-10-03 13:28:44 -05:00
|
|
|
0
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2022-02-14 10:10:22 -06:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, typeck, fn_sig, optimized_mir")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, typeck, fn_sig, optimized_mir")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn return_impl_trait() -> impl Clone {
|
2016-10-03 13:28:44 -05:00
|
|
|
0
|
|
|
|
}
|
|
|
|
|
2016-10-05 16:17:58 -05:00
|
|
|
// Change Return Impl Trait ----------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn change_return_impl_trait() -> impl Clone {
|
2017-04-05 16:39:02 -05:00
|
|
|
0u32
|
2016-10-05 16:17:58 -05:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2018-05-22 07:31:56 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2022-10-05 05:46:59 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "typeck")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
|
|
|
pub fn change_return_impl_trait() -> impl Copy {
|
2017-04-05 16:39:02 -05:00
|
|
|
0u32
|
2016-10-05 16:17:58 -05:00
|
|
|
}
|
|
|
|
|
2016-10-03 13:28:44 -05:00
|
|
|
// Change Return Type Indirectly -----------------------------------------------
|
|
|
|
|
2017-12-05 16:40:13 -06:00
|
|
|
pub struct ReferencedType1;
|
|
|
|
pub struct ReferencedType2;
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2017-12-05 16:40:13 -06:00
|
|
|
pub mod change_return_type_indirectly {
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedType1 as ReturnType;
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedType2 as ReturnType;
|
|
|
|
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn indirect_return_type() -> ReturnType {
|
2016-10-03 13:28:44 -05:00
|
|
|
ReturnType {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change Parameter Type Indirectly --------------------------------------------
|
|
|
|
|
2017-12-05 16:40:13 -06:00
|
|
|
pub mod change_parameter_type_indirectly {
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedType1 as ParameterType;
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedType2 as ParameterType;
|
|
|
|
|
2020-02-12 09:01:24 -06:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail2",
|
2020-07-17 03:47:04 -05:00
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
2020-02-12 09:01:24 -06:00
|
|
|
)]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
|
|
|
cfg = "cfail5",
|
|
|
|
except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn indirect_parameter_type(p: ParameterType) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Change Trait Bound Indirectly -----------------------------------------------
|
|
|
|
|
2017-12-05 16:40:13 -06:00
|
|
|
pub trait ReferencedTrait1 {}
|
|
|
|
pub trait ReferencedTrait2 {}
|
2016-10-03 13:28:44 -05:00
|
|
|
|
2017-12-05 16:40:13 -06:00
|
|
|
pub mod change_trait_bound_indirectly {
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedTrait1 as Trait;
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedTrait2 as Trait;
|
|
|
|
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 16:40:13 -06:00
|
|
|
pub fn indirect_trait_bound<T: Trait>(p: T) {}
|
2016-10-03 13:28:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Change Trait Bound Indirectly In Where Clause -------------------------------
|
|
|
|
|
2017-12-05 16:40:13 -06:00
|
|
|
pub mod change_trait_bound_indirectly_in_where_clause {
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedTrait1 as Trait;
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-10-03 13:28:44 -05:00
|
|
|
use super::ReferencedTrait2 as Trait;
|
|
|
|
|
2020-03-17 20:48:17 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
2017-12-05 17:27:14 -06:00
|
|
|
#[rustc_clean(cfg = "cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")]
|
|
|
|
#[rustc_clean(cfg = "cfail6")]
|
2017-12-05 17:27:14 -06:00
|
|
|
pub fn indirect_trait_bound_where<T>(p: T)
|
|
|
|
where
|
|
|
|
T: Trait,
|
|
|
|
{
|
|
|
|
}
|
2016-10-03 13:28:44 -05:00
|
|
|
}
|