1
Fork 0

Rollup merge of #136787 - compiler-errors:lt2024feat, r=oli-obk

Remove `lifetime_capture_rules_2024` feature

Just use edition 2024 instead
This commit is contained in:
Matthias Krüger 2025-02-22 01:01:40 +01:00 committed by GitHub
commit 085adfda3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 35 additions and 78 deletions

View file

@ -86,8 +86,7 @@ declare_lint! {
///
/// ### Example
///
/// ```rust,compile_fail
/// # #![feature(lifetime_capture_rules_2024)]
/// ```rust,edition2024,compile_fail
/// # #![deny(impl_trait_redundant_captures)]
/// fn test<'a>(x: &'a i32) -> impl Sized + use<'a> { x }
/// ```
@ -268,8 +267,7 @@ where
&& parent == self.parent_def_id
{
let opaque_span = self.tcx.def_span(opaque_def_id);
let new_capture_rules = opaque_span.at_least_rust_2024()
|| self.tcx.features().lifetime_capture_rules_2024();
let new_capture_rules = opaque_span.at_least_rust_2024();
if !new_capture_rules
&& !opaque.bounds.iter().any(|bound| matches!(bound, hir::GenericBound::Use(..)))
{