Does thiserror ship an unstable feature so that it does not work with stable rust release?

894 Views Asked by At

I am working on this repo. It builds with no problem on MacOS on a M2 Laptop; but when I try to build it on a Debian desktop, it shows this error:

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-1.0.37/src/lib.rs:238:34
    |
238 | #![cfg_attr(provide_any, feature(provide_any))]
    |                                  ^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `thiserror` due to previous error

So I tried to use nightly build on Debian rustup default nightly, then it builds with no errors.

I'm baffled because thiserror is a popular crate. Is it true that thiserror crate ships with an unstable feature even though it doesn't work with stable rust? Does that mean that most rust developers use the nightly version instead of the stable version?

But then why it works for me on a Mac? I'm pretty sure I have the stable version on the Mac.

There must be something I'm missing :) Thank you in advance!

1

There are 1 best solutions below

0
chunjiw On BEST ANSWER

As commented above by @SirDarius, just remove the target directory and the crate rebuilds without issue.