-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for Error
in core
#103765
Comments
@rustbot label B-unstable A-error-handling |
Add tracking issue to `error_in_core` This was merged in rust-lang#99917 without a tracking issue, so I'm creating one now: rust-lang#103765
I'm excited about this feature, so if there's anything I can do to help pushing it over the finish line I'd be happy to help. I'm fairly experienced with programming in Rust and I've been silently following various Rust features from RFC to stabilization, but I haven't myself contributed to the compiler or standard library yet. I think this feature could turn out to be a considerable improvement to Rust. There are quite a few small-ish crates out there that only perform well-specified pure-function-like operations. I can imagine that many of these crates could trivially be |
@robamler that would be lovely, I'm happy to hand off and help coordinate that work. I've been focused on governance work since august and haven't had much time for pushing this across the finish line. I believe the current blockers for this are resolving issues in the provider / generic member access APIs This comment by @dtolnay best outlines the issues that still need to be resolved: #99301 (comment) Let me know if you have any further questions. The zulip is probably the best way to reach me quickly. I'm not keeping on top of github notifications right now since I still need to unsubscribe to a bunch of things to turn down the volume of notifications I get daily. |
@yaahc Thank you for the references! Do
(I'll reach out on zulip if I don't get any response here; just wanted to leave this comment here as a kind of documentation in case I can't figure this out and someone else needs to take over.) |
I think in theory we could stabilize error-in-core before provider but I'm worried since we removed |
I see, thanks! So I understand that maybe #99301 should be resolved first. I'm following up with the discussion there. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Add tracking issue to `error_in_core` This was merged in rust-lang/rust#99917 without a tracking issue, so I'm creating one now: rust-lang/rust#103765
In later commits we will need the ability to box a generic error (on pain of drowning in massive sets of generic constraints, blowing up compile time and binary size). Ideally we could just use a Box<dyn error::Error> but the Error trait is not available on std (tracking issue: rust-lang/rust#103765 ). However, when we *do* have std on, we'd like our error traits to work naturally, not lose source information, etc. So we introduce a newtype and have all its internals gated on std vs non-std, and expose internal constructors that must be used on types that implement std::Error when std is on, and implement core::fmt::Display when it's not.
As almost nothing actually depends on std, there is no need to keep a dependency on it. This allows users such as the jid crate to actually be no_std as well. The only exception is std::error::Error, which is now exposed as core::error::Error in nightly but not yet stabilized, see rust-lang/rust#103765
…anieu Stabilize `error_in_core` Closes: rust-lang/rust#103765. `@rustbot` label: +T-libs-api r? libs-api
- use core::Error unstable feature. It's an upcoming stable feature (rust-lang/rust#103765) - remove thiserror dependency. There's no _good_ way to support thiserror in no_std. Definitely not without bringing in some experimental code or forked thiserror crate Change-Id: I245311bb82596fdb3a1912da25a831693370e164
Is this targeted for release for 1.81.0? I see no mention of it in https://releases.rs/docs/1.81.0/ |
It is. You can see in the docs for the beta that the |
it doesn't show up on releases.rs, because the stabiliziation pr #125951 is not marked with the |
## Motivation and Context Smithy-rs CI and our release pipeline have exposed another place, [sdk-adhoc-test](https://github.com/smithy-lang/smithy-rs/tree/main/aws/sdk-adhoc-test), where we should place a Cargo lockfile but we currently don't. Specifically, running `./gradlew aws:sdk-adhoc-test:check`on the current main is encountering the following error: ``` error[E0658]: use of unstable library feature 'error_in_core' --> /opt/cargo/registry/src/index.crates.io-6f17d22bba15001f/idna-1.0.3/src/lib.rs:78:6 | 78 | impl core::error::Error for Errors {} | ^^^^^^^^^^^^^^^^^^ | = note: see issue #103765 <rust-lang/rust#103765> for more information ``` We're supposed to pin `idna` to 0.5.0 ([example](https://github.com/smithy-lang/smithy-rs/blob/62caa4639497bc9b18f57e51a30265899d9b511e/aws/sdk/Cargo.lock#L2812-L2819)), but `sdk-adhoc-test` uses 1.0.3. This PR will fix the problem by copying the checked-in SDK lockfile to `sdk-adhoc-test`. ## Testing - [x] `./gradlew aws:sdk-adhoc-test:check` from the repo root has passed - [ ] Tests in CI ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Fixes the error: ``` Compiling idna v1.0.3 error[E0658]: use of unstable library feature 'error_in_core' --> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/idna-1.0.3/src/lib.rs:78:6 | 78 | impl core::error::Error for Errors {} | ^^^^^^^^^^^^^^^^^^ | = note: see issue #103765 <rust-lang/rust#103765> for more information ```
Fixes the error: ``` Compiling idna v1.0.3 error[E0658]: use of unstable library feature 'error_in_core' --> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/idna-1.0.3/src/lib.rs:78:6 | 78 | impl core::error::Error for Errors {} | ^^^^^^^^^^^^^^^^^^ | = note: see issue #103765 <rust-lang/rust#103765> for more information ```
idna dep of url is failing to compile on stable because default_features is false. std is a default feature that disables the unstable use of error_in_core. error[E0658]: use of unstable library feature 'error_in_core' error: could not compile `idna` (lib) due to previous error rust-lang/rust#103765 https://github.com/servo/rust-url/blob/main/url/Cargo.toml#L35
The semver-check is failing with the following [error](https://github.com/paritytech/polkadot-sdk/actions/runs/11908981132/job/33185572284): ```bash error[E0658]: use of unstable library feature 'error_in_core' --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/frame-decode-0.5.0/src/decoding/extrinsic_decoder.rs:56:6 | 56 | impl core::error::Error for ExtrinsicDecodeError {} | ^^^^^^^^^^^^^^^^^^ | = note: see issue #103765 <rust-lang/rust#103765> for more information = help: add `#![feature(error_in_core)]` to the crate attributes to enable = note: this compiler was built on 2024-05-31; consider upgrading it if it is out of date ``` This is related to the toolchain nightly version 1.80. In rust, 1.81 the `core::error::Error` is stable. After updating the rust-toolchain, parity-publish crate must be updated as well. The `cargo-semver-checks` dependency of `parity-publish` crate is updated from 0.34 to 0.38. This update enables rustdoc v36 that fixes the following [issue](https://github.com/paritytech/polkadot-sdk/actions/runs/11912689841/job/33196936011): ```bash validating prdocs... checking file changes... checking semver changes... (1/18) building frame-support-HEAD... (2/18) building frame-support-28.0.0... Error: rustdoc format v36 for file /__w/polkadot-sdk/polkadot-sdk/target/doc/frame_support.new is not supported ``` This PR is pending on a release of parity-publish to version 0.9.0 (fixes already on origin/master) --------- Signed-off-by: Alexandru Vasile <[email protected]>
(This was merged a while ago without a tracking issue, so I'm creating this one here now.)
Feature gate:
#![feature(error_in_core)]
This is a tracking issue for moving the
Error
trait to thecore
library.Public API
Steps / History
fn backtrace
) #90328error_generic_member_access
: Tracking Issue forerror_generic_member_access
#99301Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: