Skip to content

Commit c853744

Browse files
committed
Auto merge of #2930 - RalfJung:rustup, r=RalfJung
Rustup
2 parents b4b7cd6 + 508675b commit c853744

File tree

840 files changed

+25681
-25054
lines changed

Some content is hidden

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

840 files changed

+25681
-25054
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -383,25 +383,15 @@ jobs:
383383
DIST_REQUIRE_ALL_TOOLS: 1
384384
JEMALLOC_SYS_WITH_LG_PAGE: 14
385385
os: macos-latest
386-
- name: x86_64-msvc-1
386+
- name: x86_64-msvc
387387
env:
388388
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
389-
SCRIPT: make ci-subset-1
389+
SCRIPT: make ci-msvc
390390
os: windows-2019-8core-32gb
391-
- name: x86_64-msvc-2
392-
env:
393-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
394-
SCRIPT: make ci-subset-2
395-
os: windows-2019-8core-32gb
396-
- name: i686-msvc-1
397-
env:
398-
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
399-
SCRIPT: make ci-subset-1
400-
os: windows-2019-8core-32gb
401-
- name: i686-msvc-2
391+
- name: i686-msvc
402392
env:
403393
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
404-
SCRIPT: make ci-subset-2
394+
SCRIPT: make ci-msvc
405395
os: windows-2019-8core-32gb
406396
- name: x86_64-msvc-cargo
407397
env:

compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct ArenaChunk<T = u8> {
6767

6868
unsafe impl<#[may_dangle] T> Drop for ArenaChunk<T> {
6969
fn drop(&mut self) {
70-
unsafe { Box::from_raw(self.storage.as_mut()) };
70+
unsafe { drop(Box::from_raw(self.storage.as_mut())) }
7171
}
7272
}
7373

compiler/rustc_ast_pretty/src/pprust/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pub fn bounds_to_string(bounds: &[ast::GenericBound]) -> String {
3232
State::new().bounds_to_string(bounds)
3333
}
3434

35+
pub fn where_bound_predicate_to_string(where_bound_predicate: &ast::WhereBoundPredicate) -> String {
36+
State::new().where_bound_predicate_to_string(where_bound_predicate)
37+
}
38+
3539
pub fn pat_to_string(pat: &ast::Pat) -> String {
3640
State::new().pat_to_string(pat)
3741
}

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,13 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
824824
Self::to_string(|s| s.print_type_bounds(bounds))
825825
}
826826

