Skip to content

tail_expr_drop_order lint adds too much noise to rustfix #132323

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

Closed
oriongonza opened this issue Oct 29, 2024 · 5 comments
Closed

tail_expr_drop_order lint adds too much noise to rustfix #132323

oriongonza opened this issue Oct 29, 2024 · 5 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-edition-2024 Area: The 2024 edition F-shorter_tail_lifetimes `#![feature(shorter_tail_lifetimes)]`

Comments

@oriongonza
Copy link
Contributor

oriongonza commented Oct 29, 2024

Lots of local bindings have a significant drop implementation, and the warning is not particularly small.
This completely hides every single other warning. Adding this much noise makes it near impossible to notice any potentially meaningful changes.

cc: #128662

@rustbot label +A-diagnostics +A-edition-2024

@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-diagnostics Area: Messages for errors, warnings, and lints A-edition-2024 Area: The 2024 edition labels Oct 29, 2024
@traviscross traviscross added F-shorter_tail_lifetimes `#![feature(shorter_tail_lifetimes)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 29, 2024
@traviscross
Copy link
Contributor

@dev-ardi: Perhaps it would help if you could give some examples you've experienced here.

Also, keep in mind that these lints are mostly mean to be applied automatically with cargo fix --edition. Perhaps you could tell us about what you're doing here that's causing you to experience the lint in this way.

cc @dingxiangfei2009

@oriongonza
Copy link
Contributor Author

When running cargo fix --edition on any large repository the stdout gets filled with that.
I tried on my own closed source repo but in any other happens too. Try https://github.com/mozilla/uniffi-rs for example. It's the only warning that gets emited, I think (but I don't know)
Small ones like https://github.com/BurntSushi/ripgrep also have a few but not so many

Also I've noticed that the warning also gets emited randomly without cargo fix --edition too...?<

warning: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021
   --> redacted.rs:885:44
    |
885 |                     .and_then(|attr| match attr.parse_args::<ViaIntermediary>() {
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2024
    = note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
    = note: `--force-warn tail-expr-drop-order` implied by `--force-warn rust-2024-compatibility`
~``

@dingxiangfei2009
Copy link
Contributor

@rustbot claim

@dingxiangfei2009
Copy link
Contributor

dingxiangfei2009 commented Oct 31, 2024

There is hope that #131326 cuts down a lot of the noise here, taking uniffi-rs as one example. It is still under scrutiny.

@traviscross
Copy link
Contributor

We believe this is addressed by #131326, as it significantly cut down the noise.

There's still of course some residual noise here. If you see common patterns to this noise that we might be able to use to further improve the heuristic, please of course file new issues for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-edition-2024 Area: The 2024 edition F-shorter_tail_lifetimes `#![feature(shorter_tail_lifetimes)]`
Projects
None yet
Development

No branches or pull requests

4 participants