Skip to content

Commit c28823f

Browse files
committed
Update for review comments.
1 parent f3faa97 commit c28823f

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fn rustc<'a, 'cfg>(
283283
&package_id,
284284
&target,
285285
mode,
286-
&mut json_stdout,
286+
&mut assert_is_empty,
287287
&mut |line| json_stderr(line, &package_id, &target),
288288
).map_err(Internal::new)
289289
.chain_err(|| format!("Could not compile `{}`.", name))?;
@@ -640,7 +640,7 @@ fn rustdoc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoResult
640640
let exec_result = if json_messages {
641641
rustdoc
642642
.exec_with_streaming(
643-
&mut json_stdout,
643+
&mut assert_is_empty,
644644
&mut |line| json_stderr(line, &package_id, &target),
645645
false,
646646
).map(drop)
@@ -988,7 +988,7 @@ impl Kind {
988988
}
989989
}
990990

991-
fn json_stdout(line: &str) -> CargoResult<()> {
991+
fn assert_is_empty(line: &str) -> CargoResult<()> {
992992
if !line.is_empty() {
993993
Err(internal(&format!(
994994
"compiler stdout is not empty: `{}`",

tests/testsuite/doc.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,22 +1359,22 @@ fn doc_private_items() {
13591359
assert_that(&foo.root().join("target/doc/foo/private/index.html"), existing_file());
13601360
}
13611361

1362+
const BAD_INTRA_LINK_LIB: &'static str = r#"
1363+
#![deny(intra_doc_link_resolution_failure)]
1364+
1365+
/// [bad_link]
1366+
pub fn foo() {}
1367+
"#;
1368+
13621369
#[test]
13631370
fn doc_cap_lints() {
13641371
if !is_nightly() {
13651372
// This can be removed once 1.29 is stable (rustdoc --cap-lints).
13661373
return;
13671374
}
13681375
let a = git::new("a", |p| {
1369-
p.file("Cargo.toml", &basic_lib_manifest("a")).file(
1370-
"src/lib.rs",
1371-
"
1372-
#![deny(intra_doc_link_resolution_failure)]
1373-
1374-
/// [bad_link]
1375-
pub fn foo() {}
1376-
",
1377-
)
1376+
p.file("Cargo.toml", &basic_lib_manifest("a"))
1377+
.file("src/lib.rs", BAD_INTRA_LINK_LIB)
13781378
}).unwrap();
13791379

13801380
let p = project()
@@ -1419,7 +1419,6 @@ fn doc_cap_lints() {
14191419
",
14201420
),
14211421
);
1422-
14231422
}
14241423

14251424
#[test]
@@ -1428,16 +1427,16 @@ fn doc_message_format() {
14281427
// This can be removed once 1.30 is stable (rustdoc --error-format stabilized).
14291428
return;
14301429
}
1431-
let p = project().file("src/lib.rs", "asdf").build();
1430+
let p = project().file("src/lib.rs", BAD_INTRA_LINK_LIB).build();
14321431

14331432
assert_that(
14341433
p.cargo("doc --message-format=json"),
14351434
execs().with_status(101).with_json(
14361435
r#"
14371436
{
14381437
"message": {
1439-
"children": [],
1440-
"code": null,
1438+
"children": "{...}",
1439+
"code": "{...}",
14411440
"level": "error",
14421441
"message": "[..]",
14431442
"rendered": "[..]",

0 commit comments

Comments
 (0)