diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f91e6816ae42..5f14cd36ce43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,8 +193,9 @@ jobs: os: ubuntu-20.04-8core-32gb env: {} - name: dist-aarch64-linux + env: + CODEGEN_BACKENDS: "llvm,cranelift" os: ubuntu-20.04-8core-32gb - env: {} - name: dist-android os: ubuntu-20.04-8core-32gb env: {} @@ -244,15 +245,18 @@ jobs: os: ubuntu-20.04-8core-32gb env: {} - name: dist-x86_64-linux + env: + CODEGEN_BACKENDS: "llvm,cranelift" os: ubuntu-20.04-16core-64gb - env: {} - name: dist-x86_64-linux-alt env: IMAGE: dist-x86_64-linux + CODEGEN_BACKENDS: "llvm,cranelift" os: ubuntu-20.04-16core-64gb - name: dist-x86_64-musl + env: + CODEGEN_BACKENDS: "llvm,cranelift" os: ubuntu-20.04-8core-32gb - env: {} - name: dist-x86_64-netbsd os: ubuntu-20.04-8core-32gb env: {} @@ -316,6 +320,7 @@ jobs: NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 DIST_REQUIRE_ALL_TOOLS: 1 + CODEGEN_BACKENDS: "llvm,cranelift" os: macos-13 - name: dist-apple-various env: @@ -377,6 +382,7 @@ jobs: - name: x86_64-msvc-ext env: 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 + HOST_TARGET: x86_64-pc-windows-msvc RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-lld --save-toolstates=/tmp/toolstate/toolstates.json" DEPLOY_TOOLSTATES_JSON: toolstates-windows.json os: windows-2019-8core-32gb @@ -554,8 +560,9 @@ jobs: matrix: include: - name: dist-x86_64-linux + env: + CODEGEN_BACKENDS: "llvm,cranelift" os: ubuntu-20.04-16core-64gb - env: {} timeout-minutes: 600 runs-on: "${{ matrix.os }}" steps: diff --git a/Cargo.lock b/Cargo.lock index e1b0de6c7a4c..a9090201710a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1011,6 +1011,17 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder" version = "0.12.0" @@ -4054,7 +4065,6 @@ dependencies = [ "rustc_hir_analysis", "rustc_hir_typeck", "rustc_incremental", - "rustc_index", "rustc_lint", "rustc_macros", "rustc_metadata", @@ -4413,7 +4423,6 @@ version = "0.0.0" dependencies = [ "field-offset", "measureme", - "memoffset", "rustc-rayon-core", "rustc_data_structures", "rustc_errors", @@ -4669,6 +4678,7 @@ name = "rustc_type_ir" version = "0.0.0" dependencies = [ "bitflags 1.3.2", + "derivative", "rustc_data_structures", "rustc_index", "rustc_macros", diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index dcb165f9fdbf..3cb56a7d3121 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -4,16 +4,21 @@ version = "0.0.0" edition = "2021" [dependencies] -rustc_driver = { path = "../rustc_driver" } -rustc_driver_impl = { path = "../rustc_driver_impl" } +# tidy-alphabetical-start # Make sure rustc_codegen_ssa ends up in the sysroot, because this # crate is intended to be used by codegen backends, which may not be in-tree. rustc_codegen_ssa = { path = "../rustc_codegen_ssa" } + +rustc_driver = { path = "../rustc_driver" } +rustc_driver_impl = { path = "../rustc_driver_impl" } + # Make sure rustc_smir ends up in the sysroot, because this -# crate is intended to be used by stable MIR consumers, which are not in-tree +# crate is intended to be used by stable MIR consumers, which are not in-tree. rustc_smir = { path = "../rustc_smir" } + stable_mir = { path = "../stable_mir" } +# tidy-alphabetical-end [dependencies.jemalloc-sys] version = "0.5.0" @@ -21,7 +26,9 @@ optional = true features = ['unprefixed_malloc_on_supported_platforms'] [features] +# tidy-alphabetical-start jemalloc = ['jemalloc-sys'] llvm = ['rustc_driver_impl/llvm'] max_level_info = ['rustc_driver_impl/max_level_info'] rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler'] +# tidy-alphabetical-end diff --git a/compiler/rustc_abi/Cargo.toml b/compiler/rustc_abi/Cargo.toml index c43fd745e8f5..e549724b1c0a 100644 --- a/compiler/rustc_abi/Cargo.toml +++ b/compiler/rustc_abi/Cargo.toml @@ -4,18 +4,20 @@ version = "0.0.0" edition = "2021" [dependencies] +# tidy-alphabetical-start bitflags = "1.2.1" -tracing = "0.1" rand = { version = "0.8.4", default-features = false, optional = true } rand_xoshiro = { version = "0.6.0", optional = true } rustc_data_structures = { path = "../rustc_data_structures", optional = true } rustc_index = { path = "../rustc_index", default-features = false } rustc_macros = { path = "../rustc_macros", optional = true } rustc_serialize = { path = "../rustc_serialize", optional = true } +tracing = "0.1" +# tidy-alphabetical-end [features] +# tidy-alphabetical-start default = ["nightly", "randomize"] -randomize = ["rand", "rand_xoshiro", "nightly"] # rust-analyzer depends on this crate and we therefore require it to built on a stable toolchain # without depending on rustc_data_structures, rustc_macros and rustc_serialize nightly = [ @@ -24,3 +26,5 @@ nightly = [ "rustc_macros", "rustc_serialize", ] +randomize = ["rand", "rand_xoshiro", "nightly"] +# tidy-alphabetical-end diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index 00d862ca27b7..9127e1d06e88 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -539,6 +539,7 @@ pub trait LayoutCalculator { // Align the maximum variant size to the largest alignment. size = size.align_to(align.abi); + // FIXME(oli-obk): deduplicate and harden these checks if size.bytes() >= dl.obj_size_bound() { return None; } @@ -1103,6 +1104,10 @@ fn univariant< inverse_memory_index.into_iter().map(|it| it.index() as u32).collect() }; let size = min_size.align_to(align.abi); + // FIXME(oli-obk): deduplicate and harden these checks + if size.bytes() >= dl.obj_size_bound() { + return None; + } let mut layout_of_single_non_zst_field = None; let mut abi = Abi::Aggregate { sized }; // Try to make this a Scalar/ScalarPair. diff --git a/compiler/rustc_arena/Cargo.toml b/compiler/rustc_arena/Cargo.toml index 5c2aee6b47f9..382ab2b07754 100644 --- a/compiler/rustc_arena/Cargo.toml +++ b/compiler/rustc_arena/Cargo.toml @@ -4,4 +4,6 @@ version = "0.0.0" edition = "2021" [dependencies] +# tidy-alphabetical-start smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } +# tidy-alphabetical-end diff --git a/compiler/rustc_ast/Cargo.toml b/compiler/rustc_ast/Cargo.toml index e0948471acb5..59e3d85589a2 100644 --- a/compiler/rustc_ast/Cargo.toml +++ b/compiler/rustc_ast/Cargo.toml @@ -3,9 +3,8 @@ name = "rustc_ast" version = "0.0.0" edition = "2021" -[lib] - [dependencies] +# tidy-alphabetical-start bitflags = "1.2.1" memchr = "2.5.0" rustc_data_structures = { path = "../rustc_data_structures" } @@ -14,8 +13,9 @@ rustc_lexer = { path = "../rustc_lexer" } rustc_macros = { path = "../rustc_macros" } rustc_serialize = { path = "../rustc_serialize" } rustc_span = { path = "../rustc_span" } -# depends on Mutability and Movability, which could be uplifted into a common crate. +# For Mutability and Movability, which could be uplifted into a common crate. rustc_type_ir = { path = "../rustc_type_ir" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } thin-vec = "0.2.12" tracing = "0.1" +# tidy-alphabetical-end diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index e09ba03d881a..146a4db200ca 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -1235,7 +1235,7 @@ impl Expr { ExprKind::Closure(..) => ExprPrecedence::Closure, ExprKind::Block(..) => ExprPrecedence::Block, ExprKind::TryBlock(..) => ExprPrecedence::TryBlock, - ExprKind::Async(..) => ExprPrecedence::Async, + ExprKind::Gen(..) => ExprPrecedence::Gen, ExprKind::Await(..) => ExprPrecedence::Await, ExprKind::Assign(..) => ExprPrecedence::Assign, ExprKind::AssignOp(..) => ExprPrecedence::AssignOp, @@ -1405,11 +1405,9 @@ pub enum ExprKind { Closure(Box), /// A block (`'label: { ... }`). Block(P, Option