rust/library
Jan Behrens 551d921de0 docs: Improve AsRef / AsMut docs on blanket impls
- Explicitly mention that `AsRef` and `AsMut` do not auto-dereference
  generally for all dereferencable types (but only if inner type is a
  shared and/or mutable reference)
- Give advice to not use `AsRef` or `AsMut` for the sole purpose of
  dereferencing
- Suggest providing a transitive `AsRef` or `AsMut` implementation for
  types which implement `Deref`
- Add new section "Reflexivity" in documentation comments for `AsRef`
  and `AsMut`
- Provide better example for `AsMut`
- Added heading "Relation to `Borrow`" in `AsRef`'s docs to improve
  structure

Issue #45742 and a corresponding FIXME in the libcore suggest that
`AsRef` and `AsMut` should provide a blanket implementation over
`Deref`. As that is difficult to realize at the moment, this commit
updates the documentation to better describe the status-quo and to give
advice on how to use `AsRef` and `AsMut`.
2022-07-19 11:40:40 +02:00
..
alloc Rollup merge of #99198 - RalfJung:alloc-null-ptr, r=JohnTitor 2022-07-18 21:14:45 +05:30
backtrace@4e5a3f7292
core docs: Improve AsRef / AsMut docs on blanket impls 2022-07-19 11:40:40 +02:00
panic_abort
panic_unwind
portable-simd
proc_macro proc_macro: Move subspan to be a method on Span in the bridge 2022-07-18 13:06:51 -04:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #99302 - yaahc:gma-tracking-issue, r=joshtriplett 2022-07-17 13:08:51 +09:00
stdarch@28335054b1
test
unwind