diff options
| author | Michael Goulet <michael@errs.io> | 2024-12-19 04:13:28 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-12-23 20:25:41 +0000 |
| commit | b893221517243d942ab503793f885dcefbfa4f45 (patch) | |
| tree | c0367e4cd28caed37e1fac6a73d740a0ff561db3 /compiler/rustc_mir_transform/src/lib.rs | |
| parent | addbd001ec56741829f20a3000892f8620dd0843 (diff) | |
| download | rust-b893221517243d942ab503793f885dcefbfa4f45.tar.gz rust-b893221517243d942ab503793f885dcefbfa4f45.zip | |
Always run tail_expr_drop_order lint on promoted MIR
Diffstat (limited to 'compiler/rustc_mir_transform/src/lib.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 5c090bf7cad..e1fba9be5bb 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -437,6 +437,8 @@ fn mir_promoted( Some(MirPhase::Analysis(AnalysisPhase::Initial)), ); + lint_tail_expr_drop_order::run_lint(tcx, def, &body); + let promoted = promote_pass.promoted_fragments.into_inner(); (tcx.alloc_steal_mir(body), tcx.alloc_steal_promoted(promoted)) } @@ -492,7 +494,6 @@ fn mir_drops_elaborated_and_const_checked(tcx: TyCtxt<'_>, def: LocalDefId) -> & } let (body, _) = tcx.mir_promoted(def); - lint_tail_expr_drop_order::run_lint(tcx, def, &body.borrow()); let mut body = body.steal(); if let Some(error_reported) = tainted_by_errors { |
