Skip to content

Commit e387c88

Browse files
committed
"can be built on Ref::map"… how?
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.
1 parent e079afa commit e387c88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/cell.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
625625
/// ```
626626
#[unstable(feature = "cell_extras", reason = "recently added",
627627
issue = "27746")]
628-
#[rustc_deprecated(since = "1.8.0", reason = "can be built on Ref::map")]
628+
#[rustc_deprecated(since = "1.8.0", reason = "can be built on `Ref::map`: https://crates.io/crates/ref_filter_map")]
629629
#[inline]
630630
pub fn filter_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Option<Ref<'b, U>>
631631
where F: FnOnce(&T) -> Option<&U>
@@ -700,7 +700,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
700700
/// ```
701701
#[unstable(feature = "cell_extras", reason = "recently added",
702702
issue = "27746")]
703-
#[rustc_deprecated(since = "1.8.0", reason = "can be built on RefMut::map")]
703+
#[rustc_deprecated(since = "1.8.0", reason = "can be built on `RefMut::map`: https://crates.io/crates/ref_filter_map")]
704704
#[inline]
705705
pub fn filter_map<U: ?Sized, F>(orig: RefMut<'b, T>, f: F) -> Option<RefMut<'b, U>>
706706
where F: FnOnce(&mut T) -> Option<&mut U>

0 commit comments

Comments
 (0)