File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " async-trait"
3
- version = " 0.1.4 "
3
+ version = " 0.1.5 "
4
4
authors = [" David Tolnay <dtolnay@gmail.com>" ]
5
5
edition = " 2018"
6
6
license = " MIT OR Apache-2.0"
@@ -16,3 +16,10 @@ proc-macro = true
16
16
proc-macro2 = " 0.4"
17
17
quote = " 0.6"
18
18
syn = { version = " 0.15.41" , features = [" full" , " visit-mut" ] }
19
+
20
+ [features ]
21
+ # Alternative implementation that produces worse error messages but potentially
22
+ # works on old nightlies without https://github.com/rust-lang/rust/pull/61775 in
23
+ # some cases where the default implementation does not. This feature is semver
24
+ # exempt and might get removed without notice in any patch version.
25
+ support_old_nightly = []
Original file line number Diff line number Diff line change @@ -225,6 +225,15 @@ fn transform_block(
225
225
has_self : bool ,
226
226
is_local : bool ,
227
227
) {
228
+ if cfg ! ( feature = "support_old_nightly" ) {
229
+ let brace = block. brace_token ;
230
+ * block = parse_quote ! ( {
231
+ core:: pin:: Pin :: from( Box :: new( async move #block) )
232
+ } ) ;
233
+ block. brace_token = brace;
234
+ return ;
235
+ }
236
+
228
237
let inner = Ident :: new ( & format ! ( "__{}" , sig. ident) , sig. ident . span ( ) ) ;
229
238
let args = sig
230
239
. decl
You can’t perform that action at this time.
0 commit comments