Skip to content
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

Rename `try!` macro for 2018 compatibility #1385

Closed
withoutboats opened this Issue Sep 12, 2018 · 6 comments

Comments

3 participants
@withoutboats
Copy link

withoutboats commented Sep 12, 2018

serde derive uses a custom defined try! macro internally, rather than ?. However, try is becoming a reserved word in the 2018 edition. For compatibility with 2018, it would be ideal if you renamed this macro.

@Mark-Simulacrum

This comment has been minimized.

Copy link

Mark-Simulacrum commented Sep 12, 2018

Hm, it's not clear to me that Serde should be responsible for making this change? That is, when/if Serde migrates to 2018 edition then it should but prior to that it was my understanding that edition hygiene should not require this -- am I wrong about that?

@withoutboats

This comment has been minimized.

Copy link
Author

withoutboats commented Sep 12, 2018

You're correct that users should not get edition related warnings from the expansion of external macros.

@Mark-Simulacrum

This comment has been minimized.

Copy link

Mark-Simulacrum commented Sep 12, 2018

I'm not quite sure what the intent of this issue is then since I can't seem to produce any warnings -- is this just a long-term cleanup?

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Sep 12, 2018

I'm not clear then. Is this something we need to prioritize before the edition? Or is this just tracking work that needs to happen at some point before we change our own edition to 2018, which may be years later?

@withoutboats

This comment has been minimized.

Copy link
Author

withoutboats commented Sep 12, 2018

According to the user report on internals, the compiler might not be successfully performing edition hygiene in all cases. Obviously, this is a bug in the compiler. But this seems like a small change to serde_derive that would help mitigate edition hygiene bugs and keep them from impacting the many users of this crate.

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Sep 13, 2018

Internals thread: Trying Rust2018, getting many warnings on `try` is a keyword

I am not able to reproduce the warnings reported there. If anyone succeeds in reproducing and can explain why this is something that a large number of users would encounter, then I can reconsider, but for now I am closing this issue. Thanks anyway! We'll take care of this when moving Serde to 2018 but don't need an issue to track this specific piece of that work.

Hopefully this helps track down the remaining places were edition hygiene is going wrong. I believe our use of try is within the space of what needs to be supported.

@dtolnay dtolnay closed this Sep 13, 2018

@dtolnay dtolnay added the wontfix label Nov 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.