Skip to content

Commit bc02b1e

Browse files
committed
Adjust documentation on unsizing
1 parent 91d57b8 commit bc02b1e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

crates/rc-box/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ optional = true
3131
[dependencies.unsize]
3232
version = "1.1"
3333
optional = true
34+
35+
[package.metadata.docs.rs]
36+
all-features = true

crates/rc-box/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ macro_rules! rc_box {
9595

9696
// ~~~ $Rc<T> and Box<T> like inherent impls ~~~ //
9797

98-
// downcast is pretty useless without CoerceUnsized
99-
10098
impl $RcBox<dyn Any + 'static> {
10199
doc_comment! {
102100
concat!("Attempt to downcast the box to a concrete type.
@@ -122,7 +120,8 @@ print_if_string(my_number.try_into().unwrap());
122120
```
123121
124122
The unsizing as `", stringify!($Rc), "` is required until
125-
[DST coercions](https://github.com/rust-lang/rust/issues/27732) are stabilized."),
123+
[DST coercions](https://github.com/rust-lang/rust/issues/27732) are stabilized. Alternatively,
124+
activate the `unsize` feature to convert the pointer via an explicit method call."),
126125
#[inline]
127126
pub fn downcast<T>(self) -> Result<$RcBox<T>, Self>
128127
where T: Any,
@@ -164,7 +163,8 @@ print_if_string(my_number.try_into().unwrap());
164163
```
165164
166165
The unsizing as `", stringify!($Rc), "` is required until
167-
[DST coercions](https://github.com/rust-lang/rust/issues/27732) are stabilized."),
166+
[DST coercions](https://github.com/rust-lang/rust/issues/27732) are stabilized. Alternatively,
167+
activate the `unsize` feature to convert the pointer via an explicit method call."),
168168
#[inline]
169169
pub fn downcast<T>(self) -> Result<$RcBox<T>, Self>
170170
where T: Any + Send
@@ -206,7 +206,8 @@ print_if_string(my_number.try_into().unwrap());
206206
```
207207
208208
The unsizing as `", stringify!($Rc), "` is required until
209-
[DST coercions](https://github.com/rust-lang/rust/issues/27732) are stabilized."),
209+
[DST coercions](https://github.com/rust-lang/rust/issues/27732) are stabilized. Alternatively,
210+
activate the `unsize` feature to convert the pointer via an explicit method call."),
210211
#[inline]
211212
pub fn downcast<T>(self) -> Result<$RcBox<T>, Self>
212213
where T: Any + Send + Sync

0 commit comments

Comments
 (0)