From 15adaf6f3ea4b2cdab5ecf6ce319eb39d81ab64f Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 4 Mar 2014 19:23:57 -0500 Subject: [PATCH] mark the `map` method on Vec as deprecated This exists for the sake of compatibility during the ~[T] -> Vec transition. It will be removed in the future. --- src/librustc/lib.rs | 1 + src/libstd/vec_ng.rs | 1 + src/libsyntax/lib.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 4018e70b4f58b..e556fac6bcddb 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -27,6 +27,7 @@ This API is completely unstable and subject to change. html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")]; +#[allow(deprecated)]; #[feature(macro_rules, globs, struct_variant, managed_boxes)]; #[feature(quote)]; diff --git a/src/libstd/vec_ng.rs b/src/libstd/vec_ng.rs index 9b6acdd9b9ee5..0dc17435fbe85 100644 --- a/src/libstd/vec_ng.rs +++ b/src/libstd/vec_ng.rs @@ -350,6 +350,7 @@ impl Vec { } #[inline] + #[deprecated="Use `xs.iter().map(closure)` instead."] pub fn map(&self, f: |t: &T| -> U) -> Vec { self.iter().map(f).collect() } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 42c9ab461aa00..61793957d925d 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -30,6 +30,7 @@ This API is completely unstable and subject to change. #[allow(unknown_features)];// Note: remove it after a snapshot. #[feature(quote)]; +#[allow(deprecated)]; #[deny(non_camel_case_types)]; extern crate serialize;