rust/library/core
Matthias Krüger 9575625835
Rollup merge of #117495 - compiler-errors:unsize-docs, r=lcnr
Clarify `Unsize` documentation

The documentation erroneously says that:

```rust
/// - Types implementing a trait `Trait` also implement `Unsize<dyn Trait>`.
/// - Structs `Foo<..., T, ...>` implement `Unsize<Foo<..., U, ...>>` if all of these conditions
///   are met:
///   - `T: Unsize<U>`.
///   - Only the last field of `Foo` has a type involving `T`.
///   - `Bar<T>: Unsize<Bar<U>>`, where `Bar<T>` stands for the actual type of that last field.
```

Specifically, `T: Unsize<U>` is not required to hold -- only the final field must implement `FinalField<T>: Unsize<FinalField<U>>`. This can be demonstrated by the test I added.

---

Second commit fleshes out the documentation a lot more.
2023-11-02 15:31:21 +01:00
..
benches fix 2023-07-23 09:58:31 +00:00
src Rollup merge of #117495 - compiler-errors:unsize-docs, r=lcnr 2023-11-02 15:31:21 +01:00
tests Stabilize [const_]pointer_byte_offsets 2023-10-25 22:35:12 +00:00
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00