-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add more context to async fn
trait error. Suggest async-trait
.
#65937
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @zackmdavis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
8b8f010
to
c4cfda9
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
c4cfda9
to
99c18c4
Compare
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.
@jafern14 for future reference, the style of messages in the output is to not have leading capitalization nor a closing period, except for exceptionally long text. The change itself looks fine, I have some comments about the wording. Finally, I'd like the information from @nikomatsakis' blogpost to be linked, but have qualms about linking to a domain not maintained by the whole team. Mainly concerned about it not looking official enough, link-rot and bus-factor.
.note("Due to technical restrictions rust does not currently support `async` \ | ||
trait fns.") | ||
.note("Consider using the `async-trait` crate in the meantime until further \ | ||
notice.") |
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.
.help("consider using the `async-trait` crate")
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.
👍 I need to dig into the struct_span_err
macro a bit more to figure out what else can be used with it.
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.
"trait fns cannot be declared `async`").emit() | ||
"trait fns cannot be declared `async`") | ||
.note("Due to technical restrictions rust does not currently support `async` \ | ||
trait fns.") |
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.
.note("due to technical restrictions Rust does not currently support `async` \
trait functions")
@nikomatsakis @rust-lang/docs how would we feel about adding a link to https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/ here? Alternatively, @nikomatsakis, would you feel up to adding that blogpost (or a summarized version of it) to the book or some other stable documentation location?
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.
I think we should publish it on the inside Rust blog, perhaps, though I'm not sure if it's quite a "perfect fit." I don't think we should link to random-ish (obviously in this case it's Niko, but the point stands, I think) blogs from inside the compiler. We might also be able to uplift the content into a extended diagnostic perhaps?
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.
Extending the error code description sounds like the best course of action.
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.
Rather than link to blog posts, we could link to the async await book - https://rust-lang.github.io/async-book/07_workarounds/06_async_in_traits.html
(I'd be more than happy for the async book to be referencing useful blog posts)
@estebank Thanks for the feedback. I was looking around at other logging output to see what standards were. Appreciate you outlining that for me. As soon as we figure out if we want to put a summary into the docs or not I can push up the changes outlined above. FWIW I totally agree that putting in a non-rust owned link into the logging output and/or docs would look a little off. If we want to put a summary into the book then I can take a crack at it however I'm no Rust pro so it'd probably require revising/editing from others. I'm totally open to go at it though since it'd be a good challenge for me to learn something new in more depth. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I'm patching up these expected results with the finalized output I have locally and will include them in the next commit. |
Ping from Triage: Any updates @jafern14? |
Pinging again from Triage: Thank you! |
Pinging again from Triage: cc: @estebank @zackmdavis Thanks for contributing! |
Any link to further info is better than nothing. I’d really like to see
this PR land as it will help improve ‘compiler driven development’.
…On Sat, 16 Nov 2019 at 06:38, John Simon ***@***.***> wrote:
Closed #65937 <#65937>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#65937?email_source=notifications&email_token=AAGEJCBDRE2YPPPL2M5XVJDQT6IOFA5CNFSM4JGLFNCKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOU4VIJVA#event-2804581588>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEJCGPB6K6CFFXGRVR6ULQT6IOFANCNFSM4JGLFNCA>
.
|
…, r=Centril Add more context to `async fn` trait error Follow up to rust-lang#65937. Fix rust-lang#65899.
Addresses #65899
I decided to keep the information a bit more generic and not provide a link to the technical blog post following @estebank suggestion.
I can put the link to the blog post if you feel like it's worth it. I definitely learned quite a bit from it and it forced me to dig a bit further into other concepts that I wasn't entirely familiar with either.
The error output now looks like this for example: