-
Notifications
You must be signed in to change notification settings - Fork 19
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
Future incompatibility with Rust RFC 3373: Avoid non-local definitions in functions #46
Comments
The RFC impl is merged in the latest nightly. |
Don't name the output of the const block in which traits are implemented. This doesn't play well with Rust RFC 3373, and isn't necessary for correctness. Fixes yaahc#46
Does that patch actually work? My understanding is that displaydoc does this scoping so that it can have some local types and impls |
Yes, it should work. We do (in |
But it seems like that just hoists all the definitions to the outer scope? So they'll clash with each other? |
This should work: #49 |
An anonymous |
@kpreid hmm, in that case the error message for this future incompat lint seems incorrect? |
Rust RFC 3373: Avoid non-local definitions in functions was accepted and it's implementation at rust-lang/rust#120393 found that this crate would be affected by it.
To be more precise users of this crate would be affected by it, in the form of a warn-by-default lint:
non_local_definitions
. This is because the derive macros from this crate useimpl
in a local context,const _DERIVE_Display_FOR_???
:displaydoc/src/expand.rs
Lines 22 to 25 in f0b62a5
Fortunately a simple fix exist for this crate, by using a const-anon instead of named one:
I would suggest applying some form of the patch above as well as releasing a patch version of this crate, as to have a fix available for users as soon as possible.
cc @yaahc
The text was updated successfully, but these errors were encountered: