[−][src]Macro alloc::setup_imports
Create the alloc
api facade
This will add the extern crate
declaration for the alloc crate and
set up the facade module at crate::alloc
. It should contain an identical API
surface for both std
and alloc
uses.
Example
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(feature = "alloc", feature(alloc))] #![cfg_attr(feature = "futures", feature(futures_api))] // Each of std, alloc, and futures should be followed by a "meta" item. // This will be used for the proper #[cfg(...)] attributes. // They can be in any order. futures is optional, and will default to // "always disabled". You can use "all()" for "always enabled" on any of them. crate::setup_imports! { std: feature = "std", alloc: feature = "alloc", futures: feature = "futures", }