-
Notifications
You must be signed in to change notification settings - Fork 19
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
Expose the internal SimpleMessage
struct and allow creating std::io::Error
s with them
#205
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Comments
dead-claudia
added
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
labels
Apr 7, 2023
We discussed this in today's @rust-lang/libs-api meeting. We were in favor of adding the macro for this, and not stabilizing |
joshtriplett
added
the
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
label
Oct 1, 2024
@joshtriplett Is there a tracking issue or PR I can follow? |
4 tasks
joboet
added a commit
to joboet/rust
that referenced
this issue
Nov 25, 2024
ACP: rust-lang/libs-team#205 Tracking issue: rust-lang#133448
joboet
added a commit
to joboet/rust
that referenced
this issue
Nov 25, 2024
ACP: rust-lang/libs-team#205 Tracking issue: rust-lang#133448
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Nov 26, 2024
std: expose `const_io_error!` as `const_error!` ACP: rust-lang/libs-team#205 Tracking issue: rust-lang#133448 Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 27, 2024
std: expose `const_io_error!` as `const_error!` ACP: rust-lang/libs-team#205 Tracking issue: rust-lang#133448 Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 27, 2024
Rollup merge of rust-lang#133449 - joboet:io_const_error, r=tgross35 std: expose `const_io_error!` as `const_error!` ACP: rust-lang/libs-team#205 Tracking issue: rust-lang#133448 Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Proposal
Problem statement
I'd like a way to define lightweight custom I/O errors that don't require allocation.
Motivation, use-cases
#![no_std]
compatibility forstd::io::Error
sFor some prior art and additional motivation:
const_io_error!
is already in broad use instd
, with about 50 hits in a brief search: https://github.com/rust-lang/rust/search?q=const_io_error\bError::new\(\s*((std::)?io::)?ErrorKind::\w+\s*,\s*"
, with 14.2k results across 2.1k repos being of kindOther
: https://sourcegraph.com/search?q=context:global+/%5CbError::new%5C%28%5Cs*%28%28std::%29%3Fio::%29%3FErrorKind::Other%5Cs*%2C%5Cs*%22/+count:all+timeout:10s&patternType=standard&case=yes&sm=0&groupBy=repoSolution sketches
SimpleMessage
struct as a way to provide lightweight errors along with animpl From<&'static SimpleMessage> for Error
.const_io_error!
to simplify construction ofSimpleMessage
-based errors, and default its$kind
toErrorKind::Other
if not given.Links and related work
std::error::Error
->core::error::Error
Tracking Issue forError
incore
rust#103765 + Move Error trait into core rust#99917What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals in its weekly meeting. You should receive feedback within a week or two.
The text was updated successfully, but these errors were encountered: