Skip to content

Commit

Permalink
Set Finished line correctly for debug=0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 20, 2019
1 parent cfc61f3 commit a03ae27
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
} else {
"optimized"
});
if profile.debuginfo.is_some() {
if profile.debuginfo.unwrap_or(0) != 0 {
opt_type += " + debuginfo";
}

Expand Down
29 changes: 29 additions & 0 deletions tests/testsuite/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,32 @@ fn panic_unwind_does_not_build_twice() {
)
.run();
}

#[test]
fn debug_0_report() {
// The finished line handles 0 correctly.
let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.0"
[profile.dev]
debug = 0
"#,
)
.file("src/lib.rs", "")
.build();

p.cargo("build -v")
.with_stderr(
"\
[COMPILING] foo v0.1.0 [..]
[RUNNING] `rustc --crate-name foo src/lib.rs [..]-C debuginfo=0 [..]
[FINISHED] dev [unoptimized] target(s) in [..]
",
)
.run();
}

0 comments on commit a03ae27

Please sign in to comment.