rust-lang/docs.rs

crate fails to build documentation

Closed this issue · 2 comments

Crate name

rumtk-hl7-v2

Build failure link

https://docs.rs/crate/rumtk-hl7-v2/0.8.1/builds

Additional details

Earlier in the year, the nightly compilers began to break when building my project. As a result, I included a rust-toolchain.toml file to fix the correct compiler to use. I use the nightly compiler because I have to for the purpose of fuzz testing. I can get the core crate to compile on docs.rs (see rumtk-core)

Contents of my TOML

[toolchain]
channel = "nightly-2025-04-03"

Cargo.toml

[package]
name = "rumtk-hl7-v2"
description = "HL7 V2 Parser and MLLP Implementation to support building interface utilities."
version = "0.8.1"
readme = "README.md"
license = "LGPL-2.1"
homepage = "https://github.com/luissantosHCIT/rumtk/tree/main/toolkit/rumtk-hl7-v2"
documentation = "https://docs.rs/rumtk-hl7-v2"
repository = "https://github.com/luissantosHCIT/rumtk"
keywords = ["rumtk", "healthcare", "hl7", "v2"]
categories = ["parsing", "science", "parser-implementations"]
edition = "2021"
rust-version = "1.79.0"

[dependencies]
phf = "0.12.1"
phf_macros = "0.12.1"
chrono = "0.4.39"
once_cell = "1.20.2"
serde = { version = "1.0.219", features = ["derive", "std"] }
serde_json = "1.0.140"
#rumtk-core = { path = "../rumtk-core" }
tokio = { version = "1.45.0", features = ["full"] }
pyo3 = { version = "0.27.1", features = ["default", "auto-initialize", "serde"] }
rumtk-core = "0.9.1"
pyo3-ffi = "0.27.1"

I do not understand why the nightlies are breaking so my questions are:

  1. Could docs.rs be updated to respect the toolchain toml for the purpose of building the crate?
  2. If not, what do you think I could do to fix the conflict with new compilers moving forward?

Log => https://docs.rs/crate/rumtk-hl7-v2/0.8.1/builds/2635527

