1+ #[ cfg( feature = "no-std" ) ]
2+ extern crate alloc;
3+
4+ #[ cfg( feature = "no-std" ) ]
5+ use alloc:: string:: String ;
6+
17/// Calls a function and aborts if it panics.
28///
39/// This is useful in unsafe code where we can't recover from panics.
@@ -104,6 +110,7 @@ macro_rules! cfg_unstable_default {
104110
105111/// Declares Unix-specific items.
106112#[ doc( hidden) ]
113+ #[ allow( unused_macros) ]
107114macro_rules! cfg_unix {
108115 ( $( $item: item) * ) => {
109116 $(
@@ -116,6 +123,7 @@ macro_rules! cfg_unix {
116123
117124/// Declares Windows-specific items.
118125#[ doc( hidden) ]
126+ #[ allow( unused_macros) ]
119127macro_rules! cfg_windows {
120128 ( $( $item: item) * ) => {
121129 $(
@@ -128,6 +136,7 @@ macro_rules! cfg_windows {
128136
129137/// Declares items when the "docs" feature is enabled.
130138#[ doc( hidden) ]
139+ #[ allow( unused_macros) ]
131140macro_rules! cfg_docs {
132141 ( $( $item: item) * ) => {
133142 $(
@@ -139,6 +148,7 @@ macro_rules! cfg_docs {
139148
140149/// Declares items when the "docs" feature is disabled.
141150#[ doc( hidden) ]
151+ #[ allow( unused_macros) ]
142152macro_rules! cfg_not_docs {
143153 ( $( $item: item) * ) => {
144154 $(
@@ -160,6 +170,18 @@ macro_rules! cfg_std {
160170 }
161171}
162172
173+ /// Declares no-std items.
174+ #[ allow( unused_macros) ]
175+ #[ doc( hidden) ]
176+ macro_rules! cfg_no_std {
177+ ( $( $item: item) * ) => {
178+ $(
179+ #[ cfg( feature = "no-std" ) ]
180+ $item
181+ ) *
182+ }
183+ }
184+
163185/// Declares default items.
164186#[ allow( unused_macros) ]
165187#[ doc( hidden) ]
@@ -180,6 +202,7 @@ macro_rules! cfg_default {
180202///
181203/// Inside invocations of this macro, we write a definitions that looks similar to the final
182204/// rendered docs, and the macro then generates all the boilerplate for us.
205+ #[ allow( unused_macros) ]
183206#[ doc( hidden) ]
184207macro_rules! extension_trait {
185208 (
@@ -204,14 +227,14 @@ macro_rules! extension_trait {
204227 #[ allow( dead_code) ]
205228 mod owned {
206229 #[ doc( hidden) ]
207- pub struct ImplFuture <T >( std :: marker:: PhantomData <T >) ;
230+ pub struct ImplFuture <T >( core :: marker:: PhantomData <T >) ;
208231 }
209232
210233 // A fake `impl Future` type that borrows its environment.
211234 #[ allow( dead_code) ]
212235 mod borrowed {
213236 #[ doc( hidden) ]
214- pub struct ImplFuture <' a, T >( std :: marker:: PhantomData <& ' a T >) ;
237+ pub struct ImplFuture <' a, T >( core :: marker:: PhantomData <& ' a T >) ;
215238 }
216239
217240 // Render a fake trait combining the bodies of the base trait and the extension trait.
0 commit comments