about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorGuillaume Boisseau <Nadrieril@users.noreply.github.com>2024-03-09 21:40:07 +0100
committerGitHub <noreply@github.com>2024-03-09 21:40:07 +0100
commit9ccf798fff9c07bfc74089c52e7147d8cf6ca380 (patch)
tree91a9d097106405089298a1a39edf8397ed4b35bf /compiler/rustc_codegen_gcc
parentcbd59d0f6256adb1c6b2dd7e7e9e6227f23e5a53 (diff)
parentaa581f0a0a3fbb61efe1f37786c237b2733dfbfa (diff)
downloadrust-9ccf798fff9c07bfc74089c52e7147d8cf6ca380.tar.gz
rust-9ccf798fff9c07bfc74089c52e7147d8cf6ca380.zip
Rollup merge of #121403 - kornelski:io-oom, r=dtolnay
impl From<TryReserveError> for io::Error

There's an obvious mapping between these two errors, and it makes I/O code less noisy.

I've chosen to use simple `ErrorKind::OutOfMemory` `io::Error`, without keeping `TryReserveError` for the `source()`, because:

* It matches current uses in libstd,
* `ErrorData::Custom` allocates, which is a risky proposition for handling OOM errors specifically.
* Currently `TryReserveError` has no public fields/methods, so it's usefulness is limited. How allocators should report errors, especially custom and verbose ones is still an open question.

Just in case I've added note in the doccomment that this may change.

The compiler forced me to declare stability of this impl. I think this implementation is simple enough that it doesn't need full-blown stabilization period, and I've marked it for the next release, but of course I can adjust the attribute if needed.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions