ptr::eq
Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
This is based almost entirely on the code available in the previous PR #4596.