testsuite: Add passing test for #4107
auto merge of #6483 : catamorphism/rust/issue-4107, r=catamorphism