From 4b5a9a37066e3d879c061cdd58bd05ffe4554244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Border=C3=A9?= Date: Wed, 5 Oct 2016 23:17:58 +0200 Subject: [PATCH] ICH: update saw_ty for TyBareFn; Update tests for functioninterfaces --- .../calculate_svh/svh_visitor.rs | 7 +++-- .../incremental/hashes/function_interfaces.rs | 28 +++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/librustc_incremental/calculate_svh/svh_visitor.rs b/src/librustc_incremental/calculate_svh/svh_visitor.rs index 59226c83cea..9aa55dc582e 100644 --- a/src/librustc_incremental/calculate_svh/svh_visitor.rs +++ b/src/librustc_incremental/calculate_svh/svh_visitor.rs @@ -349,7 +349,7 @@ enum SawTyComponent { SawTyArray, SawTyPtr(Mutability), SawTyRptr(Mutability), - SawTyBareFn, + SawTyBareFn(Unsafety, Abi), SawTyNever, SawTyTup, SawTyPath, @@ -366,7 +366,10 @@ fn saw_ty(node: &Ty_) -> SawTyComponent { TyArray(..) => SawTyArray, TyPtr(ref mty) => SawTyPtr(mty.mutbl), TyRptr(_, ref mty) => SawTyRptr(mty.mutbl), - TyBareFn(..) => SawTyBareFn, + TyBareFn(ref barefnty) => { + let ref fnty = *barefnty; + SawTyBareFn(fnty.unsafety, fnty.abi) + }, TyNever => SawTyNever, TyTup(..) => SawTyTup, TyPath(..) => SawTyPath, diff --git a/src/test/incremental/hashes/function_interfaces.rs b/src/test/incremental/hashes/function_interfaces.rs index 50f3729f1c6..93d94cd1a19 100644 --- a/src/test/incremental/hashes/function_interfaces.rs +++ b/src/test/incremental/hashes/function_interfaces.rs @@ -84,14 +84,14 @@ fn type_of_parameter_ref(p: &mut i32) {} // Change Parameter Order ------------------------------------------------------ #[cfg(cfail1)] -fn order_of_parameters(p1: i32, p2: i32) {} +fn order_of_parameters(p1: i32, p2: i64) {} #[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 order_of_parameters(p2: i32, p1: i32) {} +fn order_of_parameters(p2: i64, p1: i32) {} // Unsafe ---------------------------------------------------------------------- @@ -188,7 +188,7 @@ fn builtin_bound() {} // Lifetime Bound -------------------------------------------------------------- #[cfg(cfail1)] -fn lifetime_bound() {} +fn lifetime_bound<'a, T>() {} #[cfg(not(cfail1))] #[rustc_dirty(label="Hir", cfg="cfail2")] @@ -227,7 +227,7 @@ fn second_builtin_bound() {} // Second Lifetime Bound ------------------------------------------------------- #[cfg(cfail1)] -fn second_lifetime_bound<'a, T: 'a>() {} +fn second_lifetime_bound<'a, 'b, T: 'a>() {} #[cfg(not(cfail1))] #[rustc_dirty(label="Hir", cfg="cfail2")] @@ -254,6 +254,7 @@ fn inline() {} // Inline Never ---------------------------------------------------------------- #[cfg(cfail1)] +#[inline(always)] fn inline_never() {} #[cfg(not(cfail1))] @@ -289,7 +290,7 @@ fn linkage() {} #[rustc_clean(label="Hir", cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -#[linkage] +#[linkage="weak_odr"] 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 ----------------------------------------------- struct ReferencedType1;