diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-06-08 09:19:44 +0300 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-06-09 00:38:38 +0300 |
| commit | f0174fcbee229c67ebfdae9012628891a55be7aa (patch) | |
| tree | a4d4ab0ecd2e14ba3637ad4349b3c57858e59055 /src/libstd/lib.rs | |
| parent | 9b1abf5c65d4019542ff3cf5daa15c0e22e7e012 (diff) | |
| download | rust-f0174fcbee229c67ebfdae9012628891a55be7aa.tar.gz rust-f0174fcbee229c67ebfdae9012628891a55be7aa.zip | |
use the slice_pat hack in libstd too
Diffstat (limited to 'src/libstd/lib.rs')
| -rw-r--r-- | src/libstd/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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 +} |
