Skip to content

Commit 1a08886

Browse files
committed
Auto merge of rust-lang#3153 - rust-lang:rustup-2023-11-02, r=RalfJung
Automatic Rustup
2 parents de09bf5 + 869827f commit 1a08886

File tree

748 files changed

+18616
-9945
lines changed

Some content is hidden

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

748 files changed

+18616
-9945
lines changed

.github/workflows/ci.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ jobs:
193193
os: ubuntu-20.04-8core-32gb
194194
env: {}
195195
- name: dist-aarch64-linux
196+
env:
197+
CODEGEN_BACKENDS: "llvm,cranelift"
196198
os: ubuntu-20.04-8core-32gb
197-
env: {}
198199
- name: dist-android
199200
os: ubuntu-20.04-8core-32gb
200201
env: {}
@@ -244,15 +245,18 @@ jobs:
244245
os: ubuntu-20.04-8core-32gb
245246
env: {}
246247
- name: dist-x86_64-linux
248+
env:
249+
CODEGEN_BACKENDS: "llvm,cranelift"
247250
os: ubuntu-20.04-16core-64gb
248-
env: {}
249251
- name: dist-x86_64-linux-alt
250252
env:
251253
IMAGE: dist-x86_64-linux
254+
CODEGEN_BACKENDS: "llvm,cranelift"
252255
os: ubuntu-20.04-16core-64gb
253256
- name: dist-x86_64-musl
257+
env:
258+
CODEGEN_BACKENDS: "llvm,cranelift"
254259
os: ubuntu-20.04-8core-32gb
255-
env: {}
256260
- name: dist-x86_64-netbsd
257261
os: ubuntu-20.04-8core-32gb
258262
env: {}
@@ -316,6 +320,7 @@ jobs:
316320
NO_DEBUG_ASSERTIONS: 1
317321
NO_OVERFLOW_CHECKS: 1
318322
DIST_REQUIRE_ALL_TOOLS: 1
323+
CODEGEN_BACKENDS: "llvm,cranelift"
319324
os: macos-13
320325
- name: dist-apple-various
321326
env:
@@ -377,6 +382,7 @@ jobs:
377382
- name: x86_64-msvc-ext
378383
env:
379384
SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo && src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
385+
HOST_TARGET: x86_64-pc-windows-msvc
380386
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-lld --save-toolstates=/tmp/toolstate/toolstates.json"
381387
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
382388
os: windows-2019-8core-32gb
@@ -554,8 +560,9 @@ jobs:
554560
matrix:
555561
include:
556562
- name: dist-x86_64-linux
563+
env:
564+
CODEGEN_BACKENDS: "llvm,cranelift"
557565
os: ubuntu-20.04-16core-64gb
558-
env: {}
559566
timeout-minutes: 600
560567
runs-on: "${{ matrix.os }}"
561568
steps:

Cargo.lock

+12-2
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,17 @@ dependencies = [
10111011
"syn 2.0.29",
10121012
]
10131013

