Add tests for issues which can be closed

Closes #5275, $4547
auto merge of #7923 : alexcrichton/rust/add-tests, r=graydon

Closes #5275, #4547