1
- use alloc:: string:: String ;
2
-
3
1
/// Calls a function and aborts if it panics.
4
2
///
5
3
/// This is useful in unsafe code where we can't recover from panics.
@@ -55,8 +53,9 @@ pub fn random(n: u32) -> u32 {
55
53
}
56
54
57
55
/// Add additional context to errors
56
+ #[ cfg( any( feature = "unstable" , feature = "default" ) ) ]
58
57
pub ( crate ) trait Context {
59
- fn context ( self , message : impl Fn ( ) -> String ) -> Self ;
58
+ fn context ( self , message : impl Fn ( ) -> alloc :: string :: String ) -> Self ;
60
59
}
61
60
62
61
#[ cfg( all(
@@ -148,7 +147,7 @@ macro_rules! cfg_unstable_default {
148
147
( $( $item: item) * ) => {
149
148
$(
150
149
#[ cfg( all( feature = "default" , feature = "unstable" ) ) ]
151
- #[ cfg_attr( feature = "docs" , doc( unstable) ) ]
150
+ #[ cfg_attr( feature = "docs" , doc( cfg ( unstable) ) ) ]
152
151
$item
153
152
) *
154
153
}
@@ -161,7 +160,6 @@ macro_rules! cfg_unix {
161
160
( $( $item: item) * ) => {
162
161
$(
163
162
#[ cfg( any( unix, feature = "docs" ) ) ]
164
- #[ cfg_attr( feature = "docs" , doc( cfg( unix) ) ) ]
165
163
$item
166
164
) *
167
165
}
@@ -174,7 +172,6 @@ macro_rules! cfg_windows {
174
172
( $( $item: item) * ) => {
175
173
$(
176
174
#[ cfg( any( windows, feature = "docs" ) ) ]
177
- #[ cfg_attr( feature = "docs" , doc( cfg( windows) ) ) ]
178
175
$item
179
176
) *
180
177
}
0 commit comments