diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-04-22 21:33:16 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-09-10 20:19:38 +0200 |
| commit | 11a999e63493c179bbefb3ce8dde4c698a4b690c (patch) | |
| tree | d0511ef69b00756670f8766b1a3aae064ecd6c80 /src/test/incremental/hashes/function_interfaces.rs | |
| parent | 2e37ed87fc5ec827b2acebfe8b8e9c7b0dda9f30 (diff) | |
| download | rust-11a999e63493c179bbefb3ce8dde4c698a4b690c.tar.gz rust-11a999e63493c179bbefb3ce8dde4c698a4b690c.zip | |
Duplicate tests for incremental spans mode.
Diffstat (limited to 'src/test/incremental/hashes/function_interfaces.rs')
| -rw-r--r-- | src/test/incremental/hashes/function_interfaces.rs | 208 |
1 files changed, 145 insertions, 63 deletions
diff --git a/src/test/incremental/hashes/function_interfaces.rs b/src/test/incremental/hashes/function_interfaces.rs index c8530c70f78..4124eada188 100644 --- a/src/test/incremental/hashes/function_interfaces.rs +++ b/src/test/incremental/hashes/function_interfaces.rs @@ -6,8 +6,14 @@ // rev3 and make sure that the hash has not changed. // build-pass (FIXME(62277): could be check-pass?) -// revisions: cfail1 cfail2 cfail3 -// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans +// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6 +// compile-flags: -Z query-dep-graph +// [cfail1]compile-flags: -Zincremental-ignore-spans +// [cfail2]compile-flags: -Zincremental-ignore-spans +// [cfail3]compile-flags: -Zincremental-ignore-spans +// [cfail4]compile-flags: -Zincremental-relative-spans +// [cfail5]compile-flags: -Zincremental-relative-spans +// [cfail6]compile-flags: -Zincremental-relative-spans #![allow(warnings)] #![feature(linkage)] @@ -16,248 +22,310 @@ // Add Parameter --------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn add_parameter() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" +)] +#[rustc_clean(cfg = "cfail6")] pub fn add_parameter(p: i32) {} // Add Return Type ------------------------------------------------------------- -#[cfg(cfail1)] -pub fn add_return_type() {} +#[cfg(any(cfail1,cfail4))] +pub fn add_return_type() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, optimized_mir")] +#[rustc_clean(cfg = "cfail6")] pub fn add_return_type() -> () {} // Change Parameter Type ------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn type_of_parameter(p: i32) {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" +)] +#[rustc_clean(cfg = "cfail6")] pub fn type_of_parameter(p: i64) {} // Change Parameter Type Reference --------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn type_of_parameter_ref(p: &i32) {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" +)] +#[rustc_clean(cfg = "cfail6")] pub fn type_of_parameter_ref(p: &mut i32) {} // Change Parameter Order ------------------------------------------------------ -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn order_of_parameters(p1: i32, p2: i64) {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" +)] +#[rustc_clean(cfg = "cfail6")] pub fn order_of_parameters(p2: i64, p1: i32) {} // Unsafe ---------------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn make_unsafe() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" +)] +#[rustc_clean(cfg = "cfail6")] pub unsafe fn make_unsafe() {} // Extern ---------------------------------------------------------------------- -#[cfg(cfail1)] -pub fn make_extern() {} +#[cfg(any(cfail1,cfail4))] +pub fn make_extern() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, typeck, fn_sig")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, typeck, fn_sig")] +#[rustc_clean(cfg = "cfail6")] pub extern "C" fn make_extern() {} // Type Parameter -------------------------------------------------------------- -#[cfg(cfail1)] -pub fn type_parameter() {} +#[cfg(any(cfail1,cfail4))] +pub fn type_parameter () {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of" +)] +#[rustc_clean(cfg = "cfail6")] pub fn type_parameter<T>() {} // Lifetime Parameter ---------------------------------------------------------- -#[cfg(cfail1)] -pub fn lifetime_parameter() {} +#[cfg(any(cfail1,cfail4))] +pub fn lifetime_parameter () {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, generics_of,fn_sig")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, generics_of,fn_sig")] +#[rustc_clean(cfg = "cfail6")] pub fn lifetime_parameter<'a>() {} // Trait Bound ----------------------------------------------------------------- -#[cfg(cfail1)] -pub fn trait_bound<T>() {} +#[cfg(any(cfail1,cfail4))] +pub fn trait_bound<T >() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")] #[rustc_clean(cfg = "cfail3")] pub fn trait_bound<T: Eq>() {} // Builtin Bound --------------------------------------------------------------- -#[cfg(cfail1)] -pub fn builtin_bound<T>() {} +#[cfg(any(cfail1,cfail4))] +pub fn builtin_bound<T >() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")] +#[rustc_clean(cfg = "cfail6")] pub fn builtin_bound<T: Send>() {} // Lifetime Bound -------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn lifetime_bound<'a, T>() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig,optimized_mir" +)] +#[rustc_clean(cfg = "cfail6")] pub fn lifetime_bound<'a, T: 'a>() {} // Second Trait Bound ---------------------------------------------------------- -#[cfg(cfail1)] -pub fn second_trait_bound<T: Eq>() {} +#[cfg(any(cfail1,cfail4))] +pub fn second_trait_bound<T: Eq >() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, 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(any(cfail1,cfail4))] +pub fn second_builtin_bound<T: Send >() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")] +#[rustc_clean(cfg = "cfail6")] pub fn second_builtin_bound<T: Send + Sized>() {} // Second Lifetime Bound ------------------------------------------------------- -#[cfg(cfail1)] -pub fn second_lifetime_bound<'a, 'b, T: 'a>() {} +#[cfg(any(cfail1,cfail4))] +pub fn second_lifetime_bound<'a, 'b, T: 'a >() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig" )] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig" +)] +#[rustc_clean(cfg = "cfail6")] pub fn second_lifetime_bound<'a, 'b, T: 'a + 'b>() {} // Inline ---------------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn inline() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5")] +#[rustc_clean(cfg = "cfail6")] #[inline] pub fn inline() {} // Inline Never ---------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] #[inline(always)] pub fn inline_never() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5")] +#[rustc_clean(cfg = "cfail6")] #[inline(never)] pub fn inline_never() {} // No Mangle ------------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn no_mangle() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5")] +#[rustc_clean(cfg = "cfail6")] #[no_mangle] pub fn no_mangle() {} // Linkage --------------------------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn linkage() {} -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5")] +#[rustc_clean(cfg = "cfail6")] #[linkage = "weak_odr"] pub fn linkage() {} // Return Impl Trait ----------------------------------------------------------- -#[cfg(cfail1)] -pub fn return_impl_trait() -> i32 { +#[cfg(any(cfail1,cfail4))] +pub fn return_impl_trait() -> i32 { 0 } -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, typeck, fn_sig")] #[rustc_clean(cfg = "cfail3")] +#[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, typeck, fn_sig, optimized_mir")] +#[rustc_clean(cfg = "cfail6")] pub fn return_impl_trait() -> impl Clone { 0 } // Change Return Impl Trait ---------------------------------------------------- -#[cfg(cfail1)] +#[cfg(any(cfail1,cfail4))] pub fn change_return_impl_trait() -> impl Clone { 0u32 } -#[cfg(not(cfail1))] +#[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2")] #[rustc_clean(cfg = "cfail3")] -pub fn change_return_impl_trait() -> impl Copy { +#[rustc_clean(cfg = "cfail5")] +#[rustc_clean(cfg = "cfail6")] +pub fn change_return_impl_trait() -> impl Copy { 0u32 } @@ -267,9 +335,9 @@ pub struct ReferencedType1; pub struct ReferencedType2; pub mod change_return_type_indirectly { - #[cfg(cfail1)] + #[cfg(any(cfail1,cfail4))] use super::ReferencedType1 as ReturnType; - #[cfg(not(cfail1))] + #[cfg(not(any(cfail1,cfail4)))] use super::ReferencedType2 as ReturnType; #[rustc_clean( @@ -277,6 +345,11 @@ pub mod change_return_type_indirectly { except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] + #[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" + )] + #[rustc_clean(cfg = "cfail6")] pub fn indirect_return_type() -> ReturnType { ReturnType {} } @@ -285,9 +358,9 @@ pub mod change_return_type_indirectly { // Change Parameter Type Indirectly -------------------------------------------- pub mod change_parameter_type_indirectly { - #[cfg(cfail1)] + #[cfg(any(cfail1,cfail4))] use super::ReferencedType1 as ParameterType; - #[cfg(not(cfail1))] + #[cfg(not(any(cfail1,cfail4)))] use super::ReferencedType2 as ParameterType; #[rustc_clean( @@ -295,6 +368,11 @@ pub mod change_parameter_type_indirectly { except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" )] #[rustc_clean(cfg = "cfail3")] + #[rustc_clean( + cfg = "cfail5", + except = "hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig" + )] + #[rustc_clean(cfg = "cfail6")] pub fn indirect_parameter_type(p: ParameterType) {} } @@ -304,26 +382,30 @@ pub trait ReferencedTrait1 {} pub trait ReferencedTrait2 {} pub mod change_trait_bound_indirectly { - #[cfg(cfail1)] + #[cfg(any(cfail1,cfail4))] use super::ReferencedTrait1 as Trait; - #[cfg(not(cfail1))] + #[cfg(not(any(cfail1,cfail4)))] use super::ReferencedTrait2 as Trait; #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")] #[rustc_clean(cfg = "cfail3")] + #[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")] + #[rustc_clean(cfg = "cfail6")] 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 { - #[cfg(cfail1)] + #[cfg(any(cfail1,cfail4))] use super::ReferencedTrait1 as Trait; - #[cfg(not(cfail1))] + #[cfg(not(any(cfail1,cfail4)))] use super::ReferencedTrait2 as Trait; #[rustc_clean(cfg = "cfail2", except = "hir_owner, hir_owner_nodes, predicates_of")] #[rustc_clean(cfg = "cfail3")] + #[rustc_clean(cfg = "cfail5", except = "hir_owner, hir_owner_nodes, predicates_of")] + #[rustc_clean(cfg = "cfail6")] pub fn indirect_trait_bound_where<T>(p: T) where T: Trait, |
