Skip to content

Commit 5796073

Browse files
committed
if let guard stabilize
1 parent f8e9e76 commit 5796073

File tree

137 files changed

+565
-621
lines changed

Some content is hidden

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

137 files changed

+565
-621
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(if_let_guard))]
910
#![doc(
1011
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1112
test(attr(deny(warnings)))
@@ -14,7 +15,6 @@
1415
#![feature(array_windows)]
1516
#![feature(associated_type_defaults)]
1617
#![feature(box_patterns)]
17-
#![feature(if_let_guard)]
1818
#![feature(macro_metavar_expr)]
1919
#![feature(negative_impls)]
2020
#![feature(never_type)]

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
3333
// tidy-alphabetical-start
3434
#![allow(internal_features)]
35+
#![cfg_attr(bootstrap, feature(if_let_guard))]
3536
#![doc(rust_logo)]
3637
#![feature(assert_matches)]
3738
#![feature(box_patterns)]
3839
#![feature(exact_size_is_empty)]
39-
#![feature(if_let_guard)]
4040
#![feature(rustdoc_internals)]
4141
// tidy-alphabetical-end
4242

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
454454
}
455455
};
456456
}
457-
gate_all!(
458-
if_let_guard,
459-
"`if let` guards are experimental",
460-
"you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`"
461-
);
462457
gate_all!(let_chains, "`let` expressions in this position are unstable");
463458
gate_all!(
464459
async_trait_bounds,

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
// tidy-alphabetical-start
66
#![allow(internal_features)]
7+
#![cfg_attr(bootstrap, feature(if_let_guard))]
78
#![doc(rust_logo)]
89
#![feature(box_patterns)]
9-
#![feature(if_let_guard)]
1010
#![feature(iter_is_partitioned)]
1111
#![feature(rustdoc_internals)]
1212
// tidy-alphabetical-end

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5+
#![cfg_attr(bootstrap, feature(if_let_guard))]
56
#![doc(rust_logo)]
67
#![feature(assert_matches)]
78
#![feature(box_patterns)]
89
#![feature(file_buffered)]
9-
#![feature(if_let_guard)]
1010
#![feature(negative_impls)]
1111
#![feature(never_type)]
1212
#![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,13 +5,13 @@
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
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
910
#![doc(rust_logo)]
1011
#![feature(assert_matches)]
1112
#![feature(autodiff)]
1213
#![feature(box_patterns)]
1314
#![feature(decl_macro)]
14-
#![feature(if_let_guard)]
1515
#![feature(proc_macro_internals)]
1616
#![feature(proc_macro_quote)]
1717
#![feature(rustdoc_internals)]

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(if_let_guard))]
910
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1011
#![doc(rust_logo)]
1112
#![feature(assert_matches)]
1213
#![feature(exact_size_is_empty)]
1314
#![feature(extern_types)]
1415
#![feature(file_buffered)]
15-
#![feature(if_let_guard)]
1616
#![feature(impl_trait_in_assoc_type)]
1717
#![feature(iter_intersperse)]
1818
#![feature(rustdoc_internals)]

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#![allow(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
44
#![allow(rustc::untranslatable_diagnostic)]
5+
#![cfg_attr(bootstrap, feature(if_let_guard))]
56
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
67
#![doc(rust_logo)]
78
#![feature(assert_matches)]
89
#![feature(box_patterns)]
910
#![feature(file_buffered)]
10-
#![feature(if_let_guard)]
1111
#![feature(negative_impls)]
1212
#![feature(rustdoc_internals)]
1313
#![feature(string_from_utf8_lossy_owned)]

compiler/rustc_const_eval/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
4+
#![cfg_attr(bootstrap, feature(if_let_guard))]
45
#![doc(rust_logo)]
56
#![feature(assert_matches)]
67
#![feature(box_patterns)]
78
#![feature(decl_macro)]
8-
#![feature(if_let_guard)]
99
#![feature(never_type)]
1010
#![feature(rustdoc_internals)]
1111
#![feature(slice_ptr_get)]

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#![allow(internal_features)]
88
#![allow(rustc::diagnostic_outside_of_impl)]
99
#![allow(rustc::untranslatable_diagnostic)]
10+
#![cfg_attr(bootstrap, feature(if_let_guard))]
1011
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1112
#![doc(rust_logo)]
1213
#![feature(array_windows)]
@@ -16,7 +17,6 @@
1617
#![feature(box_patterns)]
1718
#![feature(default_field_values)]
1819
#![feature(error_reporter)]
19-
#![feature(if_let_guard)]
2020
#![feature(negative_impls)]
2121
#![feature(never_type)]
2222
#![feature(rustc_attrs)]

