Skip to content

Commit fdf6cc3

Browse files
Lukas MarkeffskyMark-Simulacrum
Lukas Markeffsky
authored andcommitted
delete more cfg(bootstrap)
1 parent 1119127 commit fdf6cc3

File tree

4 files changed

+22
-38
lines changed

4 files changed

+22
-38
lines changed

library/std/src/process.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,18 +2164,11 @@ pub fn id() -> u32 {
21642164
/// to provide similar functionality.
21652165
#[cfg_attr(not(test), lang = "termination")]
21662166
#[stable(feature = "termination_trait_lib", since = "1.61.0")]
2167-
#[rustc_on_unimplemented(
2168-
on(
2169-
all(not(bootstrap), cause = "MainFunctionType"),
2170-
message = "`main` has invalid return type `{Self}`",
2171-
label = "`main` can only return types that implement `{Termination}`"
2172-
),
2173-
on(
2174-
bootstrap,
2175-
message = "`main` has invalid return type `{Self}`",
2176-
label = "`main` can only return types that implement `{Termination}`"
2177-
)
2178-
)]
2167+
#[rustc_on_unimplemented(on(
2168+
cause = "MainFunctionType",
2169+
message = "`main` has invalid return type `{Self}`",
2170+
label = "`main` can only return types that implement `{Termination}`"
2171+
))]
21792172
pub trait Termination {
21802173
/// Is called to get the representation of the value as status code.
21812174
/// This status code is returned to the operating system.

library/std/src/sys/unix/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
184184
sigpipe::SIG_DFL => (true, Some(libc::SIG_DFL)),
185185
_ => unreachable!(),
186186
};
187-
// The bootstrap compiler doesn't know about sigpipe::DEFAULT, and always passes in
188-
// SIG_IGN. This causes some tests to fail because they expect SIGPIPE to be reset to
189-
// default on process spawning (which doesn't happen if #[unix_sigpipe] is specified).
190-
// Since we can't differentiate between the cases here, treat SIG_IGN as DEFAULT
191-
// unconditionally.
192-
if sigpipe_attr_specified && !(cfg!(bootstrap) && sigpipe == sigpipe::SIG_IGN) {
187+
if sigpipe_attr_specified {
193188
UNIX_SIGPIPE_ATTR_SPECIFIED.store(true, crate::sync::atomic::Ordering::Relaxed);
194189
}
195190
if let Some(handler) = handler {

library/std/tests/run-time-detect.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![cfg_attr(
44
any(
55
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
6-
all(bootstrap, target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
76
all(target_arch = "powerpc", target_os = "linux"),
87
all(target_arch = "powerpc64", target_os = "linux"),
98
),

src/bootstrap/compile.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -691,26 +691,23 @@ impl Step for Rustc {
691691
));
692692
}
693693

694-
// cfg(bootstrap): remove if condition once the bootstrap compiler supports dylib LTO
695-
if compiler.stage != 0 {
696-
match builder.config.rust_lto {
697-
RustcLto::Thin | RustcLto::Fat => {
698-
// Since using LTO for optimizing dylibs is currently experimental,
699-
// we need to pass -Zdylib-lto.
700-
cargo.rustflag("-Zdylib-lto");
701-
// Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
702-
// compiling dylibs (and their dependencies), even when LTO is enabled for the
703-
// crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
704-
let lto_type = match builder.config.rust_lto {
705-
RustcLto::Thin => "thin",
706-
RustcLto::Fat => "fat",
707-
_ => unreachable!(),
708-
};
709-
cargo.rustflag(&format!("-Clto={}", lto_type));
710-
cargo.rustflag("-Cembed-bitcode=yes");
711-
}
712-
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
694+
match builder.config.rust_lto {
695+
RustcLto::Thin | RustcLto::Fat => {
696+
// Since using LTO for optimizing dylibs is currently experimental,
697+
// we need to pass -Zdylib-lto.
698+
cargo.rustflag("-Zdylib-lto");
699+
// Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
700+
// compiling dylibs (and their dependencies), even when LTO is enabled for the
701+
// crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
702+
let lto_type = match builder.config.rust_lto {
703+
RustcLto::Thin => "thin",
704+
RustcLto::Fat => "fat",
705+
_ => unreachable!(),
706+
};
707+
cargo.rustflag(&format!("-Clto={}", lto_type));
708+
cargo.rustflag("-Cembed-bitcode=yes");
713709
}
710+
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
714711
}
715712

716713
builder.info(&format!(

0 commit comments

Comments
 (0)