Skip to content

rustdoc tests failing for 1.32.0 #1776

Closed
@RobbieClarken

Description

@RobbieClarken

Travis-CI failed the build of #1775 due to rustdoc --test generating an error on src/ch14-02-publishing-to-crates-io.md (that file wasn't touched in the PR). It looks like it is an issue with rust 1.32.0. If I run rustdoc locally with 1.31.1 the tests pass but they fail with 1.32.0:

$ rustup run 1.31.1 rustdoc --test src/ch14-02-publishing-to-crates-io.md
...
test result: ok. 1 passed; 0 failed; 5 ignored; 0 measured; 0 filtered out

$ rustup run 1.32.0 rustdoc --test src/ch14-02-publishing-to-crates-io.md

running 6 tests
test src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 247) ... ignored
test src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 278) ... ignored
test src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 314) ... ignored
test src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Making_Useful_Documentation_Comments (line 31) ... ignored
test src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Making_Useful_Documentation_Comments::Commenting_Contained_Items (line 127) ... ignored
test src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 191) ... FAILED

failures:

---- src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 191) stdout ----
error[E0432]: unresolved import `crate::kinds`
  --> src/ch14-02-publishing-to-crates-io.md:213:16
   |
24 |     use crate::kinds::*;
   |                ^^^^^ maybe a missing `extern crate kinds;`?

error[E0433]: failed to resolve: use of undeclared type or module `SecondaryColor`
  --> src/ch14-02-publishing-to-crates-io.md:219:9
   |
30 |         SecondaryColor::Orange
   |         ^^^^^^^^^^^^^^ use of undeclared type or module `SecondaryColor`

error[E0412]: cannot find type `PrimaryColor` in this scope
  --> src/ch14-02-publishing-to-crates-io.md:217:20
   |
28 |     pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
   |                    ^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PrimaryColor` in this scope
  --> src/ch14-02-publishing-to-crates-io.md:217:38
   |
28 |     pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
   |                                      ^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `SecondaryColor` in this scope
  --> src/ch14-02-publishing-to-crates-io.md:217:55
   |
28 |     pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
   |                                                       ^^^^^^^^^^^^^^ not found in this scope

thread 'src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 191)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:323:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    src/ch14-02-publishing-to-crates-io.md - _::Publishing_a_Crate_to_Crates_io::Exporting_a_Convenient_Public_API_with_ (line 191)

test result: FAILED. 0 passed; 1 failed; 5 ignored; 0 measured; 0 filtered out

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions