@@ -95,8 +95,6 @@ macro_rules! rc_box {
95
95
96
96
// ~~~ $Rc<T> and Box<T> like inherent impls ~~~ //
97
97
98
- // downcast is pretty useless without CoerceUnsized
99
-
100
98
impl $RcBox<dyn Any + ' static > {
101
99
doc_comment! {
102
100
concat!( "Attempt to downcast the box to a concrete type.
@@ -122,7 +120,8 @@ print_if_string(my_number.try_into().unwrap());
122
120
```
123
121
124
122
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." ) ,
126
125
#[ inline]
127
126
pub fn downcast<T >( self ) -> Result <$RcBox<T >, Self >
128
127
where T : Any ,
@@ -164,7 +163,8 @@ print_if_string(my_number.try_into().unwrap());
164
163
```
165
164
166
165
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." ) ,
168
168
#[ inline]
169
169
pub fn downcast<T >( self ) -> Result <$RcBox<T >, Self >
170
170
where T : Any + Send
@@ -206,7 +206,8 @@ print_if_string(my_number.try_into().unwrap());
206
206
```
207
207
208
208
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." ) ,
210
211
#[ inline]
211
212
pub fn downcast<T >( self ) -> Result <$RcBox<T >, Self >
212
213
where T : Any + Send + Sync
0 commit comments