about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-09-16 11:48:18 +0200
committerGitHub <noreply@github.com>2023-09-16 11:48:18 +0200
commitc2f228f6545a19d7cc6bcf55fd0ffccf271ac69f (patch)
treeb378d75e52f41a57bc0a87606428b88fce11c0aa /compiler/rustc_codegen_llvm/src
parent790309b102a0f0459f0ca0ac0386cec2b8a9b0db (diff)
parent62111145b719c9b2a6d88b0bdcfab0f9b7e19ba8 (diff)
downloadrust-c2f228f6545a19d7cc6bcf55fd0ffccf271ac69f.tar.gz
rust-c2f228f6545a19d7cc6bcf55fd0ffccf271ac69f.zip
Rollup merge of #115607 - RalfJung:safe-traits-unsafe-code, r=dtolnay
clarify that unsafe code must not rely on our safe traits

This adds a disclaimer to PartialEq, Eq, PartialOrd, Ord, Hash, Deref, DerefMut.

We already have a similar disclaimer in ExactSizeIterator (worded a bit differently):
```
/// Note that this trait is a safe trait and as such does *not* and *cannot*
/// guarantee that the returned length is correct. This means that `unsafe`
/// code **must not** rely on the correctness of [`Iterator::size_hint`]. The
/// unstable and unsafe [`TrustedLen`](super::marker::TrustedLen) trait gives
/// this additional guarantee.
```
If there are any other traits that should carry such a disclaimer, please let me know.

Fixes https://github.com/rust-lang/rust/issues/73682
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions