use the slice_pat hack in libstd too

This commit is contained in:
Ariel Ben-Yehuda
2016-06-08 09:19:44 +03:00
parent 9b1abf5c65
commit f0174fcbee
3 changed files with 21 additions and 18 deletions

View File

@@ -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
}