Regression test for ICE.  Fix #5153.
auto merge of #9515 : pnkfelix/rust/fsk-test-for-issue-5153, r=alexcrichton

r? anyone
Ensure that skipped items aren't encoded

If an item is skipped due to it being unreachable or for some optimization, then
it shouldn't be encoded into the metadata (because it wasn't present in the
first place).