Format function_interfaces.rs
This commit is contained in:
parent
274fb668b4
commit
10b23e3fd3
1 changed files with 40 additions and 46 deletions
|
@ -9,25 +9,24 @@
|
||||||
// revisions: cfail1 cfail2 cfail3
|
// revisions: cfail1 cfail2 cfail3
|
||||||
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
|
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
|
||||||
|
|
||||||
|
|
||||||
#![allow(warnings)]
|
#![allow(warnings)]
|
||||||
#![feature(linkage)]
|
#![feature(linkage)]
|
||||||
#![feature(rustc_attrs)]
|
#![feature(rustc_attrs)]
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
|
|
||||||
|
|
||||||
// Add Parameter ---------------------------------------------------------------
|
// Add Parameter ---------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn add_parameter() {}
|
pub fn add_parameter() {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn add_parameter(p: i32) {}
|
pub fn add_parameter(p: i32) {}
|
||||||
|
|
||||||
|
|
||||||
// Add Return Type -------------------------------------------------------------
|
// Add Return Type -------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -38,55 +37,58 @@ pub fn add_return_type() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn add_return_type() -> () {}
|
pub fn add_return_type() -> () {}
|
||||||
|
|
||||||
|
|
||||||
// Change Parameter Type -------------------------------------------------------
|
// Change Parameter Type -------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn type_of_parameter(p: i32) {}
|
pub fn type_of_parameter(p: i32) {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn type_of_parameter(p: i64) {}
|
pub fn type_of_parameter(p: i64) {}
|
||||||
|
|
||||||
|
|
||||||
// Change Parameter Type Reference ---------------------------------------------
|
// Change Parameter Type Reference ---------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn type_of_parameter_ref(p: &i32) {}
|
pub fn type_of_parameter_ref(p: &i32) {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn type_of_parameter_ref(p: &mut i32) {}
|
pub fn type_of_parameter_ref(p: &mut i32) {}
|
||||||
|
|
||||||
|
|
||||||
// Change Parameter Order ------------------------------------------------------
|
// Change Parameter Order ------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn order_of_parameters(p1: i32, p2: i64) {}
|
pub fn order_of_parameters(p1: i32, p2: i64) {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn order_of_parameters(p2: i64, p1: i32) {}
|
pub fn order_of_parameters(p2: i64, p1: i32) {}
|
||||||
|
|
||||||
|
|
||||||
// Unsafe ----------------------------------------------------------------------
|
// Unsafe ----------------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn make_unsafe() {}
|
pub fn make_unsafe() {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub unsafe fn make_unsafe() {}
|
pub unsafe fn make_unsafe() {}
|
||||||
|
|
||||||
|
|
||||||
// Extern ----------------------------------------------------------------------
|
// Extern ----------------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -97,19 +99,19 @@ pub fn make_extern() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub extern "C" fn make_extern() {}
|
pub extern "C" fn make_extern() {}
|
||||||
|
|
||||||
|
|
||||||
// Type Parameter --------------------------------------------------------------
|
// Type Parameter --------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn type_parameter() {}
|
pub fn type_parameter() {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn type_parameter<T>() {}
|
pub fn type_parameter<T>() {}
|
||||||
|
|
||||||
|
|
||||||
// Lifetime Parameter ----------------------------------------------------------
|
// Lifetime Parameter ----------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -120,7 +122,6 @@ pub fn lifetime_parameter() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn lifetime_parameter<'a>() {}
|
pub fn lifetime_parameter<'a>() {}
|
||||||
|
|
||||||
|
|
||||||
// Trait Bound -----------------------------------------------------------------
|
// Trait Bound -----------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -131,7 +132,6 @@ pub fn trait_bound<T>() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn trait_bound<T: Eq>() {}
|
pub fn trait_bound<T: Eq>() {}
|
||||||
|
|
||||||
|
|
||||||
// Builtin Bound ---------------------------------------------------------------
|
// Builtin Bound ---------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -142,19 +142,19 @@ pub fn builtin_bound<T>() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn builtin_bound<T: Send>() {}
|
pub fn builtin_bound<T: Send>() {}
|
||||||
|
|
||||||
|
|
||||||
// Lifetime Bound --------------------------------------------------------------
|
// Lifetime Bound --------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn lifetime_bound<'a, T>() {}
|
pub fn lifetime_bound<'a, T>() {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn lifetime_bound<'a, T: 'a>() {}
|
pub fn lifetime_bound<'a, T: 'a>() {}
|
||||||
|
|
||||||
|
|
||||||
// Second Trait Bound ----------------------------------------------------------
|
// Second Trait Bound ----------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -165,7 +165,6 @@ pub fn second_trait_bound<T: Eq>() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn second_trait_bound<T: Eq + Clone>() {}
|
pub fn second_trait_bound<T: Eq + Clone>() {}
|
||||||
|
|
||||||
|
|
||||||
// Second Builtin Bound --------------------------------------------------------
|
// Second Builtin Bound --------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -176,19 +175,19 @@ pub fn second_builtin_bound<T: Send>() {}
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn second_builtin_bound<T: Send + Sized>() {}
|
pub fn second_builtin_bound<T: Send + Sized>() {}
|
||||||
|
|
||||||
|
|
||||||
// Second Lifetime Bound -------------------------------------------------------
|
// Second Lifetime Bound -------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
pub fn second_lifetime_bound<'a, 'b, T: 'a>() {}
|
pub fn second_lifetime_bound<'a, 'b, T: 'a>() {}
|
||||||
|
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, generics_of, type_of, predicates_of"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn second_lifetime_bound<'a, 'b, T: 'a + 'b>() {}
|
pub fn second_lifetime_bound<'a, 'b, T: 'a + 'b>() {}
|
||||||
|
|
||||||
|
|
||||||
// Inline ----------------------------------------------------------------------
|
// Inline ----------------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -200,7 +199,6 @@ pub fn inline() {}
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn inline() {}
|
pub fn inline() {}
|
||||||
|
|
||||||
|
|
||||||
// Inline Never ----------------------------------------------------------------
|
// Inline Never ----------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -213,7 +211,6 @@ pub fn inline_never() {}
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
pub fn inline_never() {}
|
pub fn inline_never() {}
|
||||||
|
|
||||||
|
|
||||||
// No Mangle -------------------------------------------------------------------
|
// No Mangle -------------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -225,7 +222,6 @@ pub fn no_mangle() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn no_mangle() {}
|
pub fn no_mangle() {}
|
||||||
|
|
||||||
|
|
||||||
// Linkage ---------------------------------------------------------------------
|
// Linkage ---------------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -237,7 +233,6 @@ pub fn linkage() {}
|
||||||
#[linkage = "weak_odr"]
|
#[linkage = "weak_odr"]
|
||||||
pub fn linkage() {}
|
pub fn linkage() {}
|
||||||
|
|
||||||
|
|
||||||
// Return Impl Trait -----------------------------------------------------------
|
// Return Impl Trait -----------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -252,7 +247,6 @@ pub fn return_impl_trait() -> impl Clone {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change Return Impl Trait ----------------------------------------------------
|
// Change Return Impl Trait ----------------------------------------------------
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
@ -267,7 +261,6 @@ pub fn change_return_impl_trait() -> impl Copy {
|
||||||
0u32
|
0u32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change Return Type Indirectly -----------------------------------------------
|
// Change Return Type Indirectly -----------------------------------------------
|
||||||
|
|
||||||
pub struct ReferencedType1;
|
pub struct ReferencedType1;
|
||||||
|
@ -279,15 +272,16 @@ pub mod change_return_type_indirectly {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
use super::ReferencedType2 as ReturnType;
|
use super::ReferencedType2 as ReturnType;
|
||||||
|
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn indirect_return_type() -> ReturnType {
|
pub fn indirect_return_type() -> ReturnType {
|
||||||
ReturnType {}
|
ReturnType {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change Parameter Type Indirectly --------------------------------------------
|
// Change Parameter Type Indirectly --------------------------------------------
|
||||||
|
|
||||||
pub mod change_parameter_type_indirectly {
|
pub mod change_parameter_type_indirectly {
|
||||||
|
@ -296,13 +290,14 @@ pub mod change_parameter_type_indirectly {
|
||||||
#[cfg(not(cfail1))]
|
#[cfg(not(cfail1))]
|
||||||
use super::ReferencedType2 as ParameterType;
|
use super::ReferencedType2 as ParameterType;
|
||||||
|
|
||||||
#[rustc_clean(cfg = "cfail2",
|
#[rustc_clean(
|
||||||
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig")]
|
cfg = "cfail2",
|
||||||
|
except = "hir_owner, hir_owner_items, mir_built, optimized_mir, typeck_tables_of, fn_sig"
|
||||||
|
)]
|
||||||
#[rustc_clean(cfg = "cfail3")]
|
#[rustc_clean(cfg = "cfail3")]
|
||||||
pub fn indirect_parameter_type(p: ParameterType) {}
|
pub fn indirect_parameter_type(p: ParameterType) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change Trait Bound Indirectly -----------------------------------------------
|
// Change Trait Bound Indirectly -----------------------------------------------
|
||||||
|
|
||||||
pub trait ReferencedTrait1 {}
|
pub trait ReferencedTrait1 {}
|
||||||
|
@ -319,7 +314,6 @@ pub mod change_trait_bound_indirectly {
|
||||||
pub fn indirect_trait_bound<T: Trait>(p: T) {}
|
pub fn indirect_trait_bound<T: Trait>(p: T) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change Trait Bound Indirectly In Where Clause -------------------------------
|
// Change Trait Bound Indirectly In Where Clause -------------------------------
|
||||||
|
|
||||||
pub mod change_trait_bound_indirectly_in_where_clause {
|
pub mod change_trait_bound_indirectly_in_where_clause {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue