Skip to content

Commit c3f7069

Browse files
committed
Auto merge of #1709 - hyd-dev:rlib, r=RalfJung
[cargo-miri] Don't skip `rlib` crates Fixes #1691.
2 parents 7ac8be8 + 0737de8 commit c3f7069

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

cargo-miri/bin.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -596,16 +596,13 @@ fn phase_cargo_rustc(args: env::Args) {
596596
let target_crate = is_target_crate();
597597
let print = get_arg_flag_value("--print").is_some(); // whether this is cargo passing `--print` to get some infos
598598

599-
// rlib and cdylib are just skipped, we cannot interpret them and do not need them
599+
// cdylib is just skipped, we cannot interpret it and do not need it
600600
// for the rest of the build either.
601-
match get_arg_flag_value("--crate-type").as_deref() {
602-
Some("rlib") | Some("cdylib") => {
603-
if verbose {
604-
eprint!("[cargo-miri rustc] (rlib/cdylib skipped)");
605-
}
606-
return;
601+
if get_arg_flag_value("--crate-type").as_deref() == Some("cdylib") {
602+
if verbose {
603+
eprint!("[cargo-miri rustc] (cdylib skipped)");
607604
}
608-
_ => {},
605+
return;
609606
}
610607

611608
let store_json = |info: CrateRunInfo| {

test-cargo-miri/Cargo.lock

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-cargo-miri/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ edition = "2018"
99

1010
[dependencies]
1111
byteorder = "1.0"
12-
issue_1567 = { path ="issue-1567" }
12+
issue_1567 = { path = "issue-1567" }
13+
issue_1691 = { path = "issue-1691" }
1314

1415
[dev-dependencies]
1516
rand = { version = "0.7", features = ["small_rng"] }

test-cargo-miri/issue-1691/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "issue_1691"
3+
version = "0.1.0"
4+
authors = ["Miri Team"]
5+
edition = "2018"
6+
7+
[lib]
8+
crate-type = ["rlib"]

test-cargo-miri/issue-1691/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub fn use_me() -> bool {
2+
true
3+
}

test-cargo-miri/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
/// assert!(cargo_miri_test::make_true());
44
/// ```
55
pub fn make_true() -> bool {
6-
true
6+
issue_1691::use_me()
77
}

0 commit comments

Comments
 (0)