Rollup merge of #56014 - euclio:issue-21335, r=nagisa
Rollup merge of #56014 - euclio:issue-21335, r=nagisa

add test for issue #21335

Running this test with LLVM assertions enabled doesn't seem to trigger an assertion on my Mac.

Fixes #21335.

aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust