-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve the span of self argument #105
Conversation
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. Lines 263 to 265 in 5220bbd
if let Pat::Ident(PatIdent { ident, .. }) = &*arg.pat {
+ let ident = Ident::new(&ident.to_string(), Span::call_site());
quote!(#ident)
} else {
(in any case, the issue itself is definitely a compiler bug.) |
250: Preserve the span of self argument r=taiki-e a=taiki-e Refs: dtolnay/async-trait#105 `#[pinned_drop]` attribute also has same issue. Co-authored-by: Taiki Endo <[email protected]>
250: Preserve the span of self argument r=taiki-e a=taiki-e Refs: dtolnay/async-trait#105 `#[pinned_drop]` attribute also has same issue. Co-authored-by: Taiki Endo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I didn't know this could be something we can fix.
Fixes #46
Fixes #104