rust/library
Matthias Krüger 876f00a655
Rollup merge of #107200 - mina86:c, r=Amanieu
io: soften ‘at most one write attempt’ requirement in io::Write::write

At the moment, documentation of std::io::Write::write indicates that
call to it ‘represents at most one attempt to write to any wrapped
object’.  It seems that such wording was put there to contrast it with
pre-1.0 interface which attempted to write all the data (it has since
been changed in [RFC 517]).

However, the requirement puts unnecessary constraints and may
complicate adaptors which perform non-trivial transformations on the
data.  For example, they may maintain an internal buffer which needs
to be written out before the write method accepts more data.  It might
be natural to code the method such that it flushes the buffer and then
grabs another chunk of user data.  With the current wording in the
documentation, the adaptor would be forced to return Ok(0).

This commit softens the wording such that implementations can choose
code structure which makes most sense for their particular use case.

While at it, elaborate on the meaning of `Ok(0)` return pointing out
that the write_all methods interprets it as an error.

[RFC 517]: https://rust-lang.github.io/rfcs/0517-io-os-reform.html
2023-06-18 08:06:41 +02:00
..
alloc Auto merge of #100036 - DrMeepster:box_free_free_box, r=oli-obk 2023-06-17 16:10:57 +00:00
backtrace@4245978ca8 PS Vita std support 2023-05-07 18:57:43 +03:00
core Auto merge of #112599 - saethlin:cleaner-panics, r=thomcc 2023-06-18 01:58:51 +00:00
panic_abort Remove unnecessary raw pointer in __rust_start_panic arg 2023-03-26 16:40:18 +00:00
panic_unwind Partial stabilisation of c_unwind 2023-04-29 13:01:44 +01:00
portable-simd Explicit set workspace.resolver = "1" 2023-05-31 00:08:11 +01:00
proc_macro fix TODO comments 2023-05-02 10:32:07 +00:00
profiler_builtins Fully stabilize NLL 2022-06-03 17:16:41 -04:00
rtstartup Remove custom frame info registration on i686-pc-windows-gnu 2022-08-23 16:12:58 +08:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-std Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
std Rollup merge of #107200 - mina86:c, r=Amanieu 2023-06-18 08:06:41 +02:00
stdarch@d77878b729 Bump stdarch 2023-06-13 21:45:04 -07:00
sysroot Add a sysroot crate to represent the standard library crates 2023-04-25 13:40:36 +02:00
test ignore core, alloc and test tests that require unwinding on panic=abort 2023-06-13 15:53:24 +02:00
unwind Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiser 2023-04-11 20:28:45 -07:00