Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running 'cargo doc' on rust stable produces error #18

Closed
stepkun opened this issue Feb 17, 2024 · 3 comments
Closed

running 'cargo doc' on rust stable produces error #18

stepkun opened this issue Feb 17, 2024 · 3 comments

Comments

@stepkun
Copy link

stepkun commented Feb 17, 2024

error[E0554]: #![feature] may not be used on the stable release channel
--> /home/stephan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcode-0.5.1/src/lib.rs:2:18
|
2 | #![cfg_attr(doc, feature(doc_cfg))]
| ^^^^^^^^^^^^^^^^

@caibear
Copy link
Collaborator

caibear commented Feb 17, 2024

This is expected since we used #![feature(dog_cfg)] to show that functions like bitcode::serialize require serde.

If you want to run the docs or tests yourself you'll have to use nightly. To do so, you can run this inside the bitcode project:

rustup override set nightly

@aecsocket
Copy link

This breaks cargo doc for all users of this dependency who use stable Rust, which is counterproductive. Users shouldn't be punished for using stable, and running cargo doc locally is a perfectly valid use case. Consider changing this to something like

#![cfg_attr(any(nightly, docsrs), feature(doc_cfg, doc_auto_cfg))]

I use this in my own stable crate, and it lets me run cargo doc just fine while still enabling doc_cfg on docs.rs.

caibear added a commit that referenced this issue Mar 1, 2024
@caibear
Copy link
Collaborator

caibear commented Mar 1, 2024

This has been fixed on the latest alpha version bitcode = "=0.6.0-alpha.2".

@caibear caibear closed this as completed Mar 1, 2024
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

No branches or pull requests

3 participants