From e387c8870017a9fb014fb18e249395a844f5d0e6 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 7 Mar 2016 16:07:18 +0100 Subject: [PATCH 1/2] =?UTF-8?q?"can=20be=20built=20on=20Ref::map"=E2=80=A6?= =?UTF-8?q?=20how=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that `std::cell::Ref::filter_map` and `RefMut::filter_map` are deprecated, using them gives a warning like: ``` script/dom/element.rs:754:9: 754:24 warning: use of deprecated item: can be built on Ref::map, #[warn(deprecated)] on by default ``` But it’s not at all obvious *how* the functionality can be built on `Ref::map`. This PR adds to the warning message a crates.io URL for a crate that does. --- src/libcore/cell.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 144adde12e4..8f6557079f1 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -625,7 +625,7 @@ impl<'b, T: ?Sized> Ref<'b, T> { /// ``` #[unstable(feature = "cell_extras", reason = "recently added", issue = "27746")] - #[rustc_deprecated(since = "1.8.0", reason = "can be built on Ref::map")] + #[rustc_deprecated(since = "1.8.0", reason = "can be built on `Ref::map`: https://crates.io/crates/ref_filter_map")] #[inline] pub fn filter_map(orig: Ref<'b, T>, f: F) -> Option> where F: FnOnce(&T) -> Option<&U> @@ -700,7 +700,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> { /// ``` #[unstable(feature = "cell_extras", reason = "recently added", issue = "27746")] - #[rustc_deprecated(since = "1.8.0", reason = "can be built on RefMut::map")] + #[rustc_deprecated(since = "1.8.0", reason = "can be built on `RefMut::map`: https://crates.io/crates/ref_filter_map")] #[inline] pub fn filter_map(orig: RefMut<'b, T>, f: F) -> Option> where F: FnOnce(&mut T) -> Option<&mut U> From 57b3cfde0dd43e5e4d4eea2cd6bce16f7b6622d5 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 7 Mar 2016 16:27:21 +0100 Subject: [PATCH 2/2] Fix some line lengths --- src/libcore/cell.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 8f6557079f1..fdd2e3a1784 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -625,7 +625,8 @@ impl<'b, T: ?Sized> Ref<'b, T> { /// ``` #[unstable(feature = "cell_extras", reason = "recently added", issue = "27746")] - #[rustc_deprecated(since = "1.8.0", reason = "can be built on `Ref::map`: https://crates.io/crates/ref_filter_map")] + #[rustc_deprecated(since = "1.8.0", reason = "can be built on `Ref::map`: \ + https://crates.io/crates/ref_filter_map")] #[inline] pub fn filter_map(orig: Ref<'b, T>, f: F) -> Option> where F: FnOnce(&T) -> Option<&U> @@ -700,7 +701,8 @@ impl<'b, T: ?Sized> RefMut<'b, T> { /// ``` #[unstable(feature = "cell_extras", reason = "recently added", issue = "27746")] - #[rustc_deprecated(since = "1.8.0", reason = "can be built on `RefMut::map`: https://crates.io/crates/ref_filter_map")] + #[rustc_deprecated(since = "1.8.0", reason = "can be built on `RefMut::map`: \ + https://crates.io/crates/ref_filter_map")] #[inline] pub fn filter_map(orig: RefMut<'b, T>, f: F) -> Option> where F: FnOnce(&mut T) -> Option<&mut U>