rust/library/std
Dylan DPC a42e62fa0a
Rollup merge of #83353 - m-ou-se:io-error-avoid-alloc, r=nagisa
Add internal io::Error::new_const to avoid allocations.

This makes it possible to have a io::Error containing a message with zero allocations, and uses that everywhere to avoid the *three* allocations involved in `io::Error::new(kind, "message")`.

The function signature isn't perfect, because it needs a reference to the `&str`. So for now, this is just a `pub(crate)` function. Later, we'll be able to use `fn new_const<MSG: &'static str>(kind: ErrorKind)` to make that a bit better. (Then we'll also be able to use some ZST trickery if that would result in more efficient code.)

See https://github.com/rust-lang/rust/issues/83352
2021-03-24 01:52:29 +01:00
..
benches
src Rollup merge of #83353 - m-ou-se:io-error-avoid-alloc, r=nagisa 2021-03-24 01:52:29 +01:00
tests
build.rs
Cargo.toml feat: Update hashbrown to instantiate less llvm IR 2021-03-16 11:20:26 +01:00