827+
fn where_bound_predicate_to_string(
828+
&self,
829+
where_bound_predicate: &ast::WhereBoundPredicate,
830+
) -> String {
831+
Self::to_string(|s| s.print_where_bound_predicate(where_bound_predicate))
832+
}
833+
827834
fn pat_to_string(&self, pat: &ast::Pat) -> String {
828835
Self::to_string(|s| s.print_pat(pat))
829836
}

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -623,19 +623,8 @@ impl<'a> State<'a> {
623623

624624
pub fn print_where_predicate(&mut self, predicate: &ast::WherePredicate) {
625625
match predicate {
626-
ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate {
627-
bound_generic_params,
628-
bounded_ty,
629-
bounds,
630-
..
631-
}) => {
632-
self.print_formal_generic_params(bound_generic_params);
633-
self.print_type(bounded_ty);
634-
self.word(":");
635-
if !bounds.is_empty() {
636-
self.nbsp();
637-
self.print_type_bounds(bounds);
638-
}
626+
ast::WherePredicate::BoundPredicate(where_bound_predicate) => {
627+
self.print_where_bound_predicate(where_bound_predicate);
639628
}
640629
ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate {
641630
lifetime,
@@ -658,6 +647,19 @@ impl<'a> State<'a> {
658647
}
659648
}
660649

650+
pub fn print_where_bound_predicate(
651+
&mut self,
652+
where_bound_predicate: &ast::WhereBoundPredicate,
653+
) {
654+
self.print_formal_generic_params(&where_bound_predicate.bound_generic_params);
655+
self.print_type(&where_bound_predicate.bounded_ty);
656+
self.word(":");
657+
if !where_bound_predicate.bounds.is_empty() {
658+
self.nbsp();
659+
self.print_type_bounds(&where_bound_predicate.bounds);
660+
}
661+
}
662+
661663
fn print_use_tree(&mut self, tree: &ast::UseTree) {
662664
match &tree.kind {
663665
ast::UseTreeKind::Simple(rename) => {

compiler/rustc_borrowck/src/type_check/input_output.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
124124
// Return types are a bit more complex. They may contain opaque `impl Trait` types.
125125
let mir_output_ty = body.local_decls[RETURN_PLACE].ty;
126126
let output_span = body.local_decls[RETURN_PLACE].source_info.span;
127-
if let Err(terr) = self.eq_types(
128-
normalized_output_ty,
129-
mir_output_ty,
130-
Locations::All(output_span),
131-
ConstraintCategory::BoringNoLocation,
132-
) {
133-
span_mirbug!(
134-
self,
135-
Location::START,
136-
"equate_inputs_and_outputs: `{:?}=={:?}` failed with `{:?}`",
137-
normalized_output_ty,
138-
mir_output_ty,
139-
terr
140-
);
141-
};
127+
self.equate_normalized_input_or_output(normalized_output_ty, mir_output_ty, output_span);
142128
}
143129

144130
#[instrument(skip(self), level = "debug")]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
task:
22
name: freebsd
33
freebsd_instance:
4-
image: freebsd-13-1-release-amd64
4+
image: freebsd-13-2-release-amd64
55
setup_rust_script:
6-
- pkg install -y curl git bash
6+
- pkg install -y git bash
77
- curl https://sh.rustup.rs -sSf --output rustup.sh
88
- sh rustup.sh --default-toolchain none -y --profile=minimal
99
target_cache:
1010
folder: target
1111
prepare_script:
1212
- . $HOME/.cargo/env
13-
- ./y.rs prepare
13+
- ./y.sh prepare
1414
test_script:
1515
- . $HOME/.cargo/env
16-
- ./y.rs test
16+
- ./y.sh test

compiler/rustc_codegen_cranelift/.github/workflows/abi-cafe.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
run: rustup set default-host x86_64-pc-windows-gnu
4747

4848
- name: Prepare dependencies
49-
run: ./y.rs prepare
49+
run: ./y.sh prepare
5050

5151
- name: Build
52-
run: ./y.rs build --sysroot none
52+
run: ./y.sh build --sysroot none
5353

5454
- name: Test abi-cafe
5555
env:
5656
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
57-
run: ./y.rs abi-cafe
57+
run: ./y.sh abi-cafe

compiler/rustc_codegen_cranelift/.github/workflows/main.yml

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Rustfmt
2020
run: |
2121
cargo fmt --check
22-
rustfmt --check build_system/mod.rs
22+
rustfmt --check build_system/main.rs
2323
rustfmt --check example/*
2424
2525
@@ -91,22 +91,52 @@ jobs:
9191
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
9292
9393
- name: Prepare dependencies
94-
run: ./y.rs prepare
94+
run: ./y.sh prepare
95+
96+
- name: Build
97+
run: ./y.sh build --sysroot none
9598

96-
- name: Build without unstable features
99+
- name: Test
97100
env:
98101
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
99-
# This is the config rust-lang/rust uses for builds
100-
run: ./y.rs build --no-unstable-features
102+
run: ./y.sh test
101103

102-
- name: Build
103-
run: ./y.rs build --sysroot none
104+
- name: Install LLVM standard library
105+
run: rustup target add ${{ matrix.env.TARGET_TRIPLE }}
104106

105-
- name: Test
107+
# This is roughly config rust-lang/rust uses for testing
108+
- name: Test with LLVM sysroot
109+
# Skip native x86_64-pc-windows-gnu. It is way too slow and cross-compiled
110+
# x86_64-pc-windows-gnu covers at least part of the tests.
111+
if: matrix.os != 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
106112
env:
107113
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
108-
run: ./y.rs test
114+
run: ./y.sh test --sysroot llvm --no-unstable-features
115+
116+
117+
# This job doesn't use cg_clif in any way. It checks that all cg_clif tests work with cg_llvm too.
118+
test_llvm:
119+
runs-on: ubuntu-latest
120+
timeout-minutes: 60
121+
122+
defaults:
123+
run:
124+
shell: bash
109125

126+
steps:
127+
- uses: actions/checkout@v3
128+
129+
- name: Prepare dependencies
130+
run: ./y.rs prepare
131+
132+
- name: Disable JIT tests
133+
run: |
134+
sed -i 's/jit./#jit./' config.txt
135+
136+
- name: Test
137+
env:
138+
TARGET_TRIPLE: x86_64-unknown-linux-gnu
139+
run: ./y.rs test --use-backend llvm
110140

111141
bench:
112142
runs-on: ubuntu-latest
@@ -135,13 +165,13 @@ jobs:
135165
run: cargo install hyperfine || true
136166

137167
- name: Prepare dependencies
138-
run: ./y.rs prepare
168+
run: ./y.sh prepare
139169

140170
- name: Build
141-
run: CI_OPT=1 ./y.rs build --sysroot none
171+
run: CI_OPT=1 ./y.sh build --sysroot none
142172

143173
- name: Benchmark
144-
run: CI_OPT=1 ./y.rs bench
174+
run: CI_OPT=1 ./y.sh bench
145175

146176

147177
dist:
@@ -194,13 +224,13 @@ jobs:
194224
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
195225
196226
- name: Prepare dependencies
197-
run: ./y.rs prepare
227+
run: ./y.sh prepare
198228

199229
- name: Build backend
200-
run: CI_OPT=1 ./y.rs build --sysroot none
230+
run: CI_OPT=1 ./y.sh build --sysroot none
201231

202232
- name: Build sysroot
203-
run: CI_OPT=1 ./y.rs build
233+
run: CI_OPT=1 ./y.sh build
204234

205235
- name: Package prebuilt cg_clif
206236
run: tar cvfJ cg_clif.tar.xz dist

compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
1919

2020
- name: Prepare dependencies
21-
run: ./y.rs prepare
21+
run: ./y.sh prepare
2222

2323
- name: Test
2424
run: ./scripts/test_bootstrap.sh
@@ -38,7 +38,7 @@ jobs:
3838
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
3939

4040
- name: Prepare dependencies
41-
run: ./y.rs prepare
41+
run: ./y.sh prepare
4242

4343
- name: Test
4444
run: ./scripts/test_rustc_tests.sh

compiler/rustc_codegen_cranelift/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/target
2+
/build_system/target
23
**/*.rs.bk
34
*.rlib
45
*.o

compiler/rustc_codegen_cranelift/.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"rust-analyzer.imports.granularity.enforce": true,
77
"rust-analyzer.imports.granularity.group": "module",
88
"rust-analyzer.imports.prefix": "crate",
9-
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
9+
"rust-analyzer.cargo.features": ["unstable-features"],
1010
"rust-analyzer.linkedProjects": [
1111
"./Cargo.toml",
12+
"./build_system/Cargo.toml",
1213
{
1314
"crates": [
1415
{

0 commit comments

Comments
 (0)