Skip to content

Commit 1cd72b7

Browse files
committed
Auto merge of #99362 - JohnTitor:rollup-4d5zo9d, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #94927 (Stabilize `let_chains` in Rust 1.64) - #97915 (Implement `fmt::Write` for `OsString`) - #99036 (Add `#[test]` to functions in test modules) - #99088 (Document and stabilize process_set_process_group) - #99302 (add tracking issue to generic member access APIs) - #99306 (Stabilize `future_poll_fn`) - #99354 (Add regression test for #95829) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents db41351 + 1d19323 commit 1cd72b7

File tree

71 files changed

+619
-984
lines changed

Some content is hidden

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

71 files changed

+619
-984
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#![feature(const_trait_impl)]
1515
#![feature(if_let_guard)]
1616
#![feature(label_break_value)]
17-
#![feature(let_chains)]
17+
#![cfg_attr(bootstrap, feature(let_chains))]
1818
#![feature(min_specialization)]
1919
#![feature(negative_impls)]
2020
#![feature(slice_internals)]

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(box_patterns)]
34-
#![feature(let_chains)]
34+
#![cfg_attr(bootstrap, feature(let_chains))]
3535
#![feature(let_else)]
3636
#![feature(never_type)]
3737
#![recursion_limit = "256"]

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,23 @@ impl<'a> AstValidator<'a> {
119119

120120
/// Emits an error banning the `let` expression provided in the given location.
121121
fn ban_let_expr(&self, expr: &'a Expr, forbidden_let_reason: ForbiddenLetReason) {
122-
let sess = &self.session;
123-
if sess.opts.unstable_features.is_nightly_build() {
124-
let err = "`let` expressions are not supported here";
125-
let mut diag = sess.struct_span_err(expr.span, err);
126-
diag.note("only supported directly in conditions of `if` and `while` expressions");
127-
match forbidden_let_reason {
128-
ForbiddenLetReason::GenericForbidden => {}
129-
ForbiddenLetReason::NotSupportedOr(span) => {
130-
diag.span_note(
131-
span,
132-
"`||` operators are not supported in let chain expressions",
133-
);
134-
}
135-
ForbiddenLetReason::NotSupportedParentheses(span) => {
136-
diag.span_note(
137-
span,
138-
"`let`s wrapped in parentheses are not supported in a context with let \
139-
chains",
140-
);
141-
}
122+
let err = "`let` expressions are not supported here";
123+
let mut diag = self.session.struct_span_err(expr.span, err);
124+
diag.note("only supported directly in conditions of `if` and `while` expressions");
125+
match forbidden_let_reason {
126+
ForbiddenLetReason::GenericForbidden => {}
127+
ForbiddenLetReason::NotSupportedOr(span) => {
128+
diag.span_note(span, "`||` operators are not supported in let chain expressions");
129+
}
130+
ForbiddenLetReason::NotSupportedParentheses(span) => {
131+
diag.span_note(
132+
span,
133+
"`let`s wrapped in parentheses are not supported in a context with let \
134+
chains",
135+
);
142136
}
143-
diag.emit();
144-
} else {
145-
sess.struct_span_err(expr.span, "expected expression, found statement (`let`)")
146-
.note("variable declaration using `let` is a statement")
147-
.emit();
148137
}
138+
diag.emit();
149139
}
150140

151141
fn check_gat_where(

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
738738
"`if let` guards are experimental",
739739
"you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`"
740740
);
741-
gate_all!(let_chains, "`let` expressions in this position are unstable");
742741
gate_all!(
743742
async_closure,
744743
"async closures are unstable",

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![feature(box_patterns)]
99
#![feature(if_let_guard)]
1010
#![feature(iter_is_partitioned)]
11-
#![feature(let_chains)]
11+
#![cfg_attr(bootstrap, feature(let_chains))]
1212
#![feature(let_else)]
1313
#![recursion_limit = "256"]
1414

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(let_chains)]
7+
#![cfg_attr(bootstrap, feature(let_chains))]
88
#![feature(let_else)]
99

1010
#[macro_use]

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#![allow(rustc::potential_query_instability)]
44
#![feature(box_patterns)]
5-
#![feature(let_chains)]
5+
#![cfg_attr(bootstrap, feature(let_chains))]
66
#![feature(let_else)]
77
#![feature(min_specialization)]
88
#![feature(never_type)]

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(decl_macro)]
99
#![feature(if_let_guard)]
1010
#![feature(is_sorted)]
11-
#![feature(let_chains)]
11+
#![cfg_attr(bootstrap, feature(let_chains))]
1212
#![feature(let_else)]
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
@@ -6,7 +6,7 @@
66
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
88
#![feature(hash_raw_entry)]
9-
#![feature(let_chains)]
9+
#![cfg_attr(bootstrap, feature(let_chains))]
1010
#![feature(let_else)]
1111
#![feature(extern_types)]
1212
#![feature(once_cell)]

compiler/rustc_const_eval/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Rust MIR: a lowered representation of Rust.
99
#![feature(control_flow_enum)]
1010
#![feature(decl_macro)]
1111
#![feature(exact_size_is_empty)]
12-
#![feature(let_chains)]
12+
#![cfg_attr(bootstrap, feature(let_chains))]
1313
#![feature(let_else)]
1414
#![feature(map_try_insert)]
1515
#![feature(min_specialization)]

0 commit comments

Comments
 (0)