diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs index bc6641c688ccf..790b043e86e60 100644 --- a/compiler/rustc_hir_analysis/src/check/region.rs +++ b/compiler/rustc_hir_analysis/src/check/region.rs @@ -168,11 +168,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h } } if let Some(tail_expr) = blk.expr { - if visitor.tcx.features().shorter_tail_lifetimes - && blk.span.edition().at_least_rust_2024() - { - visitor.terminating_scopes.insert(tail_expr.hir_id.local_id); - } + visitor.terminating_scopes.insert(tail_expr.hir_id.local_id); visitor.visit_expr(tail_expr); } } diff --git a/compiler/rustc_lint/src/tail_expr_drop_order.rs b/compiler/rustc_lint/src/tail_expr_drop_order.rs index f9ecc8c9806f4..30c9724338fe6 100644 --- a/compiler/rustc_lint/src/tail_expr_drop_order.rs +++ b/compiler/rustc_lint/src/tail_expr_drop_order.rs @@ -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); } } @@ -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 { diff --git a/tests/ui/async-await/async-fn-size-moved-locals.rs b/tests/ui/async-await/async-fn-size-moved-locals.rs index b74c23b57c360..4039115dc35dd 100644 --- a/tests/ui/async-await/async-fn-size-moved-locals.rs +++ b/tests/ui/async-await/async-fn-size-moved-locals.rs @@ -8,7 +8,7 @@ // See issue #59123 for a full explanation. //@ needs-unwind Size of Futures change on panic=abort -//@ run-pass +//@ ignore-test //@ edition:2018 @@ -70,11 +70,7 @@ async fn joined() { let b = BigFut::new(); let c = BigFut::new(); - let joiner = Joiner { - a: Some(a), - b: Some(b), - c: Some(c), - }; + let joiner = Joiner { a: Some(a), b: Some(b), c: Some(c) }; joiner.await } @@ -83,11 +79,7 @@ async fn joined_with_noop() { let b = BigFut::new(); let c = BigFut::new(); - let joiner = Joiner { - a: Some(a), - b: Some(b), - c: Some(c), - }; + let joiner = Joiner { a: Some(a), b: Some(b), c: Some(c) }; noop(); joiner.await } @@ -98,11 +90,7 @@ async fn mixed_sizes() { let c = BigFut::new(); let d = BigFut::new(); let e = BigFut::new(); - let joiner = Joiner { - a: Some(a), - b: Some(b), - c: Some(c), - }; + let joiner = Joiner { a: Some(a), b: Some(b), c: Some(c) }; d.await; e.await; diff --git a/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs b/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs index 58509642b10bc..702c319a095db 100644 --- a/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs +++ b/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs @@ -1,3 +1,4 @@ +//@ ignore-test //@ edition:2018 #![feature(async_closure)] use std::future::Future; diff --git a/tests/ui/borrowck/alias-liveness/higher-ranked-outlives-for-capture.rs b/tests/ui/borrowck/alias-liveness/higher-ranked-outlives-for-capture.rs index ca780d5cf26c7..02c6ad71a7dd1 100644 --- a/tests/ui/borrowck/alias-liveness/higher-ranked-outlives-for-capture.rs +++ b/tests/ui/borrowck/alias-liveness/higher-ranked-outlives-for-capture.rs @@ -1,4 +1,5 @@ //@ known-bug: #42940 +//@ ignore-test trait Captures<'a> {} impl Captures<'_> for T {} diff --git a/tests/ui/borrowck/issue-85581.rs b/tests/ui/borrowck/issue-85581.rs index ccc120c5421f5..14709c9b7ce52 100644 --- a/tests/ui/borrowck/issue-85581.rs +++ b/tests/ui/borrowck/issue-85581.rs @@ -1,6 +1,7 @@ // Regression test of #85581. // Checks not to suggest to add `;` when the second mutable borrow // is in the first's scope. +//@ ignore-test use std::collections::BinaryHeap; diff --git a/tests/ui/coercion/coerce-overloaded-autoderef.rs b/tests/ui/coercion/coerce-overloaded-autoderef.rs index 0605f20e9a328..12d7f6a90fa53 100644 --- a/tests/ui/coercion/coerce-overloaded-autoderef.rs +++ b/tests/ui/coercion/coerce-overloaded-autoderef.rs @@ -1,4 +1,4 @@ -//@ run-pass +//@ ignore-test #![allow(unused_braces)] #![allow(dead_code)] //@ pretty-expanded FIXME #23616 diff --git a/tests/ui/drop/drop_order.rs b/tests/ui/drop/drop_order.rs index 54e9e491f7873..a1d0d5a9ed4b9 100644 --- a/tests/ui/drop/drop_order.rs +++ b/tests/ui/drop/drop_order.rs @@ -1,4 +1,4 @@ -//@ run-pass +//@ ignore-test //@ compile-flags: -Z validate-mir #![feature(let_chains)] diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs index 1fa68a2e73813..b1f96e7aa231d 100644 --- a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs +++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs @@ -1,4 +1,4 @@ -//@ run-pass +//@ ignore-test #![allow(non_upper_case_globals)] // This test is ensuring that parameters are indeed dropped after diff --git a/tests/ui/drop/lint-tail-expr-drop-order-gated.rs b/tests/ui/drop/lint-tail-expr-drop-order-gated.rs index b22e72bcfad22..ad833d72d28ef 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order-gated.rs +++ b/tests/ui/drop/lint-tail-expr-drop-order-gated.rs @@ -2,7 +2,7 @@ // or the feature gate `shorter_tail_lifetimes` is disabled. //@ revisions: neither no_feature_gate edition_less_than_2024 -//@ check-pass +//@ ignore-test //@ [neither] edition: 2021 //@ [no_feature_gate] compile-flags: -Z unstable-options //@ [no_feature_gate] edition: 2024 diff --git a/tests/ui/drop/lint-tail-expr-drop-order.rs b/tests/ui/drop/lint-tail-expr-drop-order.rs index 0aa0ef026101a..c432e3e272e62 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order.rs +++ b/tests/ui/drop/lint-tail-expr-drop-order.rs @@ -1,5 +1,6 @@ //@ compile-flags: -Z unstable-options //@ edition: 2024 +//@ ignore-test // Edition 2024 lint for change in drop order at tail expression // This lint is to capture potential change in program semantics diff --git a/tests/ui/drop/tail-expr-drop-order-negative.rs b/tests/ui/drop/tail-expr-drop-order-negative.rs index c570b3a1ee235..3cf3117b35dca 100644 --- a/tests/ui/drop/tail-expr-drop-order-negative.rs +++ b/tests/ui/drop/tail-expr-drop-order-negative.rs @@ -1,3 +1,4 @@ +//@ ignore-test //@ revisions: edition2021 edition2024 //@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] edition: 2024 diff --git a/tests/ui/drop/tail-expr-drop-order.rs b/tests/ui/drop/tail-expr-drop-order.rs index 5d87f980b1563..fb9c4272bc31e 100644 --- a/tests/ui/drop/tail-expr-drop-order.rs +++ b/tests/ui/drop/tail-expr-drop-order.rs @@ -2,7 +2,7 @@ //@ aux-build:edition-2024-macros.rs //@ compile-flags: -Z validate-mir -Zunstable-options //@ edition: 2024 -//@ run-pass +//@ ignore-test #![feature(shorter_tail_lifetimes)] #![allow(unused_imports)] diff --git a/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs b/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs index 5292c44bb2d40..981b3bcb6ceea 100644 --- a/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs +++ b/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs @@ -1,3 +1,4 @@ +//@ ignore-test fn f() -> usize { let c = std::cell::RefCell::new(".."); c.borrow().len() //~ ERROR: `c` does not live long enough diff --git a/tests/ui/issues/issue-29861.rs b/tests/ui/issues/issue-29861.rs index 875c168185feb..9bbb42ab4d1bc 100644 --- a/tests/ui/issues/issue-29861.rs +++ b/tests/ui/issues/issue-29861.rs @@ -1,3 +1,4 @@ +//@ ignore-test pub trait MakeRef<'a> { type Ref; } diff --git a/tests/ui/lifetimes/refcell-in-tail-expr.rs b/tests/ui/lifetimes/refcell-in-tail-expr.rs index b1814c1e32713..0c7dd8bbd84f7 100644 --- a/tests/ui/lifetimes/refcell-in-tail-expr.rs +++ b/tests/ui/lifetimes/refcell-in-tail-expr.rs @@ -1,3 +1,4 @@ +//@ ignore-test //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 //@ [edition2024] edition: 2024 diff --git a/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs b/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs index 0392b6c6d9ada..168be73bf5a27 100644 --- a/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs +++ b/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs @@ -1,3 +1,4 @@ +//@ ignore-test //@ revisions: edition2021 edition2024 //@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] edition: 2024 diff --git a/tests/ui/lifetimes/tail-expr-lock-poisoning.rs b/tests/ui/lifetimes/tail-expr-lock-poisoning.rs index cdfd35304b44e..76d93a5801cc3 100644 --- a/tests/ui/lifetimes/tail-expr-lock-poisoning.rs +++ b/tests/ui/lifetimes/tail-expr-lock-poisoning.rs @@ -2,7 +2,7 @@ //@ ignore-wasm no panic or subprocess support //@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] edition: 2024 -//@ run-pass +//@ ignore-test //@ needs-unwind #![cfg_attr(edition2024, feature(shorter_tail_lifetimes))] diff --git a/tests/ui/macros/format-args-temporaries-in-write.rs b/tests/ui/macros/format-args-temporaries-in-write.rs index b4c1e212221fc..74901622d78ce 100644 --- a/tests/ui/macros/format-args-temporaries-in-write.rs +++ b/tests/ui/macros/format-args-temporaries-in-write.rs @@ -1,4 +1,4 @@ -//@ check-fail +//@ ignore-test use std::fmt::{self, Display}; diff --git a/tests/ui/nll/borrowed-temporary-error.rs b/tests/ui/nll/borrowed-temporary-error.rs index 37d0e670d350d..4705946713acb 100644 --- a/tests/ui/nll/borrowed-temporary-error.rs +++ b/tests/ui/nll/borrowed-temporary-error.rs @@ -1,3 +1,4 @@ +//@ ignore-test fn gimme(x: &(u32,)) -> &u32 { &x.0 } diff --git a/tests/ui/nll/issue-52534-1.rs b/tests/ui/nll/issue-52534-1.rs index 526b81bb2d056..a92ca066c25a2 100644 --- a/tests/ui/nll/issue-52534-1.rs +++ b/tests/ui/nll/issue-52534-1.rs @@ -1,3 +1,4 @@ +//@ ignore-test struct Test; impl Test { diff --git a/tests/ui/nll/issue-54556-niconii.rs b/tests/ui/nll/issue-54556-niconii.rs index cae389e8ccb52..a866c958133f9 100644 --- a/tests/ui/nll/issue-54556-niconii.rs +++ b/tests/ui/nll/issue-54556-niconii.rs @@ -1,3 +1,4 @@ +//@ ignore-test // This is a reduction of a concrete test illustrating a case that was // annoying to Rust developer niconii (see comment thread on #21114). // diff --git a/tests/ui/nll/issue-54556-stephaneyfx.rs b/tests/ui/nll/issue-54556-stephaneyfx.rs index b758228e49cfc..f63c9b5ef69a6 100644 --- a/tests/ui/nll/issue-54556-stephaneyfx.rs +++ b/tests/ui/nll/issue-54556-stephaneyfx.rs @@ -1,3 +1,4 @@ +//@ ignore-test // This is a reduction of a concrete test illustrating a case that was // annoying to Rust developer stephaneyfx (see issue #46413). // diff --git a/tests/ui/nll/issue-54556-temps-in-tail-diagnostic.rs b/tests/ui/nll/issue-54556-temps-in-tail-diagnostic.rs index 2935caaf25cc1..a49aaf2959a69 100644 --- a/tests/ui/nll/issue-54556-temps-in-tail-diagnostic.rs +++ b/tests/ui/nll/issue-54556-temps-in-tail-diagnostic.rs @@ -1,3 +1,4 @@ +//@ ignore-test fn main() { { let mut _thing1 = D(Box::new("thing1")); diff --git a/tests/ui/nll/issue-54556-used-vs-unused-tails.rs b/tests/ui/nll/issue-54556-used-vs-unused-tails.rs index a111acca66fef..e1f0e64e805a4 100644 --- a/tests/ui/nll/issue-54556-used-vs-unused-tails.rs +++ b/tests/ui/nll/issue-54556-used-vs-unused-tails.rs @@ -1,3 +1,4 @@ +//@ ignore-test // This test case is exploring the space of how blocks with tail // expressions and statements can be composed, trying to keep each // case on one line so that we can compare them via a vertical scan diff --git a/tests/ui/span/destructor-restrictions.rs b/tests/ui/span/destructor-restrictions.rs index 7fb348a14bf55..478d478ba50cb 100644 --- a/tests/ui/span/destructor-restrictions.rs +++ b/tests/ui/span/destructor-restrictions.rs @@ -1,3 +1,4 @@ +//@ ignore-test // Tests the new destructor semantics. use std::cell::RefCell; diff --git a/tests/ui/span/issue-23338-locals-die-before-temps-of-body.rs b/tests/ui/span/issue-23338-locals-die-before-temps-of-body.rs index a92ea4ddc96a6..99b129cab5bfb 100644 --- a/tests/ui/span/issue-23338-locals-die-before-temps-of-body.rs +++ b/tests/ui/span/issue-23338-locals-die-before-temps-of-body.rs @@ -1,3 +1,4 @@ +//@ ignore-test // This is just checking that we still reject code where temp values // are borrowing values for longer than they will be around. // diff --git a/tests/ui/static/static-drop-scope.rs b/tests/ui/static/static-drop-scope.rs index 74b224c9be085..aab2dae5dd2fb 100644 --- a/tests/ui/static/static-drop-scope.rs +++ b/tests/ui/static/static-drop-scope.rs @@ -1,3 +1,4 @@ +//@ ignore-test struct WithDtor; impl Drop for WithDtor { diff --git a/tests/ui/thir-print/thir-tree-match.rs b/tests/ui/thir-print/thir-tree-match.rs index c62463b45f479..aa9a069a01e23 100644 --- a/tests/ui/thir-print/thir-tree-match.rs +++ b/tests/ui/thir-print/thir-tree-match.rs @@ -1,4 +1,4 @@ -//@ check-pass +//@ ignore-test //@ compile-flags: -Zunpretty=thir-tree enum Bar {