This must be unsafe, because the safety invariants of ManuallyDrop permit patterns that would be unsound, like calling try_as_arc_owned twice on the same TaggedArcPtr and invoking ManuallyDrop::drop or ::take on both of those two separate ManuallyDrop values, easily producing a use-after-free.
This is a non-blocking issue because it is an internal-only interface which is used correctly.
This doesn't prevent our use of rust-analyzer, but I'm sharing it here in case you agree and want to clarify the safety in the code.
An audit of
unsafe
in ra_ap_intern found this possible issue:https://github.com/rust-lang/rust-analyzer/blob/dd9cd22514cb1001a0a2374b36a85eb75245f27b/crates/intern/src/symbol.rs#L81-L92
This doesn't prevent our use of rust-analyzer, but I'm sharing it here in case you agree and want to clarify the safety in the code.