Skip to content

book: fix rust-docs on readthedocs#528

Merged
GuillaumeGomez merged 1 commit intoaskama-rs:masterfrom
Kijewski:pr-no-nightly-rtd
Jul 14, 2025
Merged

book: fix rust-docs on readthedocs#528
GuillaumeGomez merged 1 commit intoaskama-rs:masterfrom
Kijewski:pr-no-nightly-rtd

Conversation

@Kijewski
Copy link
Copy Markdown
Member

We want to use the nightly features doc_cfg and doc_auto_cfg when we build our documentation. Still, we want to use a stable compiler, e.g. to have stable links in our docs, so we opt in to the use of unstable features with the use of RUSTC_BOOTSTRAP=1.

The problem is that proc-macro2 only checks whether it can use any unstable features, not which unstable features, and it always assumes that you run the newest nightly rust version if the use of unstable features is possible.

This PR disables the detection if unstable features are available to proc-macro2 by pretending that we are in an early stage of a bootstrapped rustc build.

We want to use the nightly features `doc_cfg` and `doc_auto_cfg` when we
build our documentation. Still, we want to use a stable compiler, e.g.
to have stable links in our docs, so we opt in to the use of unstable
features with the use of `RUSTC_BOOTSTRAP=1`.

The problem is that `proc-macro2` only checks whether it can use any
unstable features, not which unstable features, and it always assumes
that you run the newest nightly rust version if the use of unstable
features is possible.

This PR disables the detection if unstable features are available to
`proc-macro2` by pretending that we are in an early stage of a
bootstrapped rustc build.
@Kijewski Kijewski added documentation Improvements or additions to documentation bug Something isn't working labels Jul 14, 2025
@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Weird fix but if it works... 😆

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit e876730 into askama-rs:master Jul 14, 2025
42 checks passed
@Kijewski Kijewski deleted the pr-no-nightly-rtd branch July 14, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants