Add a test case for #12187, which appears to have been fixed

Closes #12187.
auto merge of #15486 : jakub-/rust/test-case-12187, r=alexcrichton

Closes #12187.