Add test for issue #12552

Closes #12552
auto merge of #15235 : Sawyer47/rust/issue-12552, r=huonw

Closes #12552