rust-lang/reference

[undefined.validity.union] dyn Trait raw pointer is subject to debate.. where's the debate?

Opened this issue · 3 comments

under undefined.validity.union:

dyn Trait metadata must be a pointer to a compiler-generated vtable for Trait
(For raw pointers, this requirement remains a subject of some debate.)

which debate? where? how? I'd like to read more.

Here's a possible source: rust-lang/rust#101336

There's been discussion about *const dyn Trait and whether it can have an invalid vtable pointer for pointer metadata stabilization: rust-lang/rust#81513

Oop, apparently in 2024 they decided that *const dyn Trait needed to have a valid vtable (which I personally disagree with - now it's impossible to have a null *const T for all T: ?Sized)