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

Can't build with stable Rust due to use of include_str! in doc attribute #589

Closed
VyrCossont opened this issue Oct 14, 2021 · 3 comments
Closed

Comments

@VyrCossont
Copy link

Trying to build sysinfo 0.20.5 with stable Rust (currently the 2018 edition) results in the following compiler error, probably introduced by commit 0fdeb16:

error[E0658]: arbitrary expressions in key-value attributes are unstable
  --> /Users/user/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/sysinfo-0.20.5/src/lib.rs:10:10
   |
10 | #![doc = include_str!("../README.md")]
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information
@GuillaumeGomez
Copy link
Owner

It also says in the README:

The minimum-supported version of rustc is 1.54.

The current stable is 1.55 so if you update your version it'll work.

@VyrCossont
Copy link
Author

My mistake, still had 1.53 installed. Thanks for pointing that out.

I'd suggest adding rust-version = "1.54"12 to Cargo.toml to enforce this requirement, but as of today, it's only supported by nightly Cargo behind the rust-version3 feature, and generates a warning on stable Cargo.

Footnotes

  1. RFC: Minimum Supported Rust Version rust-lang/rfcs#2495

  2. https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-rust-version-field

  3. https://doc.rust-lang.org/cargo/reference/unstable.html#rust-version

@GuillaumeGomez
Copy link
Owner

I'm still waiting for it hit stable before adding it. However I'll create an issue to not forget about it. Thanks!

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

2 participants