about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-04-14 09:01:58 +0200
committerGitHub <noreply@github.com>2024-04-14 09:01:58 +0200
commit2ba0c627dee4dc32b451e542c7b274e382a781a0 (patch)
treed7452fd5d6fdf323db73684e036ae6aa3425b654 /compiler/rustc_driver_impl/src
parent2bec57d4a9405b256ec10d524fd917823a68049d (diff)
parent126c762b8577dc65ccba1e0105d5c153bcc1ad56 (diff)
downloadrust-2ba0c627dee4dc32b451e542c7b274e382a781a0.tar.gz
rust-2ba0c627dee4dc32b451e542c7b274e382a781a0.zip
Rollup merge of #123879 - beetrees:missing-unsafe, r=Mark-Simulacrum
Add missing `unsafe` to some internal `std` functions

Adds `unsafe` to a few internal functions that have safety requirements but were previously not marked as `unsafe`. Specifically:

- `std::sys::pal::unix::thread::min_stack_size` needs to be `unsafe` as `__pthread_get_minstack` might dereference the passed pointer. All callers currently pass a valid initialised `libc::pthread_attr_t`.
- `std::thread::Thread::new` (and `new_inner`) need to be `unsafe` as it requires the passed thread name to be valid UTF-8, otherwise `Thread::name` will trigger undefined behaviour. I've taken the opportunity to split out the unnamed thread case into a separate `new_unnamed` function to make the safety requirement clearer. All callers meet the safety requirement now that #123505 has been merged.
Diffstat (limited to 'compiler/rustc_driver_impl/src')
0 files changed, 0 insertions, 0 deletions