ICH: update saw_ty for TyBareFn; Update tests for functioninterfaces

This commit is contained in:
Mathieu Borderé 2016-10-05 23:17:58 +02:00
parent 14fe7ce9dc
commit 4b5a9a3706
2 changed files with 28 additions and 7 deletions

View File

@ -349,7 +349,7 @@ enum SawTyComponent {
SawTyArray, SawTyArray,
SawTyPtr(Mutability), SawTyPtr(Mutability),
SawTyRptr(Mutability), SawTyRptr(Mutability),
SawTyBareFn, SawTyBareFn(Unsafety, Abi),
SawTyNever, SawTyNever,
SawTyTup, SawTyTup,
SawTyPath, SawTyPath,
@ -366,7 +366,10 @@ fn saw_ty(node: &Ty_) -> SawTyComponent {
TyArray(..) => SawTyArray, TyArray(..) => SawTyArray,
TyPtr(ref mty) => SawTyPtr(mty.mutbl), TyPtr(ref mty) => SawTyPtr(mty.mutbl),
TyRptr(_, ref mty) => SawTyRptr(mty.mutbl), TyRptr(_, ref mty) => SawTyRptr(mty.mutbl),
TyBareFn(..) => SawTyBareFn, TyBareFn(ref barefnty) => {
let ref fnty = *barefnty;
SawTyBareFn(fnty.unsafety, fnty.abi)
},
TyNever => SawTyNever, TyNever => SawTyNever,
TyTup(..) => SawTyTup, TyTup(..) => SawTyTup,
TyPath(..) => SawTyPath, TyPath(..) => SawTyPath,

View File

@ -84,14 +84,14 @@ fn type_of_parameter_ref(p: &mut i32) {}
// Change Parameter Order ------------------------------------------------------ // Change Parameter Order ------------------------------------------------------
#[cfg(cfail1)] #[cfg(cfail1)]
fn order_of_parameters(p1: i32, p2: i32) {} fn order_of_parameters(p1: i32, p2: i64) {}
#[cfg(not(cfail1))] #[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")] #[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")] #[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_dirty(cfg="cfail2")]
#[rustc_metadata_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail3")]
fn order_of_parameters(p2: i32, p1: i32) {} fn order_of_parameters(p2: i64, p1: i32) {}
// Unsafe ---------------------------------------------------------------------- // Unsafe ----------------------------------------------------------------------
@ -188,7 +188,7 @@ fn builtin_bound<T: Send>() {}
// Lifetime Bound -------------------------------------------------------------- // Lifetime Bound --------------------------------------------------------------
#[cfg(cfail1)] #[cfg(cfail1)]
fn lifetime_bound<T>() {} fn lifetime_bound<'a, T>() {}
#[cfg(not(cfail1))] #[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")] #[rustc_dirty(label="Hir", cfg="cfail2")]
@ -227,7 +227,7 @@ fn second_builtin_bound<T: Send + Sized>() {}
// Second Lifetime Bound ------------------------------------------------------- // Second Lifetime Bound -------------------------------------------------------
#[cfg(cfail1)] #[cfg(cfail1)]
fn second_lifetime_bound<'a, T: 'a>() {} fn second_lifetime_bound<'a, 'b, T: 'a>() {}
#[cfg(not(cfail1))] #[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")] #[rustc_dirty(label="Hir", cfg="cfail2")]
@ -254,6 +254,7 @@ fn inline() {}
// Inline Never ---------------------------------------------------------------- // Inline Never ----------------------------------------------------------------
#[cfg(cfail1)] #[cfg(cfail1)]
#[inline(always)]
fn inline_never() {} fn inline_never() {}
#[cfg(not(cfail1))] #[cfg(not(cfail1))]
@ -289,7 +290,7 @@ fn linkage() {}
#[rustc_clean(label="Hir", cfg="cfail3")] #[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_dirty(cfg="cfail2")]
#[rustc_metadata_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail3")]
#[linkage] #[linkage="weak_odr"]
fn linkage() {} fn linkage() {}
@ -310,6 +311,23 @@ fn return_impl_trait() -> impl Clone {
} }
// Change Return Impl Trait ----------------------------------------------------
#[cfg(cfail1)]
fn change_return_impl_trait() -> impl Clone {
0
}
#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_metadata_dirty(cfg="cfail2")]
#[rustc_metadata_clean(cfg="cfail3")]
fn change_return_impl_trait() -> impl Copy {
0
}
// Change Return Type Indirectly ----------------------------------------------- // Change Return Type Indirectly -----------------------------------------------
struct ReferencedType1; struct ReferencedType1;