Skip to content

Commit cdd9d0f

Browse files
committed
if let guard stabilize
1 parent a9ac706 commit cdd9d0f

File tree

145 files changed

+675
-719
lines changed

Some content is hidden

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

145 files changed

+675
-719
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
77
// tidy-alphabetical-start
88
#![cfg_attr(bootstrap, feature(array_windows))]
9+
#![cfg_attr(bootstrap, feature(if_let_guard))]
910
#![doc(test(attr(deny(warnings), allow(internal_features))))]
1011
#![feature(associated_type_defaults)]
1112
#![feature(box_patterns)]
12-
#![feature(if_let_guard)]
1313
#![feature(iter_order_by)]
1414
#![feature(macro_metavar_expr)]
1515
#![recursion_limit = "256"]

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
459459
}
460460
};
461461
}
462-
gate_all!(
463-
if_let_guard,
464-
"`if let` guards are experimental",
465-
"you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`"
466-
);
467462
gate_all!(
468463
async_trait_bounds,
469464
"`async` trait bounds are unstable",

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//! by `rustc_ast_lowering`.
44
55
// tidy-alphabetical-start
6+
#![cfg_attr(bootstrap, feature(if_let_guard))]
67
#![feature(box_patterns)]
7-
#![feature(if_let_guard)]
88
#![feature(iter_is_partitioned)]
99
// tidy-alphabetical-end
1010

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5+
#![cfg_attr(bootstrap, feature(if_let_guard))]
56
#![feature(assert_matches)]
67
#![feature(box_patterns)]
78
#![feature(file_buffered)]
8-
#![feature(if_let_guard)]
99
#![feature(negative_impls)]
1010
#![feature(never_type)]
1111
#![feature(rustc_attrs)]

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#![allow(internal_features)]
66
#![allow(rustc::diagnostic_outside_of_impl)]
77
#![allow(rustc::untranslatable_diagnostic)]
8+
#![cfg_attr(bootstrap, feature(if_let_guard))]
89
#![feature(assert_matches)]
910
#![feature(box_patterns)]
1011
#![feature(decl_macro)]
11-
#![feature(if_let_guard)]
1212
#![feature(iter_order_by)]
1313
#![feature(proc_macro_internals)]
1414
#![feature(proc_macro_quote)]

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
//! This API is completely unstable and subject to change.
66
77
// tidy-alphabetical-start
8+
#![cfg_attr(bootstrap, feature(if_let_guard))]
89
#![cfg_attr(bootstrap, feature(slice_as_array))]
910
#![feature(assert_matches)]
1011
#![feature(extern_types)]
1112
#![feature(file_buffered)]
12-
#![feature(if_let_guard)]
1313
#![feature(impl_trait_in_assoc_type)]
1414
#![feature(iter_intersperse)]
1515
#![feature(macro_derive)]

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// tidy-alphabetical-start
22
#![allow(rustc::diagnostic_outside_of_impl)]
33
#![allow(rustc::untranslatable_diagnostic)]
4+
#![cfg_attr(bootstrap, feature(if_let_guard))]
45
#![feature(assert_matches)]
56
#![feature(box_patterns)]
67
#![feature(file_buffered)]
7-
#![feature(if_let_guard)]
88
#![feature(negative_impls)]
99
#![feature(string_from_utf8_lossy_owned)]
1010
#![feature(trait_alias)]

compiler/rustc_const_eval/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// tidy-alphabetical-start
22
#![allow(rustc::diagnostic_outside_of_impl)]
3+
#![cfg_attr(bootstrap, feature(if_let_guard))]
34
#![feature(array_try_map)]
45
#![feature(assert_matches)]
56
#![feature(box_patterns)]
67
#![feature(decl_macro)]
7-
#![feature(if_let_guard)]
88
#![feature(never_type)]
99
#![feature(slice_ptr_get)]
1010
#![feature(trait_alias)]

compiler/rustc_expand/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![allow(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
44
#![cfg_attr(bootstrap, feature(array_windows))]
5+
#![cfg_attr(bootstrap, feature(if_let_guard))]
56
#![feature(associated_type_defaults)]
6-
#![feature(if_let_guard)]
77
#![feature(macro_metavar_expr)]
88
#![feature(proc_macro_diagnostic)]
99
#![feature(proc_macro_internals)]

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ declare_features! (
243243
(accepted, i128_type, "1.26.0", Some(35118)),
244244
/// Allows the use of `if let` expressions.
245245
(accepted, if_let, "1.0.0", None),
246+
/// Allows `if let` guard in match arms.
247+
(accepted, if_let_guard, "CURRENT_RUSTC_VERSION", Some(51114)),
246248
/// Rescoping temporaries in `if let` to align with Rust 2024.
247249
(accepted, if_let_rescope, "1.84.0", Some(124085)),
248250
/// Allows top level or-patterns (`p | q`) in `if let` and `while let`.

0 commit comments

Comments
 (0)