testsuite: Add test case for #4325
auto merge of #5620 : catamorphism/rust/issue-4325, r=catamorphism