-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
core::error
, no_std
#304
base: master
Are you sure you want to change the base?
core::error
, no_std
#304
Conversation
* master: Release 1.0.61 Format PR 299 with rustfmt also {std -> core}::panic::UnwindSafe use core::fmt instead of std::fmt
Given the wide use of this crate, it seems very unlikely that an MSRV bump would be accepted. |
@dtolnay what's your take on the PR, especially regarding the MSRV question?
|
What if one is just able to somehow pass |
* upstream/master: Upload CI Cargo.lock for reproducing failures Work around new dead code warning in test Release 1.0.63 Update documentation of #[from] and #[backtrace] attributes Release 1.0.62 Support .0.0 nested tuple index Add regression test for issue 309 No need for dead code if struct fields are public Ignore warning on unused struct in test Fill in ignore reasons in all #[ignore] attributes
My personal belief is |
@dtolnay any guidance on how you'd like to see it done? |
PR LGTM with edge case that I don't believe you can import thiserror with a distinct package name with this path (I'm unsure if you could already). |
this code doesn't work with my #![no_std] lib...
|
I am getting a similar one for a bin crate:
Looks like it only happens when
Note the
|
Looks like you already couldn't, at least when using certain attributes, since there's existing use of the
I think this PR would be more likely to be merged if CI would catch this. |
Works like a charm with the above fix on a somewhat large |
Fixed in the commit above. |
now it fails to publish my lib into crates-io
while tests without default features (std disabled) compile and run successfully |
You can't publish if you have git dependencies. |
It might be more palatable if this PR made |
Features are intended to be additive. no-std disables some functionality so it isn't additive. std is additive, and when enabled, maintains the existing MSRV. |
I recognize that typically you want an additive In my view this all depends on the type of release that this change goes out in. If it is a major or minor version bump then msrv 1.81 with backward support via feature is probably fine. If it is just a patch though, it should stay msrv 1.56 w/ a |
Enabling a no-std feature would be a breaking change for some packages already using thiserror.
If this had a no-std feature, it'd be possible for one dependency to enable it in a way which irrecoverably breaks another dependency who relies on the std functionality. This cannot happen with the std feature present here. Since this is a new feature, semver rules would mean this should be done with a minor version bump (satisfying your preferences) yet AFAIK, dtolnay does not follow semver for their crates (at least not all of them). I'd presume this to be released as 1.0.64 accordingly. |
Tests source, from, error and hygiene, like test_source.
error_in_core
has been stabilized in 1.81. This PR builds on the work of #64/#211/#244.std
feature (default enabled) to gate thestd
components (currently onlystd::path
)std::error
orcore::error
to avoid bumping MSRV forstd
.no_std
does require1.81
.It's unclear to me whether it's better to bump the MSRV (
1.56
->1.81
) or use a private re-export of eitherstd::error
orcore::error
(as done here) to keep support forrustc < 1.81
.