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

Reduce false positives of tail-expr-drop-order from consumed values #129864

Prev Previous commit
Next Next commit
revert gate test to work only when migration is triggered
  • Loading branch information
dingxiangfei2009 committed Sep 23, 2024
commit acad84c2ade3668ce3c1af75e23699b40a01c202
14 changes: 6 additions & 8 deletions tests/ui/drop/lint-tail-expr-drop-order-gated.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// This test ensures that `tail_expr_drop_order` does not activate in case Edition 2024 is not used
// or the feature gate `shorter_tail_lifetimes` is disabled.
// This test ensures that `tail_expr_drop_order` does not activate in case Edition 2024 is used
// because this is a migration lint.
// Only `cargo fix --edition 2024` shall activate this lint.

//@ revisions: neither no_feature_gate edition_less_than_2024
//@ revisions: neither no_feature_gate edition_at_least_2024
//@ check-pass
//@ [neither] edition: 2021
//@ [no_feature_gate] compile-flags: -Z unstable-options
//@ [no_feature_gate] edition: 2024
//@ [edition_less_than_2024] edition: 2021
//@ compile-flags: -Z unstable-options
//@ edition: 2024

#![deny(tail_expr_drop_order)]
#![cfg_attr(edition_less_than_2024, feature(shorter_tail_lifetimes))]

struct LoudDropper;
impl Drop for LoudDropper {
Expand Down