Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bc4e26b

Browse files
committedOct 12, 2024
Auto merge of rust-lang#131326 - dingxiangfei2009:issue-130836-attempt-2, r=<try>
Reduce false positives of tail-expr-drop-order from consumed values (attempt #2) r? `@nikomatsakis` Tracked by rust-lang#123739. Related to rust-lang#129864 but not replacing, yet. Related to rust-lang#130836. This is an implementation of the approach suggested in the [Zulip stream](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/temporary.20drop.20order.20changes). A new MIR statement `BackwardsIncompatibleDrop` is added to the MIR syntax. The lint now works by inspecting possibly live move paths before at the `BackwardsIncompatibleDrop` location and the actual drop under the current edition, which should be one before Edition 2024 in practice.
2 parents e200c7f + b0437bb commit bc4e26b

File tree

60 files changed

+1188
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1188
-533
lines changed
 

‎compiler/rustc_lint/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,6 @@ lint_suspicious_double_ref_clone =
773773
lint_suspicious_double_ref_deref =
774774
using `.deref()` on a double reference, which returns `{$ty}` instead of dereferencing the inner type
775775
776-
lint_tail_expr_drop_order = these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021
777-
.label = these values have significant drop implementation and will observe changes in drop order under Edition 2024
778-
779776
lint_trailing_semi_macro = trailing semicolon in macro used in expression position
780777
.note1 = macro invocations at the end of a block are treated as expressions
781778
.note2 = to ignore the value produced by the macro, add a semicolon after the invocation of `{$name}`

‎compiler/rustc_lint/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ mod redundant_semicolon;
8181
mod reference_casting;
8282
mod shadowed_into_iter;
8383
mod static_mut_refs;
84-
mod tail_expr_drop_order;
8584
mod traits;
8685
mod types;
8786
mod unit_bindings;
@@ -122,7 +121,6 @@ use rustc_middle::ty::TyCtxt;
122121
use shadowed_into_iter::ShadowedIntoIter;
123122
pub use shadowed_into_iter::{ARRAY_INTO_ITER, BOXED_SLICE_INTO_ITER};
124123
use static_mut_refs::*;
125-
use tail_expr_drop_order::TailExprDropOrder;
126124
use traits::*;
127125
use types::*;
128126
use unit_bindings::*;
@@ -247,7 +245,6 @@ late_lint_methods!(
247245
AsyncFnInTrait: AsyncFnInTrait,
248246
NonLocalDefinitions: NonLocalDefinitions::default(),
249247
ImplTraitOvercaptures: ImplTraitOvercaptures,
250-
TailExprDropOrder: TailExprDropOrder,
251248
IfLetRescope: IfLetRescope::default(),
252249
StaticMutRefs: StaticMutRefs,
253250
UnqualifiedLocalImports: UnqualifiedLocalImports,
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.