Skip to content

fix: Use doc_cfg instead of doc_auto_cfg#34

Merged
RasmusRendal merged 1 commit into
mainfrom
RasmusRendal/doc_cfg
Jun 25, 2026
Merged

fix: Use doc_cfg instead of doc_auto_cfg#34
RasmusRendal merged 1 commit into
mainfrom
RasmusRendal/doc_cfg

Conversation

@RasmusRendal

@RasmusRendal RasmusRendal commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

doc_auto_cfg was removed in rust 1.92.0, and is currently stopping from docs.rs from building (https://docs.rs/crate/rust-telemetry/1.3.0).

Using doc_cfg we get the same feature as doc_auto_cfg used to give us.

Also, hide this behind the docsrs configuration option, to stop absolutely depending on nightly features when building docs.

This commit will not cause docsrs to build rust-telemetry successfully. For this to work, we must update our dependencies (mostly transitive dependencies of OTEL, see #26) to newer versions that do not use doc_auto_cfg either.

But at least, if you depend on rust-telemetry you can now build cargo doc without it crashing.

Testing

I built this on a nightly toolchain with --all-features, and removed the docsrs requirement to get the following:

Screenshot 2026-06-25 at 09-55-17 rust_telemetry - Rust

If I build rust-telemetry with the docsrs configuration option, it will fail because our dependencies still use doc_auto_cfg.

doc_auto_cfg was removed in rust 1.92.0, and is currently stopping from
docs.rs from building (https://docs.rs/crate/rust-telemetry/1.3.0).

Using doc_cfg we get the same feature as doc_auto_cfg used to give us.

Also, hide this behind the `docsrs` configuration option, to stop absolutely
depending on nightly features when building docs.

This commit will not cause docsrs to build rust-telemetry successfully. For
this to work, we must update our dependencies (mostly transitive
dependencies of OTEL, see #26) to newer versions that do not use
`doc_auto_cfg` either.
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.18%. Comparing base (eac2573) to head (97385db).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #34   +/-   ##
=======================================
  Coverage   74.18%   74.18%           
=======================================
  Files           5        5           
  Lines         275      275           
=======================================
  Hits          204      204           
  Misses         71       71           
Files with missing lines Coverage Δ
src/lib.rs 88.29% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eac2573...97385db. Read the comment docs.

@RasmusRendal RasmusRendal marked this pull request as ready for review June 25, 2026 09:11
@RasmusRendal RasmusRendal requested a review from a team as a code owner June 25, 2026 09:11
@RasmusRendal RasmusRendal merged commit 97385db into main Jun 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants