about summary refs log tree commit diff
path: root/library/std/src/io/error
AgeCommit message (Collapse)AuthorLines
2025-03-06library: Use size_of from the prelude instead of importedThalia Archibald-1/+0
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-01-10Use `NonNull::without_provenance` within the standard librarySamuel Tardieu-3/+4
This API removes the need for several `unsafe` blocks, and leads to clearer code.
2024-12-06Rollup merge of #130254 - GrigorenkoPV:QuotaExceeded, r=dtolnayMatthias Krüger-1/+1
Stabilize `std::io::ErrorKind::QuotaExceeded` Also drop "Filesystem" from its name. See #130190 for more info. FCP in #130190 cc #86442 r? `@dtolnay`
2024-11-26std: update internal uses of `io::const_error!`joboet-5/+5
2024-10-05Stabilize `std::io::ErrorKind::QuotaExceeded`Pavel Grigorenko-1/+1
Also drop "Filesystem" from its name
2024-09-27Mark some more types as having insignificant dtorMichael Goulet-0/+1
2024-09-24add InProgress ErrorKind gated behind io_error_inprogress featureAviram Hassan-0/+1
Co-authored-by: David Tolnay <dtolnay@gmail.com> Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com>
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-14std: Unsafe-wrap std::ioJubilee Young-2/+5
2024-07-02chore: remove duplicate wordshattizai-1/+1
2024-05-13Add `size_of`, `size_of_val`, `align_of`, and `align_of_val` to the preludeJosh Triplett-1/+0
Many, many projects use `size_of` to get the size of a type. However, it's also often equally easy to hardcode a size (e.g. `8` instead of `size_of::<u64>()`). Minimizing friction in the use of `size_of` helps ensure that people use it and make code more self-documenting. The name `size_of` is unambiguous: the name alone, without any prefix or path, is self-explanatory and unmistakeable for any other functionality. Adding it to the prelude cannot produce any name conflicts, as any local definition will silently shadow the one from the prelude. Thus, we don't need to wait for a new edition prelude to add it. Add `size_of_val`, `align_of`, and `align_of_val` as well, with similar justification: widely useful, self-explanatory, unmistakeable for anything else, won't produce conflicts.
2024-02-22Use generic `NonZero` everywhere in `std`.Markus Reiter-2/+2
2024-02-21rename ptr::invalid -> ptr::without_provenanceRalf Jung-2/+8
also introduce ptr::dangling matching NonNull::dangling
2024-01-19Update `std::io::Error::downcast` return typeJiahao XU-2/+2
and update its doc according to decision made by rust libs-api team. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-12-10remove redundant importssurechen-2/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-09-03Move RawOsError defination to sysAyush Singh-3/+0
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-01-31std: add type alias for raw OS errorsjoboet-6/+9
Implement rust-lang/libs-team#173.
2023-01-21Remove unnecessary `&format!`Nikolai Vazquez-1/+1
These were likely from before the `PartialEq<str>` impl for `&String`.
2023-01-14fix issues in unused lintyukang-4/+4
2022-12-30Replace libstd, libcore, liballoc in line comments.jonathanCogan-4/+4
2022-10-13fix small word dupe typosRageking8-1/+1
2022-08-23Make use of `[wrapping_]byte_{add,sub}`Maybe Waffle-2/+2
...replacing `.cast().wrapping_offset().cast()` & similar code.
2022-07-14Rename `std::io::Error::try_downcast_inner` to `downcast`Jiahao XU-7/+7
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-22Add new unit test `test_try_downcast_inner`Jiahao XU-1/+52
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-22Impl `io::error::repr_bitpacked::Repr::new`Jiahao XU-0/+9
that accepts `ErrorData<Box<Custom>>` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-22Impl `io::error::repr_unpacked::Repr::new`Jiahao XU-0/+4
that accepts `ErrorData<Box<Custom>>` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-05-29Use Box::new() instead of box syntax in std testsest31-3/+3
2022-03-29cleanup some of the less terrifying library codeAria Beingessner-1/+1
2022-03-29Make the stdlib largely conform to strict provenance.Aria Beingessner-5/+5
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.
2022-03-29Indicate the correct error code in the `compile_fail` block.Thom Chiovoloni-1/+1
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2022-03-23Add a `compile_fail` doctest to check that `io::Error: !UnwindSafe`Thom Chiovoloni-0/+9
2022-03-23Ensure io::Error's bitpacked repr doesn't accidentally impl UnwindSafeThom Chiovoloni-5/+6
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-6/+5
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-10Rename to `InvalidFilename`Yuki Okushi-1/+1
2022-02-04Add more tests for io::Error packing, and fix some comments that weren't ↵Thom Chiovoloni-16/+97
quite accurate anymore
2022-02-04Update documentation somewhatThom Chiovoloni-12/+16
2022-02-04Use wrapping pointer arithmetic in the bitpacked io::ErrorThom Chiovoloni-8/+15
2022-02-04Elaborate some in the documentation and respond to some review commentsThom Chiovoloni-7/+19
2022-02-04Update library/std/src/io/error/repr_bitpacked.rsThom Chiovoloni-1/+1
Co-authored-by: the8472 <the8472@users.noreply.github.com>
2022-02-04Fix comment typos noticed by code review.Thom Chiovoloni-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-02-04Address address comments, improve comments slightlyThom Chiovoloni-5/+13
2022-02-04Optimize io::error::Repr layout on 64 bit targets.Thom Chiovoloni-0/+353
2022-02-04Hide Repr details from io::Error, and rework `io::Error::new_const`.Thom Chiovoloni-4/+54
2021-03-21Add test for io::Error::new_const.Mara Bos-0/+10
2021-03-21Add test for io::Error's size.Mara Bos-0/+6
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-0/+53
Also doing fmt inplace as requested.