Add test and close #8893
auto merge of #12301 : FlaPer87/rust/issue-8893, r=alexcrichton