Add a test for issue 5517
auto merge of #6282 : alexcrichton/rust/issue-5517-add-test, r=thestinger

It appears the cause of #5517 was fixed in 0dc6c414, so adding a test so the issue can be closed.