about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-09-19 17:55:18 +0200
committerGitHub <noreply@github.com>2022-09-19 17:55:18 +0200
commit27b1b04065edbb2c33f3790defc9f93fb4cefd02 (patch)
tree0d1612b0cc8154509b10cedd55ca44c36670201b /library/std/src/sys/unix/stack_overflow.rs
parent11bb80a92b4f46fa7dfa9148d0bdfc185a7621bd (diff)
parent2c664bcbfbd31882a4b2a32f8058cc25e378186c (diff)
downloadrust-27b1b04065edbb2c33f3790defc9f93fb4cefd02.tar.gz
rust-27b1b04065edbb2c33f3790defc9f93fb4cefd02.zip
Rollup merge of #101389 - lukaslueg:rcgetmutdocs, r=m-ou-se
Tone down explanation on RefCell::get_mut

The language around `RefCell::get_mut` is remarkably sketchy and especially to the novice seems to quite strongly discourage using the method ("be cautious", "Also, please be aware", "special circumstances", "usually not what you want"). It was added six years ago in #40634 due to confusion about when to use `get_mut` and `borrow_mut`.

While its signature limits the use-cases for `get_mut`, there is no chance for a safety footgun, and readers can be made aware of `borrow_mut` more softly. I've also just sent a [PR](https://github.com/rust-lang/rust-clippy/issues/9044) to lint situations where `get_mut` could be used to improve ergonomics and performance.

So this PR tones down the language around `get_mut` and also brings it more in line with [`std::sync::Mutex::get_mut()`](https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.get_mut).
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions