1 //! The futures-rs procedural macro implementations.
2 
3 #![recursion_limit = "128"]
4 #![warn(rust_2018_idioms, unreachable_pub)]
5 // It cannot be included in the published code because this lints have false positives in the minimum required version.
6 #![cfg_attr(test, warn(single_use_lifetimes))]
7 #![warn(clippy::all)]
8 #![doc(test(attr(deny(warnings), allow(dead_code, unused_assignments, unused_variables))))]
9 
10 // Since https://github.com/rust-lang/cargo/pull/7700 `proc_macro` is part of the prelude for
11 // proc-macro crates, but to support older compilers we still need this explicit `extern crate`.
12 #[allow(unused_extern_crates)]
13 extern crate proc_macro;
14 
15 use proc_macro::TokenStream;
16 use proc_macro_hack::proc_macro_hack;
17 
18 mod join;
19 mod select;
20 
21 /// The `join!` macro.
22 #[proc_macro_hack]
join_internal(input: TokenStream) -> TokenStream23 pub fn join_internal(input: TokenStream) -> TokenStream {
24     crate::join::join(input)
25 }
26 
27 /// The `try_join!` macro.
28 #[proc_macro_hack]
try_join_internal(input: TokenStream) -> TokenStream29 pub fn try_join_internal(input: TokenStream) -> TokenStream {
30     crate::join::try_join(input)
31 }
32 
33 /// The `select!` macro.
34 #[proc_macro_hack]
select_internal(input: TokenStream) -> TokenStream35 pub fn select_internal(input: TokenStream) -> TokenStream {
36     crate::select::select(input)
37 }
38 
39 /// The `select_biased!` macro.
40 #[proc_macro_hack]
select_biased_internal(input: TokenStream) -> TokenStream41 pub fn select_biased_internal(input: TokenStream) -> TokenStream {
42     crate::select::select_biased(input)
43 }
44