rust/library/alloc
Maybe Waffle 5645e8e285 Add more checks for pointers with vtable meta
The rules for casting `*mut X<dyn A>` -> `*mut Y<dyn B>` are as follows:
- If `B` has a principal
  - `A` must have exactly the same principal (including generics)
  - Auto traits of `B` must be a subset of autotraits in `A`

Note that `X<_>` and `Y<_>` can be identity, or arbitrary structs with last field being the dyn type.
The lifetime of the trait object itself (`dyn ... + 'a`) is not checked.

This prevents a few soundness issues with `#![feature(arbitrary_self_types)]` and trait upcasting.
Namely, these checks make sure that vtable is always valid for the pointee.
2024-07-04 17:56:09 +02:00
..
benches disable benches in Miri 2024-04-07 09:58:10 +02:00
src Add more checks for pointers with vtable meta 2024-07-04 17:56:09 +02:00
tests Generalize {Rc,Arc}::make_mut() to unsized types. 2024-06-22 08:08:00 -07:00
Cargo.toml Cleanup bootstrap check-cfg 2024-06-27 11:30:03 +02:00