Closed taiki-e closed 4 years ago
Hm, this title is hard to understand. Maybe "Preserve the span of self argument" properly expresses what this PR does...
The reason this issue doesn't occur with arguments other than self is that the span between defining and using the self argument is different.
For example, if we replace the span of other arguments with call-site, we can reproduce the same error with other arguments.
if let Pat::Ident(PatIdent { ident, .. }) = &*arg.pat {
+ let ident = Ident::new(&ident.to_string(), Span::call_site());
quote!(#ident)
} else {
error[E0425]: cannot find value `x` in this scope
--> tests/test.rs:576:13
|
576 | #[async_trait]
| ^^^^^^^^^^^^^^ not found in this scope
...
585 | implement_commands! { K: Send }
| ------------------------------- in this macro invocation
|
(in any case, the issue itself is definitely a compiler bug.)
Fixes #46 Fixes #104