1014+
[[package]]
1015+
name = "derivative"
1016+
version = "2.2.0"
1017+
source = "registry+https://github.com/rust-lang/crates.io-index"
1018+
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
1019+
dependencies = [
1020+
"proc-macro2",
1021+
"quote",
1022+
"syn 1.0.109",
1023+
]
1024+
10141025
[[package]]
10151026
name = "derive_builder"
10161027
version = "0.12.0"
@@ -4054,7 +4065,6 @@ dependencies = [
40544065
"rustc_hir_analysis",
40554066
"rustc_hir_typeck",
40564067
"rustc_incremental",
4057-
"rustc_index",
40584068
"rustc_lint",
40594069
"rustc_macros",
40604070
"rustc_metadata",
@@ -4413,7 +4423,6 @@ version = "0.0.0"
44134423
dependencies = [
44144424
"field-offset",
44154425
"measureme",
4416-
"memoffset",
44174426
"rustc-rayon-core",
44184427
"rustc_data_structures",
44194428
"rustc_errors",
@@ -4669,6 +4678,7 @@ name = "rustc_type_ir"
46694678
version = "0.0.0"
46704679
dependencies = [
46714680
"bitflags 1.3.2",
4681+
"derivative",
46724682
"rustc_data_structures",
46734683
"rustc_index",
46744684
"rustc_macros",

compiler/rustc/Cargo.toml

+10-3
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,31 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7-
rustc_driver = { path = "../rustc_driver" }
8-
rustc_driver_impl = { path = "../rustc_driver_impl" }
7+
# tidy-alphabetical-start
98

109
# Make sure rustc_codegen_ssa ends up in the sysroot, because this
1110
# crate is intended to be used by codegen backends, which may not be in-tree.
1211
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
12+
13+
rustc_driver = { path = "../rustc_driver" }
14+
rustc_driver_impl = { path = "../rustc_driver_impl" }
15+
1316
# Make sure rustc_smir ends up in the sysroot, because this
14-
# crate is intended to be used by stable MIR consumers, which are not in-tree
17+
# crate is intended to be used by stable MIR consumers, which are not in-tree.
1518
rustc_smir = { path = "../rustc_smir" }
19+
1620
stable_mir = { path = "../stable_mir" }
21+
# tidy-alphabetical-end
1722

1823
[dependencies.jemalloc-sys]
1924
version = "0.5.0"
2025
optional = true
2126
features = ['unprefixed_malloc_on_supported_platforms']
2227

2328
[features]
29+
# tidy-alphabetical-start
2430
jemalloc = ['jemalloc-sys']
2531
llvm = ['rustc_driver_impl/llvm']
2632
max_level_info = ['rustc_driver_impl/max_level_info']
2733
rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler']
34+
# tidy-alphabetical-end

compiler/rustc_abi/Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7+
# tidy-alphabetical-start
78
bitflags = "1.2.1"
8-
tracing = "0.1"
99
rand = { version = "0.8.4", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.6.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
1212
rustc_index = { path = "../rustc_index", default-features = false }
1313
rustc_macros = { path = "../rustc_macros", optional = true }
1414
rustc_serialize = { path = "../rustc_serialize", optional = true }
15+
tracing = "0.1"
16+
# tidy-alphabetical-end
1517

1618
[features]
19+
# tidy-alphabetical-start
1720
default = ["nightly", "randomize"]
18-
randomize = ["rand", "rand_xoshiro", "nightly"]
1921
# rust-analyzer depends on this crate and we therefore require it to built on a stable toolchain
2022
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
2123
nightly = [
@@ -24,3 +26,5 @@ nightly = [
2426
"rustc_macros",
2527
"rustc_serialize",
2628
]
29+
randomize = ["rand", "rand_xoshiro", "nightly"]
30+
# tidy-alphabetical-end

compiler/rustc_abi/src/layout.rs

+5
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ pub trait LayoutCalculator {
539539
// Align the maximum variant size to the largest alignment.
540540
size = size.align_to(align.abi);
541541

542+
// FIXME(oli-obk): deduplicate and harden these checks
542543
if size.bytes() >= dl.obj_size_bound() {
543544
return None;
544545
}
@@ -1103,6 +1104,10 @@ fn univariant<
11031104
inverse_memory_index.into_iter().map(|it| it.index() as u32).collect()
11041105
};
11051106
let size = min_size.align_to(align.abi);
1107+
// FIXME(oli-obk): deduplicate and harden these checks
1108+
if size.bytes() >= dl.obj_size_bound() {
1109+
return None;
1110+
}
11061111
let mut layout_of_single_non_zst_field = None;
11071112
let mut abi = Abi::Aggregate { sized };
11081113
// Try to make this a Scalar/ScalarPair.

compiler/rustc_arena/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7+
# tidy-alphabetical-start
78
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
9+
# tidy-alphabetical-end

compiler/rustc_ast/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ name = "rustc_ast"
33
version = "0.0.0"
44
edition = "2021"
55

6-
[lib]
7-
86
[dependencies]
7+
# tidy-alphabetical-start
98
bitflags = "1.2.1"
109
memchr = "2.5.0"
1110
rustc_data_structures = { path = "../rustc_data_structures" }
@@ -14,8 +13,9 @@ rustc_lexer = { path = "../rustc_lexer" }
1413
rustc_macros = { path = "../rustc_macros" }
1514
rustc_serialize = { path = "../rustc_serialize" }
1615
rustc_span = { path = "../rustc_span" }
17-
# depends on Mutability and Movability, which could be uplifted into a common crate.
16+
# For Mutability and Movability, which could be uplifted into a common crate.
1817
rustc_type_ir = { path = "../rustc_type_ir" }
1918
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2019
thin-vec = "0.2.12"
2120
tracing = "0.1"
21+
# tidy-alphabetical-end

compiler/rustc_ast/src/ast.rs

+32-6
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ impl Expr {
12351235
ExprKind::Closure(..) => ExprPrecedence::Closure,
12361236
ExprKind::Block(..) => ExprPrecedence::Block,
12371237
ExprKind::TryBlock(..) => ExprPrecedence::TryBlock,
1238-
ExprKind::Async(..) => ExprPrecedence::Async,
1238+
ExprKind::Gen(..) => ExprPrecedence::Gen,
12391239
ExprKind::Await(..) => ExprPrecedence::Await,
12401240
ExprKind::Assign(..) => ExprPrecedence::Assign,
12411241
ExprKind::AssignOp(..) => ExprPrecedence::AssignOp,
@@ -1405,11 +1405,9 @@ pub enum ExprKind {
14051405
Closure(Box<Closure>),
14061406
/// A block (`'label: { ... }`).
14071407
Block(P<Block>, Option<Label>),
1408-
/// An async block (`async move { ... }`).
1409-
///
1410-
/// The async block used to have a `NodeId`, which was removed in favor of
1411-
/// using the parent `NodeId` of the parent `Expr`.
1412-
Async(CaptureBy, P<Block>),
1408+
/// An `async` block (`async move { ... }`),
1409+
/// or a `gen` block (`gen move { ... }`)
1410+
Gen(CaptureBy, P<Block>, GenBlockKind),
14131411
/// An await expression (`my_future.await`). Span is of await keyword.
14141412
Await(P<Expr>, Span),
14151413

@@ -1499,6 +1497,28 @@ pub enum ExprKind {
14991497
Err,
15001498
}
15011499

1500+
/// Used to differentiate between `async {}` blocks and `gen {}` blocks.
1501+
#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq)]
1502+
pub enum GenBlockKind {
1503+
Async,
1504+
Gen,
1505+
}
1506+
1507+
impl fmt::Display for GenBlockKind {
1508+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1509+
self.modifier().fmt(f)
1510+
}
1511+
}
1512+
1513+
impl GenBlockKind {
1514+
pub fn modifier(&self) -> &'static str {
1515+
match self {
1516+
GenBlockKind::Async => "async",
1517+
GenBlockKind::Gen => "gen",
1518+
}
1519+
}
1520+
}
1521+
15021522
/// The explicit `Self` type in a "qualified path". The actual
15031523
/// path, including the trait and the associated item, is stored
15041524
/// separately. `position` represents the index of the associated
@@ -2363,6 +2383,12 @@ pub enum Async {
23632383
No,
23642384
}
23652385

2386+
#[derive(Copy, Clone, Encodable, Decodable, Debug)]
2387+
pub enum Gen {
2388+
Yes { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId },
2389+
No,
2390+
}
2391+
23662392
impl Async {
23672393
pub fn is_async(self) -> bool {
23682394
matches!(self, Async::Yes { .. })

compiler/rustc_ast/src/mut_visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
14181418
vis.visit_block(blk);
14191419
visit_opt(label, |label| vis.visit_label(label));
14201420
}
1421-
ExprKind::Async(_capture_by, body) => {
1421+
ExprKind::Gen(_capture_by, body, _) => {
14221422
vis.visit_block(body);
14231423
}
14241424
ExprKind::Await(expr, await_kw_span) => {

compiler/rustc_ast/src/token.rs

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ pub fn ident_can_begin_expr(name: Symbol, span: Span, is_raw: bool) -> bool {
197197
kw::Continue,
198198
kw::False,
199199
kw::For,
200+
kw::Gen,
200201
kw::If,
201202
kw::Let,
202203
kw::Loop,

compiler/rustc_ast/src/util/classify.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
4646
Closure(closure) => {
4747
expr = &closure.body;
4848
}
49-
Async(..) | Block(..) | ForLoop(..) | If(..) | Loop(..) | Match(..) | Struct(..)
49+
Gen(..) | Block(..) | ForLoop(..) | If(..) | Loop(..) | Match(..) | Struct(..)
5050
| TryBlock(..) | While(..) => break Some(expr),
5151
_ => break None,
5252
}

compiler/rustc_ast/src/util/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pub enum ExprPrecedence {
285285
Block,
286286
TryBlock,
287287
Struct,
288-
Async,
288+
Gen,
289289
Await,
290290
Err,
291291
}
@@ -351,7 +351,7 @@ impl ExprPrecedence {
351351
| ExprPrecedence::ConstBlock
352352
| ExprPrecedence::Block
353353
| ExprPrecedence::TryBlock
354-
| ExprPrecedence::Async
354+
| ExprPrecedence::Gen
355355
| ExprPrecedence::Struct
356356
| ExprPrecedence::Err => PREC_PAREN,
357357
}

compiler/rustc_ast/src/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
872872
walk_list!(visitor, visit_label, opt_label);
873873
visitor.visit_block(block);
874874
}
875-
ExprKind::Async(_, body) => {
875+
ExprKind::Gen(_, body, _) => {
876876
visitor.visit_block(body);
877877
}
878878
ExprKind::Await(expr, _) => visitor.visit_expr(expr),

compiler/rustc_ast_lowering/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ edition = "2021"
77
doctest = false
88

99
[dependencies]
10+
# tidy-alphabetical-start
1011
rustc_ast = { path = "../rustc_ast" }
1112
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1213
rustc_data_structures = { path = "../rustc_data_structures" }
1314
rustc_errors = { path = "../rustc_errors" }
14-
rustc_hir = { path = "../rustc_hir" }
1515
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
16+
rustc_hir = { path = "../rustc_hir" }
1617
rustc_index = { path = "../rustc_index" }
17-
rustc_middle = { path = "../rustc_middle" }
1818
rustc_macros = { path = "../rustc_macros" }
19+
rustc_middle = { path = "../rustc_middle" }
1920
rustc_session = { path = "../rustc_session" }
2021
rustc_span = { path = "../rustc_span" }
2122
rustc_target = { path = "../rustc_target" }
2223
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2324
thin-vec = "0.2.12"
2425
tracing = "0.1"
26+
# tidy-alphabetical-end

0 commit comments

Comments
 (0)