I think this unsafety is misplaced. Afaiu, the main point is that FatPtr is essentially a type-erased Rust fat ptr. However, we could turn this method into something safe if we wrap the FatPtr into a FindServiceCallable and embed the FatPtr inside this type. The invariant of this type would then be the guarantee that it points to the appropriate callback. If the Rust compiler cannot verify that, then the unsafety is pushed to the point where this new type is instantiated. And this is imo the better place, since it is directly at the point where the original type gets "encoded into the Rust type system".
Originally posted by @darkwisebear in #388 (comment)
I think this unsafety is misplaced. Afaiu, the main point is that
FatPtris essentially a type-erased Rust fat ptr. However, we could turn this method into something safe if we wrap theFatPtrinto aFindServiceCallableand embed theFatPtrinside this type. The invariant of this type would then be the guarantee that it points to the appropriate callback. If the Rust compiler cannot verify that, then the unsafety is pushed to the point where this new type is instantiated. And this is imo the better place, since it is directly at the point where the original type gets "encoded into the Rust type system".Originally posted by @darkwisebear in #388 (comment)