From f0174fcbee229c67ebfdae9012628891a55be7aa Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Wed, 8 Jun 2016 09:19:44 +0300 Subject: use the slice_pat hack in libstd too --- src/libstd/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libstd/lib.rs') diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 7114d47e6e8..135ea8a5e7c 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -467,3 +467,15 @@ pub mod __rand { // the rustdoc documentation for primitive types. Using `include!` // because rustdoc only looks for these modules at the crate level. include!("primitive_docs.rs"); + +// FIXME(stage0): remove this after a snapshot +// HACK: this is needed because the interpretation of slice +// patterns changed between stage0 and now. +#[cfg(stage0)] +fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'a &'b [T] { + t +} +#[cfg(not(stage0))] +fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'b [T] { + *t +} -- cgit 1.4.1-3-g733a5