22
22
//! makes sense to apply that even to `fn main`. Unfortunately this would
23
23
//! require compiler support to enable, so we've provided an experimental
24
24
//! polyfill for it in the mean time.
25
- //!
26
- //! # Why isn't this crate part of async-std?
27
- //!
28
- //! We want to make sure `async-std`'s surface area is stable, and only includes
29
- //! things that would make sense to be part of "an async version of std".
30
- //! Language level support is really important, but _not_ part of the standard
31
- //! library.
32
- //!
33
- //! This has some distinct benefits: in particular it allows us to
34
- //! version both crates at a different pace. And as features are added to the
35
- //! language (or we decide they weren't a great idea after all), we can
36
- //! incrementally shrink the surface area of this crate.
37
- //!
38
- //! The other big benefit is that it allows libraries to depend on `async-std`
39
- //! without needing to pull in the rather heavy `syn`, `quote`, and
40
- //! `proc-macro2` crates. This should help keep compilation times snappy for
41
- //! everyone.
42
25
43
26
#![ forbid( unsafe_code, future_incompatible, rust_2018_idioms) ]
44
27
#![ deny( missing_debug_implementations, nonstandard_style) ]
@@ -53,13 +36,13 @@ use syn::spanned::Spanned;
53
36
/// <span
54
37
/// class="module-item stab portability"
55
38
/// style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
56
- /// ><code>bin </code></span>
57
- /// Defines the async main function.
39
+ /// ><code>attributes </code></span>
40
+ /// Enables an async main function.
58
41
///
59
42
/// # Examples
60
43
///
61
44
/// ```ignore
62
- /// #[async_attributes ::main]
45
+ /// #[async_std ::main]
63
46
/// async fn main() -> std::io::Result<()> {
64
47
/// Ok(())
65
48
/// }
@@ -107,13 +90,13 @@ pub fn main(_attr: TokenStream, item: TokenStream) -> TokenStream {
107
90
/// <span
108
91
/// class="module-item stab portability"
109
92
/// style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
110
- /// ><code>bin </code></span>
111
- /// Creates an async unit test.
93
+ /// ><code>attributes </code></span>
94
+ /// Enables an async test function .
112
95
///
113
96
/// # Examples
114
97
///
115
98
/// ```ignore
116
- /// #[async_attributes ::test]
99
+ /// #[async_std ::test]
117
100
/// async fn my_test() -> std::io::Result<()> {
118
101
/// assert_eq!(2 * 2, 4);
119
102
/// Ok(())
@@ -148,16 +131,16 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream {
148
131
/// <span
149
132
/// class="module-item stab portability"
150
133
/// style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
151
- /// ><code>bin </code></span>
152
- /// Creates an async benchmark.
134
+ /// ><code>attributes </code></span>
135
+ /// Enables an async benchmark function .
153
136
///
154
137
/// # Examples
155
138
///
156
139
/// ```ignore
157
140
/// #![feature(test)]
158
141
/// extern crate test;
159
142
///
160
- /// #[async_attributes ::bench]
143
+ /// #[async_std ::bench]
161
144
/// async fn bench_1(b: &mut test::Bencher) {
162
145
/// b.iter(|| {
163
146
/// println!("hello world");
0 commit comments