Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5d04957

Browse files
committed
Auto merge of rust-lang#79278 - mark-i-m:stabilize-or-pattern, r=nikomatsakis
Stabilize or_patterns (RFC 2535, 2530, 2175) closes rust-lang#54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in rust-lang#78935 (comment) - [x] The resolution of the unresolved questions and a second crater run (rust-lang#78935 (comment)) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (rust-lang#80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in rust-lang#79278 (comment)
2 parents 2287a88 + b9ecba3 commit 5d04957

File tree

128 files changed

+416
-839
lines changed

Some content is hidden

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

128 files changed

+416
-839
lines changed

compiler/rustc_apfloat/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#![no_std]
3535
#![forbid(unsafe_code)]
3636
#![feature(nll)]
37-
#![feature(or_patterns)]
37+
#![cfg_attr(bootstrap, feature(or_patterns))]
3838

3939
#[macro_use]
4040
extern crate alloc;

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#![feature(crate_visibility_modifier)]
1717
#![feature(label_break_value)]
1818
#![feature(nll)]
19-
#![feature(or_patterns)]
19+
#![cfg_attr(bootstrap, feature(or_patterns))]
2020
#![recursion_limit = "256"]
2121

2222
#[macro_use]

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
//! in the HIR, especially for multiple identifiers.
3232
3333
#![feature(crate_visibility_modifier)]
34-
#![feature(or_patterns)]
34+
#![cfg_attr(bootstrap, feature(or_patterns))]
3535
#![feature(box_patterns)]
3636
#![recursion_limit = "256"]
3737

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
686686
"to use an async block, remove the `||`: `async {`"
687687
);
688688
gate_all!(generators, "yield syntax is experimental");
689-
gate_all!(or_patterns, "or-patterns syntax is experimental");
690689
gate_all!(raw_ref_op, "raw address of syntax is experimental");
691690
gate_all!(const_trait_bound_opt_out, "`?const` on trait bounds is experimental");
692691
gate_all!(const_trait_impl, "const trait impls are experimental");

compiler/rustc_ast_pretty/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(bool_to_option)]
22
#![feature(crate_visibility_modifier)]
3-
#![feature(or_patterns)]
3+
#![cfg_attr(bootstrap, feature(or_patterns))]
44
#![feature(box_patterns)]
55
#![recursion_limit = "256"]
66

compiler/rustc_attr/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! The goal is to move the definition of `MetaItem` and things that don't need to be in `syntax`
55
//! to this crate.
66
7-
#![feature(or_patterns)]
7+
#![cfg_attr(bootstrap, feature(or_patterns))]
88

99
#[macro_use]
1010
extern crate rustc_macros;

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![feature(crate_visibility_modifier)]
99
#![feature(decl_macro)]
1010
#![feature(nll)]
11-
#![feature(or_patterns)]
11+
#![cfg_attr(bootstrap, feature(or_patterns))]
1212
#![feature(proc_macro_internals)]
1313
#![feature(proc_macro_quote)]
1414
#![recursion_limit = "256"]

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#![feature(extern_types)]
1313
#![feature(in_band_lifetimes)]
1414
#![feature(nll)]
15-
#![feature(or_patterns)]
15+
#![cfg_attr(bootstrap, feature(or_patterns))]
1616
#![recursion_limit = "256"]
1717

1818
use back::write::{create_informational_target_machine, create_target_machine};

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(try_blocks)]
77
#![feature(in_band_lifetimes)]
88
#![feature(nll)]
9-
#![feature(or_patterns)]
9+
#![cfg_attr(bootstrap, feature(or_patterns))]
1010
#![feature(associated_type_bounds)]
1111
#![recursion_limit = "256"]
1212
#![feature(box_syntax)]

compiler/rustc_expand/src/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
2222
use rustc_data_structures::sync::Lrc;
2323
use rustc_errors::{Applicability, PResult};
2424
use rustc_feature::Features;
25-
use rustc_parse::parser::{AttemptLocalParseRecovery, ForceCollect, GateOr, Parser, RecoverComma};
25+
use rustc_parse::parser::{AttemptLocalParseRecovery, ForceCollect, Parser, RecoverComma};
2626
use rustc_parse::validate_attr;
2727
use rustc_session::lint::builtin::UNUSED_DOC_COMMENTS;
2828
use rustc_session::lint::BuiltinLintDiagnostics;
@@ -917,7 +917,7 @@ pub fn parse_ast_fragment<'a>(
917917
}
918918
AstFragmentKind::Ty => AstFragment::Ty(this.parse_ty()?),
919919
AstFragmentKind::Pat => {
920-
AstFragment::Pat(this.parse_pat_allow_top_alt(None, GateOr::Yes, RecoverComma::No)?)
920+
AstFragment::Pat(this.parse_pat_allow_top_alt(None, RecoverComma::No)?)
921921
}
922922
AstFragmentKind::Arms
923923
| AstFragmentKind::Fields

0 commit comments

Comments
 (0)