Files
rust/library
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
..
2024-06-06 22:50:45 -07:00
2024-07-04 14:56:08 +08:00
2024-06-19 13:54:51 +01:00
2024-05-11 14:31:55 +02:00
2024-06-19 13:54:51 +01:00