Skip to content

Commit

Permalink
Auto merge of #129604 - dingxiangfei2009:lint-tail-expr-drop-order-cr…
Browse files Browse the repository at this point in the history
…ater-run, r=<try>

[DO NOT MERGE] crater run on the tail expression drop order lint

This PR is intended for a crater run *for the lint tail-expr-drop-order*.

This need another patch on `src/tools/cargo` which is still in progress.
  • Loading branch information
bors committed Aug 27, 2024
2 parents ab869e0 + e694863 commit 4d98531
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler/rustc_lint/src/tail_expr_drop_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ impl<'tcx> LateLintPass<'tcx> for TailExprDropOrder {
_: Span,
def_id: rustc_span::def_id::LocalDefId,
) {
if cx.tcx.sess.at_least_rust_2024() && cx.tcx.features().shorter_tail_lifetimes {
Self::check_fn_or_closure(cx, fn_kind, body, def_id);
}
Self::check_fn_or_closure(cx, fn_kind, body, def_id);
}
}

Expand Down Expand Up @@ -185,10 +183,6 @@ impl<'tcx, 'a> Visitor<'tcx> for LintVisitor<'tcx, 'a> {

impl<'tcx, 'a> LintVisitor<'tcx, 'a> {
fn check_block_inner(&mut self, block: &Block<'tcx>) {
if !block.span.at_least_rust_2024() {
// We only lint for Edition 2024 onwards
return;
}
let Some(tail_expr) = block.expr else { return };
for stmt in block.stmts {
match stmt.kind {
Expand Down

0 comments on commit 4d98531

Please sign in to comment.