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
cargo fmt makes correct code incorrect when using pub with auto #2880
Comments
I’d like to tackle this. |
@isaacazuelos great, thanks! The best way to start is to look at items.rs. There you'll find functions for reformatting module-level items, including traits. If you look at how the 'signature' of a trait is formatted you should be able to see where the |
Let me know if anything is unclear |
I'm not able to reproduce the issue. It looks like this is already tested too. I think this issue would happen at about items.rs:990. Is it possible the issue is coming from an older version of |
Ah, that looks likely. Thanks for investigating @isaacazuelos If you want another issue to look into, #2848 might be good if it still reproduces. If you're interested in performance, then I'm sure there are lots of possible optimisation wins possible and that would be awesome! |
I confirmed by running |
This bug can be seen when formatting the dimensioned crate. Here is a screenshot:
It looks like all it's doing to break the code is swapping the order of auto and pub. I have no knowledge of what auto does, as this isn't my code. But clearly formatting the code should not make it fail to compile.
The text was updated successfully, but these errors were encountered: