diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-09-16 11:48:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-16 11:48:18 +0200 |
| commit | c2f228f6545a19d7cc6bcf55fd0ffccf271ac69f (patch) | |
| tree | b378d75e52f41a57bc0a87606428b88fce11c0aa /compiler/rustc_mir_transform/src | |
| parent | 790309b102a0f0459f0ca0ac0386cec2b8a9b0db (diff) | |
| parent | 62111145b719c9b2a6d88b0bdcfab0f9b7e19ba8 (diff) | |
| download | rust-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_mir_transform/src')
0 files changed, 0 insertions, 0 deletions
