summary refs log tree commit diff
path: root/library/std/src/io/error.rs
AgeCommit message (Collapse)AuthorLines
2023-10-03Bump version placeholdersMark Rousskov-1/+1
2023-09-22Fixes from PRAyush Singh-4/+4
- Hide Docs - Use repr_unpacked error Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-20PR feedbackBen Kimock-0/+1
2023-09-06Auto merge of #115453 - ibraheemdev:patch-16, r=joshtriplettbors-3/+1
Stabilize `io_error_other` feature Per the FCP for https://github.com/rust-lang/rust/issues/91946.
2023-09-03Move RawOsError defination to sysAyush Singh-1/+1
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-01stabilize `io_error_other` featureIbraheem Ahmed-3/+1
2023-08-25Add a new helper to avoid calling io::Error::kindBen Kimock-0/+10
2023-04-12remove some unneeded importsKaDiWa-1/+0
2023-03-23Rollup merge of #106964 - ↵Matthias Krüger-2/+10
workingjubilee:crouching-ioerror-hidden-documentation, r=ChrisDenton Clarify `Error::last_os_error` can be weird Fundamentally, querying the OS for error codes is a process that is deeply subject to the whims of chance and fortune. We can account for OS, but not for every combination of platform APIs. A compiled binary may not recognize new errors introduced years later. We should clarify a few especially odd situations, and what they mean: We can effectively promise nothing... if you ask for Rust to decode errors where none have occurred. This allows removing mention of ErrorKind::Uncategorized. That error variant is hidden deliberately, so we should not explicitly mention it. This fixes #106937. Since you had an opinion also: Does this solution seem acceptable? r? ``@ChrisDenton``
2023-03-17Remove irrelevant docs on error kindsJubilee Young-10/+4
2023-02-08std: add tracking issue for `RawOsError`joboet-1/+1
2023-01-31std: add type alias for raw OS errorsjoboet-4/+15
Implement rust-lang/libs-team#173.
2023-01-16Explain the "no-error" io::Error caseJubilee Young-2/+16
Fundamentally, querying the OS for error codes is a process that is deeply subject to the whims of chance and fortune. We can account for OS, but not for every combination of platform APIs. A compiled binary may not recognize new errors introduced years later. We should clarify a few especially odd situations, and what they mean: We can effectively promise nothing. This allows removing mention of ErrorKind::Uncategorized. That error variant is hidden quite deliberately, so we should not explicitly mention it.
2022-10-14Rollup merge of #103067 - Nilstrieb:tidy-likes-the-alphabet, r=jackh726Matthias Krüger-1/+2
More alphabetical sorting Sort and enforce a few more things. The biggest change here is sorting all target features.
2022-10-14Add some tidy-alphabeticalnils-1/+2
2022-10-14Tweak grammarJosh Triplett-1/+1
2022-10-07Improved documentation for `std::io::Error`StackOverflowExcept1on-1/+2
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-08-28Rollup merge of #100296 - BlackHoleFox:os-error-aliases, r=thomccMatthias Krüger-0/+2
Add standard C error function aliases to last_os_error This aids the discoverability of `io::Error::last_os_error()` by linking to commonly used error number functions from C/C++. I've seen a few people not realize this exists, so hopefully this helps draw attention to the API to encourage using it over integer error codes.
2022-08-22Move error trait into coreJane Losare-Lusby-0/+9
2022-08-08Add standard C error function aliasesBlackHoleFox-0/+2
Aids the discoverability of `io::Error::last_os_error()` by linking to commonly used error number functions from C/C++.
2022-07-15Apply suggestions from code reviewJane Losare-Lusby-1/+1
2022-07-15Improve example of `downcast`Jiahao XU-3/+4
Co-authored-by: Jane Losare-Lusby <jlusby42@gmail.com>
2022-07-14Rename `std::io::Error::try_downcast_inner` to `downcast`Jiahao XU-4/+4
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23Use `unwrap` instead of `unwrap_unchecked`Jiahao XU-3/+7
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-22Add new unstable API `Error::try_downgrade_inner`Jiahao XU-0/+57
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-7/+7
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-02-24word wrpaDylan DPC-5/+5
2022-02-24word wrpaDylan DPC-6/+9
2022-02-23Update library/std/src/io/error.rsDylan DPC-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2022-02-23add some more summary from pr discussionDylan DPC-1/+1
2022-02-23add some more summary from pr discussionDylan DPC-2/+4
2022-02-23add matching to errorkindDylan DPC-0/+8
2022-02-10Rename to `InvalidFilename`Yuki Okushi-5/+4
2022-02-10Fix description of FilenameInvalidJosh Triplett-1/+1
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2022-02-10Rename `FilenameTooLong` to `FilenameInvalid`Yuki Okushi-2/+2
2022-02-04Add more tests for io::Error packing, and fix some comments that weren't ↵Thom Chiovoloni-0/+4
quite accurate anymore
2022-02-04Update documentation somewhatThom Chiovoloni-0/+10
2022-02-04Elaborate some in the documentation and respond to some review commentsThom Chiovoloni-1/+0
2022-02-04Address address comments, improve comments slightlyThom Chiovoloni-0/+7
2022-02-04Optimize io::error::Repr layout on 64 bit targets.Thom Chiovoloni-4/+11
2022-02-04Hide Repr details from io::Error, and rework `io::Error::new_const`.Thom Chiovoloni-65/+95
2022-01-19`impl Display for io::ErrorKind`Joshua Nelson-1/+17
This avoids having to convert from `ErrorKind` to `Error` just to print the error message.
2021-12-14add `io::Error::other` constructorIbraheem Ahmed-0/+27
2021-12-02Document how `last_os_error` should be usedChris Denton-1/+7
2021-11-21Mention std::io::Error::from(ErrorKind) in Error::new() docsGeorg Brandl-0/+6
This conversion is not very discoverable for the cases where an error is required without extra payload.
2021-10-30Add #[must_use] to remaining std functions (A-N)John Kugelman-0/+5
2021-10-11Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, ↵Guillaume Gomez-0/+1
r=joshtriplett Add #[must_use] to from_value conversions I added two methods to the list myself. Clippy did not flag them because they take `mut` args, but neither modifies their argument. ```rust core::str const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str; std::ffi::CString unsafe fn from_raw(ptr: *mut c_char) -> CString; ``` I put a custom note on `from_raw`: ```rust #[must_use = "call `drop(from_raw(ptr))` if you intend to drop the `CString`"] pub unsafe fn from_raw(ptr: *mut c_char) -> CString { ``` Parent issue: #89692 r? ``@joshtriplett``
2021-10-10Add #[must_use] to conversions that move selfJohn Kugelman-0/+1
2021-10-10Add #[must_use] to from_value conversionsJohn Kugelman-0/+1