-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
missing_debug_implementations does not lint on pin projected type #52
Comments
Thanks for the report. I think this is due to the Line 1439 in 77b2552
This should be able to fix by adding a step to separate visibility for parsing and visibility for code-generation. FYI: I recently found the opposite behavior on pin-project and reported it to rustc as a bug. This comment on that issue explains why these problems occurs. |
I tried to fix this (4102899), but missing_debug_implementations uses the span of the whole struct (to be precise: the span of start and end), so to fix this problem we need to preserve the span of visibility and brace. This seems to be very difficult because there is no token type that can match a brace in declarative macros.
If you want to fix this problem, I think you will need to change the span used by missing_debug_implementations on the rustc side. |
Well that's a shame :(. I don't see an easy way around it. We could investigate the possibility of adding a small proc-macro dependency that doesn't use |
Well, I have one such crate, and am working on such a thing for another crate as well, so it is probably possible to look into it.
Do you mean current
Yes.
Btw, this is a clean build, right? Since the dependencies are only compiled the first time, I personally don't really understand why people who dislike proc-macro deps are always so concerned about the initial cost. (Also, even if we don't depend on proc-macro in the main build, we should often depend on it during development for testing and so on.) |
FWIW, if you just want to check if debug is implemented, it might be easier to create a codegen that generates something like assert_debug based on the codegen used in my project. (If you don't dislike writing proc-macro.) |
Closing (blocked-closed) -- It's impossible to fix this on the pin-project-lite side at this time. We can reopen the issue again once someone starts a discussion in rust-lang/rust about the span of missing_debug_implementations and the changes have been applied |
The following code compiles without warning or error:
Would there be any way to prevent it from compiling? I have many futures and I would like to implement
Debug
on them, but currently I have to go through and check them all manually.The text was updated successfully, but these errors were encountered: