Skip to content

Commit c3e422c

Browse files
committed
Remove embed-bitcode check now that it is on stable.
1 parent c004bf9 commit c3e422c

File tree

4 files changed

+2
-83
lines changed

4 files changed

+2
-83
lines changed

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ pub struct TargetInfo {
4040
pub rustflags: Vec<String>,
4141
/// Extra flags to pass to `rustdoc`, see `env_args`.
4242
pub rustdocflags: Vec<String>,
43-
/// Remove this when it hits stable (1.45)
44-
pub supports_embed_bitcode: Option<bool>,
4543
}
4644

4745
/// Kind of each file generated by a Unit, part of `FileType`.
@@ -143,13 +141,6 @@ impl TargetInfo {
143141
.args(&rustflags)
144142
.env_remove("RUSTC_LOG");
145143

146-
let mut embed_bitcode_test = process.clone();
147-
embed_bitcode_test.arg("-Cembed-bitcode");
148-
let supports_embed_bitcode = match kind {
149-
CompileKind::Host => Some(rustc.cached_output(&embed_bitcode_test).is_ok()),
150-
_ => None,
151-
};
152-
153144
if let CompileKind::Target(target) = kind {
154145
process.arg("--target").arg(target.rustc_target());
155146
}
@@ -240,7 +231,6 @@ impl TargetInfo {
240231
"RUSTDOCFLAGS",
241232
)?,
242233
cfg,
243-
supports_embed_bitcode,
244234
})
245235
}
246236

src/cargo/core/compiler/mod.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -817,31 +817,10 @@ fn build_base_args(
817817
}
818818
lto::Lto::ObjectAndBitcode => {} // this is rustc's default
819819
lto::Lto::OnlyBitcode => {
820-
// Note that this compiler flag, like the one below, is just an
821-
// optimization in terms of build time. If we don't pass it then
822-
// both object code and bitcode will show up. This is lagely just
823-
// compat until the feature lands on stable and we can remove the
824-
// conditional branch.
825-
if cx
826-
.bcx
827-
.target_data
828-
.info(CompileKind::Host)
829-
.supports_embed_bitcode
830-
.unwrap()
831-
{
832-
cmd.arg("-Clinker-plugin-lto");
833-
}
820+
cmd.arg("-Clinker-plugin-lto");
834821
}
835822
lto::Lto::OnlyObject => {
836-
if cx
837-
.bcx
838-
.target_data
839-
.info(CompileKind::Host)
840-
.supports_embed_bitcode
841-
.unwrap()
842-
{
843-
cmd.arg("-Cembed-bitcode=no");
844-
}
823+
cmd.arg("-Cembed-bitcode=no");
845824
}
846825
}
847826

tests/testsuite/lto.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ use std::process::Output;
55

66
#[cargo_test]
77
fn with_deps() {
8-
if !cargo_test_support::is_nightly() {
9-
return;
10-
}
11-
128
Package::new("bar", "0.0.1").publish();
139

1410
let p = project()
@@ -36,10 +32,6 @@ fn with_deps() {
3632

3733
#[cargo_test]
3834
fn shared_deps() {
39-
if !cargo_test_support::is_nightly() {
40-
return;
41-
}
42-
4335
Package::new("bar", "0.0.1").publish();
4436

4537
let p = project()
@@ -70,10 +62,6 @@ fn shared_deps() {
7062

7163
#[cargo_test]
7264
fn build_dep_not_ltod() {
73-
if !cargo_test_support::is_nightly() {
74-
return;
75-
}
76-
7765
Package::new("bar", "0.0.1").publish();
7866

7967
let p = project()
@@ -102,10 +90,6 @@ fn build_dep_not_ltod() {
10290

10391
#[cargo_test]
10492
fn complicated() {
105-
if !cargo_test_support::is_nightly() {
106-
return;
107-
}
108-
10993
Package::new("dep-shared", "0.0.1")
11094
.file("src/lib.rs", "pub fn foo() {}")
11195
.publish();
@@ -233,10 +217,6 @@ fn complicated() {
233217

234218
#[cargo_test]
235219
fn off_in_manifest_works() {
236-
if !cargo_test_support::is_nightly() {
237-
return;
238-
}
239-
240220
Package::new("bar", "0.0.1")
241221
.file("src/lib.rs", "pub fn foo() {}")
242222
.publish();
@@ -284,10 +264,6 @@ fn off_in_manifest_works() {
284264

285265
#[cargo_test]
286266
fn between_builds() {
287-
if !cargo_test_support::is_nightly() {
288-
return;
289-
}
290-
291267
let p = project()
292268
.file(
293269
"Cargo.toml",
@@ -325,10 +301,6 @@ fn between_builds() {
325301

326302
#[cargo_test]
327303
fn test_all() {
328-
if !cargo_test_support::is_nightly() {
329-
return;
330-
}
331-
332304
let p = project()
333305
.file(
334306
"Cargo.toml",
@@ -352,10 +324,6 @@ fn test_all() {
352324

353325
#[cargo_test]
354326
fn test_all_and_bench() {
355-
if !cargo_test_support::is_nightly() {
356-
return;
357-
}
358-
359327
let p = project()
360328
.file(
361329
"Cargo.toml",
@@ -495,9 +463,6 @@ fn verify_lto(output: &Output, krate: &str, krate_info: &str, expected_lto: Lto)
495463

496464
#[cargo_test]
497465
fn cdylib_and_rlib() {
498-
if !cargo_test_support::is_nightly() {
499-
return;
500-
}
501466
let p = project_with_dep("'cdylib', 'rlib'");
502467
let output = p.cargo("build --release -v").exec_with_output().unwrap();
503468
verify_lto(
@@ -564,9 +529,6 @@ fn cdylib_and_rlib() {
564529

565530
#[cargo_test]
566531
fn dylib() {
567-
if !cargo_test_support::is_nightly() {
568-
return;
569-
}
570532
let p = project_with_dep("'dylib'");
571533
let output = p.cargo("build --release -v").exec_with_output().unwrap();
572534
verify_lto(&output, "registry", "--crate-type lib", Lto::OnlyObject);
@@ -623,9 +585,6 @@ fn dylib() {
623585

624586
#[cargo_test]
625587
fn test_profile() {
626-
if !cargo_test_support::is_nightly() {
627-
return;
628-
}
629588
Package::new("bar", "0.0.1")
630589
.file("src/lib.rs", "pub fn foo() -> i32 { 123 } ")
631590
.publish();
@@ -677,9 +636,6 @@ fn test_profile() {
677636

678637
#[cargo_test]
679638
fn dev_profile() {
680-
if !cargo_test_support::is_nightly() {
681-
return;
682-
}
683639
// Mixing dev=LTO with test=not-LTO
684640
Package::new("bar", "0.0.1")
685641
.file("src/lib.rs", "pub fn foo() -> i32 { 123 } ")

tests/testsuite/rustc_info_cache.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ use std::env;
66

77
#[cargo_test]
88
fn rustc_info_cache() {
9-
// Needs `-Cbitcode-in-rlib` to ride to stable before this can be enabled
10-
// everywhere.
11-
if !cargo_test_support::is_nightly() {
12-
return;
13-
}
14-
159
let p = project()
1610
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
1711
.build();

0 commit comments

Comments
 (0)