Skip to content

Guidance for dealing with outdated compiler on docs.rs #2692

Closed
@lucidBrot

Description

@lucidBrot

Crate name

hexgridspiral

Build failure link

https://docs.rs/crate/hexgridspiral/0.1.1/builds/1587016

Additional details

First of all, this is my first crate ever and I am using latest nightly rust (1.85) so me calling the compiler "outdated" is quite an overstatement.

Goal:
My crate makes use of some features that only work in nightly rust. Luckily, docs.rs is running a nightly version of the compiler. So in theory I can even make it build my docs with the feature flag that enables the nightly code, and then the docs would even show all functions, and annotate some as "nightly only".

Problem:

  • Docs.rs is using rustc 1.84.0-nightly
  • Locally I build with rustc 1.85.0-nightly (0aeaa5eb2 2024-12-14)
  • There is a difference in a nightly feature, meaning the code will only compile with the newer or the older version
  • Explicitly stating the minimum version of rustc does not help: https://docs.rs/crate/hexgridspiral/0.1.2/builds/1587019

Question:
What is the intended way to deal with this?

I would be surprised if I am the only one who uses nightly features. And they are bound to sometimes become unavailable or change language syntax, right?

I was thinking of adding conditional compilation to use a separate version of the code that works only with the old version of rust, just for building the docs, but then I would have to lie in the rust-version field (or remove it).

But i can also not really ask you to please upgrade the compiler version. Because then all crates that use the older version of that nightly feature would fail...

The code in question is here - the signature of steps_between is in 1.85 a tuple but in 1.84 it was just a single Option<usize>.

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