Skip to content

Commit 940cd59

Browse files
committed
Merge from rustc
2 parents 2bd9ade + 0faea77 commit 940cd59

File tree

820 files changed

+14551
-6035
lines changed

Some content is hidden

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

820 files changed

+14551
-6035
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -417,30 +417,16 @@ jobs:
417417
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json"
418418
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
419419
os: windows-2019-8core-32gb
420-
- name: i686-mingw-1
420+
- name: i686-mingw
421421
env:
422422
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
423-
SCRIPT: make ci-mingw-subset-1
423+
SCRIPT: make ci-mingw
424424
NO_DOWNLOAD_CI_LLVM: 1
425425
CUSTOM_MINGW: 1
426426
os: windows-2019-8core-32gb
427-
- name: i686-mingw-2
427+
- name: x86_64-mingw
428428
env:
429-
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
430-
SCRIPT: make ci-mingw-subset-2
431-
NO_DOWNLOAD_CI_LLVM: 1
432-
CUSTOM_MINGW: 1
433-
os: windows-2019-8core-32gb
434-
- name: x86_64-mingw-1
435-
env:
436-
SCRIPT: make ci-mingw-subset-1
437-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
438-
NO_DOWNLOAD_CI_LLVM: 1
439-
CUSTOM_MINGW: 1
440-
os: windows-2019-8core-32gb
441-
- name: x86_64-mingw-2
442-
env:
443-
SCRIPT: make ci-mingw-subset-2
429+
SCRIPT: make ci-mingw
444430
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
445431
NO_DOWNLOAD_CI_LLVM: 1
446432
CUSTOM_MINGW: 1

