Auto merge of #1709 - hyd-dev:rlib, r=RalfJung

[cargo-miri] Don't skip `rlib` crates

Fixes #1691.
This commit is contained in:
bors 2021-02-14 12:29:15 +00:00
commit c3f7069a0f
6 changed files with 24 additions and 10 deletions

View File

@ -596,16 +596,13 @@ fn phase_cargo_rustc(args: env::Args) {
let target_crate = is_target_crate();
let print = get_arg_flag_value("--print").is_some(); // whether this is cargo passing `--print` to get some infos
// rlib and cdylib are just skipped, we cannot interpret them and do not need them
// cdylib is just skipped, we cannot interpret it and do not need it
// for the rest of the build either.
match get_arg_flag_value("--crate-type").as_deref() {
Some("rlib") | Some("cdylib") => {
if verbose {
eprint!("[cargo-miri rustc] (rlib/cdylib skipped)");
}
return;
if get_arg_flag_value("--crate-type").as_deref() == Some("cdylib") {
if verbose {
eprint!("[cargo-miri rustc] (cdylib skipped)");
}
_ => {},
return;
}
let store_json = |info: CrateRunInfo| {

View File

@ -12,6 +12,7 @@ version = "0.1.0"
dependencies = [
"byteorder",
"issue_1567",
"issue_1691",
"rand",
"serde_derive",
]
@ -49,6 +50,10 @@ dependencies = [
"byteorder",
]
[[package]]
name = "issue_1691"
version = "0.1.0"
[[package]]
name = "libc"
version = "0.2.81"

View File

@ -9,7 +9,8 @@ edition = "2018"
[dependencies]
byteorder = "1.0"
issue_1567 = { path ="issue-1567" }
issue_1567 = { path = "issue-1567" }
issue_1691 = { path = "issue-1691" }
[dev-dependencies]
rand = { version = "0.7", features = ["small_rng"] }

View File

@ -0,0 +1,8 @@
[package]
name = "issue_1691"
version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"
[lib]
crate-type = ["rlib"]

View File

@ -0,0 +1,3 @@
pub fn use_me() -> bool {
true
}

View File

@ -3,5 +3,5 @@
/// assert!(cargo_miri_test::make_true());
/// ```
pub fn make_true() -> bool {
true
issue_1691::use_me()
}