# rustc version
rustc 1.93.0-nightly (20383c9f1 2025-11-03)# docs.rs version
docsrs 0.6.0 (fb84acf8 2025-11-04)# build log
[INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace/builds/rumtk-hl7-v2-0.8.1/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace/builds/rumtk-hl7-v2-0.8.1/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:4848fb76d95f26979359cc7e45710b1dbc8f3acb7aeedee7c460d7702230f228" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--output-format\", \"json\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }`
[INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
[INFO] [stdout] 90de858db912d4b071ee7464d9843c9537f01ee25032e35dc3e348c1bd1d940f
[INFO] running `Command { std: "docker" "start" "-a" "90de858db912d4b071ee7464d9843c9537f01ee25032e35dc3e348c1bd1d940f", kill_on_drop: false }`
[INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op
[INFO] [stderr]  Documenting rumtk-hl7-v2 v0.8.1 (/opt/rustwide/workdir)
[INFO] [stderr] warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
[INFO] [stderr]   --> src/lib.rs:20:12
[INFO] [stderr]    |
[INFO] [stderr] 20 | #![feature(inherent_associated_types)]
[INFO] [stderr]    |            ^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stderr]    |
[INFO] [stderr]    = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
[INFO] [stderr]    = note: `#[warn(incomplete_features)]` on by default
[INFO] [stderr] 
[INFO] [stderr] warning: type `V2_SEARCH_EXPR_TYPE` should have an upper camel case name
[INFO] [stderr]    --> src/hl7_v2_constants.rs:743:10
[INFO] [stderr]     |
[INFO] [stderr] 743 | pub enum V2_SEARCH_EXPR_TYPE {
[INFO] [stderr]     |          ^^^^^^^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `V2SearchExprType`
[INFO] [stderr]     |
[INFO] [stderr]     = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default
[INFO] [stderr] 
[INFO] [stderr] warning: variant `V2_DEFAULT` should have an upper camel case name
[INFO] [stderr]    --> src/hl7_v2_constants.rs:744:5
[INFO] [stderr]     |
[INFO] [stderr] 744 |     V2_DEFAULT
[INFO] [stderr]     |     ^^^^^^^^^^ help: convert the identifier to upper camel case: `V2Default`
[INFO] [stderr] 
[INFO] [stderr] warning: type `MLLP_FILTER_POLICY` should have an upper camel case name
[INFO] [stderr]    --> src/hl7_v2_mllp.rs:458:14
[INFO] [stderr]     |
[INFO] [stderr] 458 |     pub enum MLLP_FILTER_POLICY {
[INFO] [stderr]     |              ^^^^^^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `MllpFilterPolicy`
[INFO] [stderr] 
[INFO] [stderr] warning: variant `ESCAPE_INPUT` should have an upper camel case name
[INFO] [stderr]    --> src/hl7_v2_mllp.rs:469:9
[INFO] [stderr]     |
[INFO] [stderr] 469 |         ESCAPE_INPUT = 1,
[INFO] [stderr]     |         ^^^^^^^^^^^^ help: convert the identifier to upper camel case: `EscapeInput`
[INFO] [stderr] 
[INFO] [stderr] warning: variant `FILTER_INPUT` should have an upper camel case name
[INFO] [stderr]    --> src/hl7_v2_mllp.rs:473:9
[INFO] [stderr]     |
[INFO] [stderr] 473 |         FILTER_INPUT = 2,
[INFO] [stderr]     |         ^^^^^^^^^^^^ help: convert the identifier to upper camel case: `FilterInput`
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_base_types::v2_base_types::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_base_types::v2_base_types::V2ParserCharacters>::deserialize::__FieldVisitor` in the current scope
[INFO] [stderr]   --> src/hl7_v2_base_types.rs:51:32
[INFO] [stderr]    |
[INFO] [stderr] 51 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]    |                                ^^^^^^^^^^^
[INFO] [stderr]    |                                |
[INFO] [stderr]    |                                associated item not found in `hl7_v2_base_types::v2_base_types::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_base_types::v2_base_types::V2ParserCharacters>::deserialize::__FieldVisitor`
[INFO] [stderr]    |                                associated type `Value` not found for this struct
[INFO] [stderr]    |
[INFO] [stderr]    = note: the associated type was found for
[INFO] [stderr]            
[INFO] [stderr]    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_base_types::v2_base_types::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_base_types::v2_base_types::V2ParserCharacters>::deserialize::__Visitor<'de>` in the current scope
[INFO] [stderr]   --> src/hl7_v2_base_types.rs:51:32
[INFO] [stderr]    |
[INFO] [stderr] 51 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]    |                                ^^^^^^^^^^^
[INFO] [stderr]    |                                |
[INFO] [stderr]    |                                associated item not found in `hl7_v2_base_types::v2_base_types::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_base_types::v2_base_types::V2ParserCharacters>::deserialize::__Visitor<'de>`
[INFO] [stderr]    |                                associated type `Value` not found for this struct
[INFO] [stderr]    |
[INFO] [stderr]    = note: the associated type was found for
[INFO] [stderr]            
[INFO] [stderr]    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Component>::deserialize::__FieldVisitor` in the current scope
[INFO] [stderr]   --> src/hl7_v2_parser.rs:96:32
[INFO] [stderr]    |
[INFO] [stderr] 96 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]    |                                ^^^^^^^^^^^
[INFO] [stderr]    |                                |
[INFO] [stderr]    |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Component>::deserialize::__FieldVisitor`
[INFO] [stderr]    |                                associated type `Value` not found for this struct
[INFO] [stderr]    |
[INFO] [stderr]    = note: the associated type was found for
[INFO] [stderr]            
[INFO] [stderr]    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Component>::deserialize::__Visitor<'de>` in the current scope
[INFO] [stderr]   --> src/hl7_v2_parser.rs:96:32
[INFO] [stderr]    |
[INFO] [stderr] 96 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]    |                                ^^^^^^^^^^^
[INFO] [stderr]    |                                |
[INFO] [stderr]    |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Component>::deserialize::__Visitor<'de>`
[INFO] [stderr]    |                                associated type `Value` not found for this struct
[INFO] [stderr]    |
[INFO] [stderr]    = note: the associated type was found for
[INFO] [stderr]            
[INFO] [stderr]    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Field>::deserialize::__FieldVisitor` in the current scope
[INFO] [stderr]    --> src/hl7_v2_parser.rs:214:32
[INFO] [stderr]     |
[INFO] [stderr] 214 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]     |                                ^^^^^^^^^^^
[INFO] [stderr]     |                                |
[INFO] [stderr]     |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Field>::deserialize::__FieldVisitor`
[INFO] [stderr]     |                                associated type `Value` not found for this struct
[INFO] [stderr]     |
[INFO] [stderr]     = note: the associated type was found for
[INFO] [stderr]             
[INFO] [stderr]     = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Field>::deserialize::__Visitor<'de>` in the current scope
[INFO] [stderr]    --> src/hl7_v2_parser.rs:214:32
[INFO] [stderr]     |
[INFO] [stderr] 214 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]     |                                ^^^^^^^^^^^
[INFO] [stderr]     |                                |
[INFO] [stderr]     |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Field>::deserialize::__Visitor<'de>`
[INFO] [stderr]     |                                associated type `Value` not found for this struct
[INFO] [stderr]     |
[INFO] [stderr]     = note: the associated type was found for
[INFO] [stderr]             
[INFO] [stderr]     = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Segment>::deserialize::__FieldVisitor` in the current scope
[INFO] [stderr]    --> src/hl7_v2_parser.rs:308:32
[INFO] [stderr]     |
[INFO] [stderr] 308 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]     |                                ^^^^^^^^^^^
[INFO] [stderr]     |                                |
[INFO] [stderr]     |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Segment>::deserialize::__FieldVisitor`
[INFO] [stderr]     |                                associated type `Value` not found for this struct
[INFO] [stderr]     |
[INFO] [stderr]     = note: the associated type was found for
[INFO] [stderr]             
[INFO] [stderr]     = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Segment>::deserialize::__Visitor<'de>` in the current scope
[INFO] [stderr]    --> src/hl7_v2_parser.rs:308:32
[INFO] [stderr]     |
[INFO] [stderr] 308 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]     |                                ^^^^^^^^^^^
[INFO] [stderr]     |                                |
[INFO] [stderr]     |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Segment>::deserialize::__Visitor<'de>`
[INFO] [stderr]     |                                associated type `Value` not found for this struct
[INFO] [stderr]     |
[INFO] [stderr]     = note: the associated type was found for
[INFO] [stderr]             
[INFO] [stderr]     = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Message>::deserialize::__FieldVisitor` in the current scope
[INFO] [stderr]    --> src/hl7_v2_parser.rs:440:32
[INFO] [stderr]     |
[INFO] [stderr] 440 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]     |                                ^^^^^^^^^^^
[INFO] [stderr]     |                                |
[INFO] [stderr]     |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Message>::deserialize::__FieldVisitor`
[INFO] [stderr]     |                                associated type `Value` not found for this struct
[INFO] [stderr]     |
[INFO] [stderr]     = note: the associated type was found for
[INFO] [stderr]             
[INFO] [stderr]     = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] error[E0220]: associated type `Value` not found for `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Message>::deserialize::__Visitor<'de>` in the current scope
[INFO] [stderr]    --> src/hl7_v2_parser.rs:440:32
[INFO] [stderr]     |
[INFO] [stderr] 440 |     #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
[INFO] [stderr]     |                                ^^^^^^^^^^^
[INFO] [stderr]     |                                |
[INFO] [stderr]     |                                associated item not found in `hl7_v2_parser::v2_parser::_::<impl hl7_v2_base_types::v2_base_types::_::_serde::Deserialize<'de> for hl7_v2_parser::v2_parser::V2Message>::deserialize::__Visitor<'de>`
[INFO] [stderr]     |                                associated type `Value` not found for this struct
[INFO] [stderr]     |
[INFO] [stderr]     = note: the associated type was found for
[INFO] [stderr]             
[INFO] [stderr]     = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stderr] 
[INFO] [stderr] For more information about this error, try `rustc --explain E0220`.
[INFO] [stderr] warning: `rumtk-hl7-v2` (lib doc) generated 6 warnings
[INFO] [stderr] error: could not document `rumtk-hl7-v2`
[INFO] running `Command { std: "docker" "inspect" "90de858db912d4b071ee7464d9843c9537f01ee25032e35dc3e348c1bd1d940f", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "90de858db912d4b071ee7464d9843c9537f01ee25032e35dc3e348c1bd1d940f", kill_on_drop: false }`
[INFO] [stdout] 90de858db912d4b071ee7464d9843c9537f01ee25032e35dc3e348c1bd1d940f

Thank you for your help!

syphar commented

Hi,

docs.rs (and crater, for that matter), intentionally remove toolchain overrides (rust-lang/rustwide#60).

Generally this is because we rely on nightly rustdoc features specifically built & updated for docs.rs. So even if we make that configurable, there would be a "minimum" version we have to enforce. Stable / beta are out of the question right now, this would mean the features we need have to go through the release process.

See also:

So

Could docs.rs be updated to respect the toolchain toml for the purpose of building the crate?

With nontrivial effort, necessary design, and limited usefulness. So unlikely in the short-term.

If not, what do you think I could do to fix the conflict with new compilers moving forward?

That's a question for the compiler-people, right? You can create an issue there.
I myself can't really say much about that, only ever worked with docs.rs & crates.io.

I'm closing this issue, partially as duplicate to the links above, partially because you're talking about compiler errors.

For anybody that gets in a similar situation, see my compiler issue rust-lang/rust#148535

It turns out to be due to an attempt to nest type declarations inside impl blocks and activation of its associated (granted unstable) feature #![feature(inherent_associated_types)].

There's more information over there and a whole lot of other threads to explore!