Add test for issue 6157
auto merge of #11914 : FlaPer87/rust/issue-6157, r=alexcrichton

closes #6157