Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #119557

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
af44e71
Switch from using `//~ERROR` annotations with `--error-format` to `er…
Rajveer100 Dec 21, 2023
0f9baa8
custom mir: make it clear what the return block is
RalfJung Dec 26, 2023
4bf2794
custom mir: better type-checking
RalfJung Dec 26, 2023
7e3f5f8
Use Result::flatten in catch_with_exit_code
DaniPopes Dec 28, 2023
786e0bb
bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo
xry111 Dec 29, 2023
5a08ba6
No need to record movability in deferred_coroutine_interiors
compiler-errors Dec 29, 2023
71dacdf
Don't create interior type variable in check_closure
compiler-errors Dec 29, 2023
7eeaaa2
Compute yield and return types outside of check_fn
compiler-errors Dec 29, 2023
c21cfe8
don't reexport atomic::ordering via rustc_data_structures, use std im…
klensy Jan 2, 2024
695a02e
Don't synthesize host effect args inside trait object types
fmease Jan 3, 2024
4e0badd
Recover parentheses in range patterns
ShE3py Jan 3, 2024
7aaa1eb
Rollup merge of #119184 - Rajveer100:branch-for-issue-118752, r=david…
matthiaskrgr Jan 3, 2024
2d62db7
Rollup merge of #119325 - RalfJung:custom-mir, r=compiler-errors
matthiaskrgr Jan 3, 2024
5903e6a
Rollup merge of #119391 - DaniPopes:catch-flatten, r=davidtwco
matthiaskrgr Jan 3, 2024
39b4731
Rollup merge of #119397 - ShE3py:pat-range-paren-recovery, r=fmease
matthiaskrgr Jan 3, 2024
048081c
Rollup merge of #119414 - xry111:xry111/lto-test, r=Mark-Simulacrum
matthiaskrgr Jan 3, 2024
83a3441
Rollup merge of #119417 - compiler-errors:closure-checking, r=davidtwco
matthiaskrgr Jan 3, 2024
82ec223
Rollup merge of #119527 - klensy:ordering, r=compiler-errors
matthiaskrgr Jan 3, 2024
c5e375c
Rollup merge of #119540 - fmease:no-effect-args-inside-dyn-trait, r=c…
matthiaskrgr Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo
It prevents a full rebuild of stage 1 compiler when issuing "x.py test"
with rust.lto != thin-local in config.toml.
  • Loading branch information
xry111 committed Dec 29, 2023
commit 786e0bb1dcfdb9deee31ae7b181692467191ea2a
56 changes: 28 additions & 28 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,34 +905,6 @@ impl Step for Rustc {
));
}

// We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
// and may just be a time sink.
if compiler.stage != 0 {
match builder.config.rust_lto {
RustcLto::Thin | RustcLto::Fat => {
// Since using LTO for optimizing dylibs is currently experimental,
// we need to pass -Zdylib-lto.
cargo.rustflag("-Zdylib-lto");
// Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
// compiling dylibs (and their dependencies), even when LTO is enabled for the
// crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
let lto_type = match builder.config.rust_lto {
RustcLto::Thin => "thin",
RustcLto::Fat => "fat",
_ => unreachable!(),
};
cargo.rustflag(&format!("-Clto={lto_type}"));
cargo.rustflag("-Cembed-bitcode=yes");
}
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
RustcLto::Off => {
cargo.rustflag("-Clto=off");
}
}
} else if builder.config.rust_lto == RustcLto::Off {
cargo.rustflag("-Clto=off");
}

for krate in &*self.crates {
cargo.arg("-p").arg(krate);
}
Expand Down Expand Up @@ -989,6 +961,34 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec

cargo.rustdocflag("-Zcrate-attr=warn(rust_2018_idioms)");

// We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
// and may just be a time sink.
if stage != 0 {
match builder.config.rust_lto {
RustcLto::Thin | RustcLto::Fat => {
// Since using LTO for optimizing dylibs is currently experimental,
// we need to pass -Zdylib-lto.
cargo.rustflag("-Zdylib-lto");
// Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
// compiling dylibs (and their dependencies), even when LTO is enabled for the
// crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
let lto_type = match builder.config.rust_lto {
RustcLto::Thin => "thin",
RustcLto::Fat => "fat",
_ => unreachable!(),
};
cargo.rustflag(&format!("-Clto={lto_type}"));
cargo.rustflag("-Cembed-bitcode=yes");
}
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
RustcLto::Off => {
cargo.rustflag("-Clto=off");
}
}
} else if builder.config.rust_lto == RustcLto::Off {
cargo.rustflag("-Clto=off");
}

rustc_cargo_env(builder, cargo, target, stage);
}

Expand Down