Add a test for #11552

Closes #11552
auto merge of #12641 : sfackler/rust/issue-11552, r=huonw

Closes #11552