compiler/rustc_expand/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(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
4+
#![cfg_attr(bootstrap, feature(if_let_guard))]
45
#![doc(rust_logo)]
56
#![feature(array_windows)]
67
#![feature(associated_type_defaults)]
7-
#![feature(if_let_guard)]
88
#![feature(macro_metavar_expr)]
99
#![feature(map_try_insert)]
1010
#![feature(proc_macro_diagnostic)]

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ declare_features! (
234234
(accepted, i128_type, "1.26.0", Some(35118)),
235235
/// Allows the use of `if let` expressions.
236236
(accepted, if_let, "1.0.0", None),
237+
/// Allows `if let` guard in match arms.
238+
(accepted, if_let_guard, "CURRENT_RUSTC_VERSION", Some(51114)),
237239
/// Rescoping temporaries in `if let` to align with Rust 2024.
238240
(accepted, if_let_rescope, "1.84.0", Some(124085)),
239241
/// Allows top level or-patterns (`p | q`) in `if let` and `while let`.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,6 @@ declare_features! (
530530
(incomplete, guard_patterns, "1.85.0", Some(129967)),
531531
/// Allows using `..=X` as a patterns in slices.
532532
(unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)),
533-
/// Allows `if let` guard in match arms.
534-
(unstable, if_let_guard, "1.47.0", Some(51114)),
535533
/// Allows `impl Trait` to be used inside associated types (RFC 2515).
536534
(unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)),
537535
/// Allows `impl Trait` in bindings (`let`).

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ This API is completely unstable and subject to change.
5959
#![allow(internal_features)]
6060
#![allow(rustc::diagnostic_outside_of_impl)]
6161
#![allow(rustc::untranslatable_diagnostic)]
62+
#![cfg_attr(bootstrap, feature(if_let_guard))]
6263
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
6364
#![doc(rust_logo)]
6465
#![feature(assert_matches)]
6566
#![feature(coroutines)]
6667
#![feature(debug_closure_helpers)]
67-
#![feature(if_let_guard)]
6868
#![feature(iter_from_coroutine)]
6969
#![feature(iter_intersperse)]
7070
#![feature(never_type)]

compiler/rustc_hir_typeck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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(array_windows)]
56
#![feature(box_patterns)]
6-
#![feature(if_let_guard)]
77
#![feature(iter_intersperse)]
88
#![feature(never_type)]
99
#![feature(try_blocks)]

compiler/rustc_lint/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
2222
// tidy-alphabetical-start
2323
#![allow(internal_features)]
24+
#![cfg_attr(bootstrap, feature(if_let_guard))]
2425
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2526
#![doc(rust_logo)]
2627
#![feature(array_windows)]
2728
#![feature(assert_matches)]
2829
#![feature(box_patterns)]
29-
#![feature(if_let_guard)]
3030
#![feature(iter_order_by)]
3131
#![feature(rustc_attrs)]
3232
#![feature(rustdoc_internals)]

compiler/rustc_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tidy-alphabetical-start
22
#![allow(rustc::default_hash_types)]
3-
#![feature(if_let_guard)]
3+
#![cfg_attr(bootstrap, feature(if_let_guard))]
44
#![feature(never_type)]
55
#![feature(proc_macro_diagnostic)]
66
#![feature(proc_macro_span)]

compiler/rustc_metadata/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
3+
#![cfg_attr(bootstrap, feature(if_let_guard))]
34
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
45
#![doc(rust_logo)]
56
#![feature(coroutines)]
67
#![feature(decl_macro)]
78
#![feature(error_iter)]
89
#![feature(file_buffered)]
9-
#![feature(if_let_guard)]
1010
#![feature(iter_from_coroutine)]
1111
#![feature(macro_metavar_expr)]
1212
#![feature(min_specialization)]

compiler/rustc_middle/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#![allow(internal_features)]
2929
#![allow(rustc::diagnostic_outside_of_impl)]
3030
#![allow(rustc::untranslatable_diagnostic)]
31+
#![cfg_attr(bootstrap, feature(if_let_guard))]
3132
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3233
#![doc(rust_logo)]
3334
#![feature(allocator_api)]
@@ -44,7 +45,6 @@
4445
#![feature(discriminant_kind)]
4546
#![feature(extern_types)]
4647
#![feature(file_buffered)]
47-
#![feature(if_let_guard)]
4848
#![feature(intra_doc_pointers)]
4949
#![feature(iter_from_coroutine)]
5050
#![feature(min_specialization)]

compiler/rustc_mir_build/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// tidy-alphabetical-start
44
#![allow(rustc::diagnostic_outside_of_impl)]
55
#![allow(rustc::untranslatable_diagnostic)]
6+
#![cfg_attr(bootstrap, feature(if_let_guard))]
67
#![feature(assert_matches)]
78
#![feature(box_patterns)]
8-
#![feature(if_let_guard)]
99
#![feature(try_blocks)]
1010
// tidy-alphabetical-end
1111

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// tidy-alphabetical-start
2+
#![cfg_attr(bootstrap, feature(if_let_guard))]
23
#![feature(array_windows)]
34
#![feature(assert_matches)]
45
#![feature(box_patterns)]
56
#![feature(const_type_name)]
67
#![feature(cow_is_borrowed)]
78
#![feature(file_buffered)]
8-
#![feature(if_let_guard)]
99
#![feature(impl_trait_in_assoc_type)]
1010
#![feature(map_try_insert)]
1111
#![feature(never_type)]

compiler/rustc_monomorphize/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// tidy-alphabetical-start
2+
#![cfg_attr(bootstrap, feature(if_let_guard))]
23
#![feature(array_windows)]
34
#![feature(file_buffered)]
4-
#![feature(if_let_guard)]
55
#![feature(impl_trait_in_assoc_type)]
66
#![feature(once_cell_get_mut)]
77
// tidy-alphabetical-end

compiler/rustc_parse/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#![allow(internal_features)]
55
#![allow(rustc::diagnostic_outside_of_impl)]
66
#![allow(rustc::untranslatable_diagnostic)]
7+
#![cfg_attr(bootstrap, feature(if_let_guard))]
78
#![feature(assert_matches)]
89
#![feature(box_patterns)]
910
#![feature(debug_closure_helpers)]
10-
#![feature(if_let_guard)]
1111
#![feature(iter_intersperse)]
1212
#![feature(string_from_utf8_lossy_owned)]
1313
#![recursion_limit = "256"]

compiler/rustc_resolve/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#![allow(internal_features)]
1111
#![allow(rustc::diagnostic_outside_of_impl)]
1212
#![allow(rustc::untranslatable_diagnostic)]
13+
#![cfg_attr(bootstrap, feature(if_let_guard))]
1314
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1415
#![doc(rust_logo)]
1516
#![feature(assert_matches)]
1617
#![feature(box_patterns)]
17-
#![feature(if_let_guard)]
1818
#![feature(iter_intersperse)]
1919
#![feature(rustc_attrs)]
2020
#![feature(rustdoc_internals)]

compiler/rustc_span/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
1818
// tidy-alphabetical-start
1919
#![allow(internal_features)]
20+
#![cfg_attr(bootstrap, feature(if_let_guard))]
2021
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2122
#![doc(rust_logo)]
2223
#![feature(array_windows)]
2324
#![feature(cfg_match)]
2425
#![feature(core_io_borrowed_buf)]
2526
#![feature(hash_set_entry)]
26-
#![feature(if_let_guard)]
2727
#![feature(map_try_insert)]
2828
#![feature(negative_impls)]
2929
#![feature(read_buf)]

compiler/rustc_trait_selection/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
#![allow(internal_features)]
1515
#![allow(rustc::diagnostic_outside_of_impl)]
1616
#![allow(rustc::untranslatable_diagnostic)]
17+
#![cfg_attr(bootstrap, feature(if_let_guard))]
1718
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1819
#![doc(rust_logo)]
1920
#![feature(assert_matches)]
2021
#![feature(associated_type_defaults)]
2122
#![feature(box_patterns)]
2223
#![feature(cfg_version)]
23-
#![feature(if_let_guard)]
2424
#![feature(iter_intersperse)]
2525
#![feature(iterator_try_reduce)]
2626
#![feature(never_type)]

compiler/rustc_ty_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(if_let_guard))]
910
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1011
#![doc(rust_logo)]
1112
#![feature(assert_matches)]
1213
#![feature(associated_type_defaults)]
1314
#![feature(box_patterns)]
14-
#![feature(if_let_guard)]
1515
#![feature(iterator_try_collect)]
1616
#![feature(never_type)]
1717
#![feature(rustdoc_internals)]

library/core/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
//
9696
// Library features:
9797
// tidy-alphabetical-start
98+
#![cfg_attr(bootstrap, feature(if_let_guard))]
9899
#![feature(array_ptr_get)]
99100
#![feature(asm_experimental_arch)]
100101
#![feature(bigint_helper_methods)]
@@ -143,6 +144,7 @@
143144
#![feature(cfg_ub_checks)]
144145
#![feature(const_precise_live_drops)]
145146
#![feature(const_trait_impl)]
147+
#![feature(core_float_math)]
146148
#![feature(decl_macro)]
147149
#![feature(deprecated_suggestion)]
148150
#![feature(doc_cfg)]
@@ -154,7 +156,6 @@
154156
#![feature(freeze_impls)]
155157
#![feature(fundamental)]
156158
#![feature(generic_arg_infer)]
157-
#![feature(if_let_guard)]
158159
#![feature(intra_doc_pointers)]
159160
#![feature(intrinsics)]
160161
#![feature(lang_items)]
@@ -182,6 +183,7 @@
182183
#![feature(transparent_unions)]
183184
#![feature(try_blocks)]
184185
#![feature(unboxed_closures)]
186+
#![feature(unsigned_signed_diff)]
185187
#![feature(unsized_fn_params)]
186188
#![feature(with_negative_coherence)]
187189
// tidy-alphabetical-end

0 commit comments

Comments
 (0)