Cargo.lock

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ dependencies = [
360360
name = "cargo-miri"
361361
version = "0.1.0"
362362
dependencies = [
363-
"cargo_metadata 0.15.3",
363+
"cargo_metadata",
364364
"directories",
365365
"rustc-build-sysroot",
366366
"rustc-workspace-hack",
@@ -381,22 +381,9 @@ dependencies = [
381381

382382
[[package]]
383383
name = "cargo_metadata"
384-
version = "0.14.0"
385-
source = "registry+https://github.com/rust-lang/crates.io-index"
386-
checksum = "c297bd3135f558552f99a0daa180876984ea2c4ffa7470314540dff8c654109a"
387-
dependencies = [
388-
"camino",
389-
"cargo-platform",
390-
"semver",
391-
"serde",
392-
"serde_json",
393-
]
394-
395-
[[package]]
396-
name = "cargo_metadata"
397-
version = "0.15.3"
384+
version = "0.15.4"
398385
source = "registry+https://github.com/rust-lang/crates.io-index"
399-
checksum = "08a1ec454bc3eead8719cb56e15dbbfecdbc14e4b3a3ae4936cc6e31f5fc0d07"
386+
checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a"
400387
dependencies = [
401388
"camino",
402389
"cargo-platform",
@@ -631,7 +618,7 @@ name = "clippy_lints"
631618
version = "0.1.72"
632619
dependencies = [
633620
"arrayvec",
634-
"cargo_metadata 0.15.3",
621+
"cargo_metadata",
635622
"clippy_utils",
636623
"declare_clippy_lint",
637624
"if_chain",
@@ -710,9 +697,9 @@ dependencies = [
710697

711698
[[package]]
712699
name = "compiler_builtins"
713-
version = "0.1.92"
700+
version = "0.1.93"
714701
source = "registry+https://github.com/rust-lang/crates.io-index"
715-
checksum = "64518f1ae689f74db058bbfb3238dfe6eb53f59f4ae712f1ff4348628522e190"
702+
checksum = "76630810d973ecea3dbf611e1b7aecfb1012751ef1ff8de3998f89014a166781"
716703
dependencies = [
717704
"cc",
718705
"rustc-std-workspace-core",
@@ -4348,35 +4335,33 @@ dependencies = [
43484335
"proc-macro2",
43494336
"quote",
43504337
"serde",
4351-
"syn 1.0.102",
4338+
"syn 2.0.8",
43524339
]
43534340

43544341
[[package]]
43554342
name = "rustfmt-nightly"
4356-
version = "1.5.2"
4343+
version = "1.5.3"
43574344
dependencies = [
43584345
"annotate-snippets",
43594346
"anyhow",
43604347
"bytecount",
4361-
"cargo_metadata 0.14.0",
4362-
"clap 3.2.20",
4363-
"derive-new",
4348+
"cargo_metadata",
4349+
"clap 4.2.1",
43644350
"diff",
43654351
"dirs",
4366-
"env_logger 0.9.0",
4352+
"env_logger 0.10.0",
43674353
"getopts",
43684354
"ignore",
43694355
"itertools",
43704356
"lazy_static",
43714357
"log",
43724358
"regex",
4373-
"rustc-workspace-hack",
43744359
"rustfmt-config_proc_macro",
43754360
"serde",
43764361
"serde_json",
43774362
"term",
43784363
"thiserror",
4379-
"toml 0.5.7",
4364+
"toml 0.7.4",
43804365
"unicode-segmentation",
43814366
"unicode-width",
43824367
"unicode_categories",
@@ -4956,7 +4941,7 @@ name = "tidy"
49564941
version = "0.1.0"
49574942
dependencies = [
49584943
"cargo-platform",
4959-
"cargo_metadata 0.15.3",
4944+
"cargo_metadata",
49604945
"ignore",
49614946
"lazy_static",
49624947
"miropt-test-tools",
@@ -5192,7 +5177,7 @@ checksum = "191a442639ea102fa62671026047e51d574bfda44b7fdf32151d7314624c1cd2"
51925177
dependencies = [
51935178
"bstr",
51945179
"cargo-platform",
5195-
"cargo_metadata 0.15.3",
5180+
"cargo_metadata",
51965181
"color-eyre",
51975182
"colored",
51985183
"crossbeam-channel",

compiler/rustc_ast/src/ast.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ impl Expr {
12951295
ExprKind::Yield(..) => ExprPrecedence::Yield,
12961296
ExprKind::Yeet(..) => ExprPrecedence::Yeet,
12971297
ExprKind::FormatArgs(..) => ExprPrecedence::FormatArgs,
1298+
ExprKind::Become(..) => ExprPrecedence::Become,
12981299
ExprKind::Err => ExprPrecedence::Err,
12991300
}
13001301
}
@@ -1515,6 +1516,11 @@ pub enum ExprKind {
15151516
/// with an optional value to be returned.
15161517
Yeet(Option<P<Expr>>),
15171518

1519+
/// A tail call return, with the value to be returned.
1520+
///
1521+
/// While `.0` must be a function call, we check this later, after parsing.
1522+
Become(P<Expr>),
1523+
15181524
/// Bytes included via `include_bytes!`
15191525
/// Added for optimization purposes to avoid the need to escape
15201526
/// large binary blobs - should always behave like [`ExprKind::Lit`]

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
14571457
ExprKind::Yeet(expr) => {
14581458
visit_opt(expr, |expr| vis.visit_expr(expr));
14591459
}
1460+
ExprKind::Become(expr) => vis.visit_expr(expr),
14601461
ExprKind::InlineAsm(asm) => vis.visit_inline_asm(asm),
14611462
ExprKind::FormatArgs(fmt) => vis.visit_format_args(fmt),
14621463
ExprKind::OffsetOf(container, fields) => {

compiler/rustc_ast/src/util/parser.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ pub enum ExprPrecedence {
245245
Ret,
246246
Yield,
247247
Yeet,
248+
Become,
248249

249250
Range,
250251

@@ -298,7 +299,8 @@ impl ExprPrecedence {
298299
| ExprPrecedence::Continue
299300
| ExprPrecedence::Ret
300301
| ExprPrecedence::Yield
301-
| ExprPrecedence::Yeet => PREC_JUMP,
302+
| ExprPrecedence::Yeet
303+
| ExprPrecedence::Become => PREC_JUMP,
302304

303305
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
304306
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
908908
ExprKind::Yeet(optional_expression) => {
909909
walk_list!(visitor, visit_expr, optional_expression);
910910
}
911+
ExprKind::Become(expr) => visitor.visit_expr(expr),
911912
ExprKind::MacCall(mac) => visitor.visit_mac_call(mac),
912913
ExprKind::Paren(subexpression) => visitor.visit_expr(subexpression),
913914
ExprKind::InlineAsm(asm) => visitor.visit_inline_asm(asm),

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
275275
hir::ExprKind::Ret(e)
276276
}
277277
ExprKind::Yeet(sub_expr) => self.lower_expr_yeet(e.span, sub_expr.as_deref()),
278+
ExprKind::Become(sub_expr) => {
279+
let sub_expr = self.lower_expr(sub_expr);
280+
281+
// FIXME(explicit_tail_calls): Use `hir::ExprKind::Become` once we implemented it
282+
hir::ExprKind::Ret(Some(sub_expr))
283+
}
278284
ExprKind::InlineAsm(asm) => {
279285
hir::ExprKind::InlineAsm(self.lower_inline_asm(e.span, asm))
280286
}

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
555555
gate_all!(dyn_star, "`dyn*` trait objects are experimental");
556556
gate_all!(const_closures, "const closures are experimental");
557557
gate_all!(builtin_syntax, "`builtin #` syntax is unstable");
558+
gate_all!(explicit_tail_calls, "`become` expression is experimental");
558559

559560
if !visitor.features.negative_bounds {
560561
for &span in spans.get(&sym::negative_bounds).iter().copied().flatten() {

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,11 @@ impl<'a> State<'a> {
537537
self.print_expr_maybe_paren(expr, parser::PREC_JUMP);
538538
}
539539
}
540+
ast::ExprKind::Become(result) => {
541+
self.word("become");
542+
self.word(" ");
543+
self.print_expr_maybe_paren(result, parser::PREC_JUMP);
544+
}
540545
ast::ExprKind::InlineAsm(a) => {
541546
// FIXME: This should have its own syntax, distinct from a macro invocation.
542547
self.word("asm!");

compiler/rustc_borrowck/src/borrow_set.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
7272
let kind = match self.kind {
7373
mir::BorrowKind::Shared => "",
7474
mir::BorrowKind::Shallow => "shallow ",
75-
mir::BorrowKind::Unique => "uniq ",
76-
mir::BorrowKind::Mut { .. } => "mut ",
75+
mir::BorrowKind::Mut { kind: mir::MutBorrowKind::ClosureCapture } => "uniq ",
76+
// FIXME: differentiate `TwoPhaseBorrow`
77+
mir::BorrowKind::Mut {
78+
kind: mir::MutBorrowKind::Default | mir::MutBorrowKind::TwoPhaseBorrow,
79+
} => "mut ",
7780
};
7881
write!(w, "&{:?} {}{:?}", self.region, kind, self.borrowed_place)
7982
}

compiler/rustc_borrowck/src/borrowck_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
278278
move_from_span: Span,
279279
move_from_desc: &str,
280280
) -> DiagnosticBuilder<'cx, ErrorGuaranteed> {
281-
struct_span_err!(self, move_from_span, E0507, "cannot move out of {}", move_from_desc,)
281+
struct_span_err!(self, move_from_span, E0507, "cannot move out of {}", move_from_desc)
282282
}
283283

284284
/// Signal an error due to an attempt to move out of the interior

0 commit comments

Comments
 (0)