Add test for #11677

This code used to cause an ICE

Closes #11677
auto merge of #15213 : Sawyer47/rust/issue-11677, r=huonw

This code used to cause an ICE

Closes #11677