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).
auto merge of #9484 : alexcrichton/rust/fix-cfg-inner-item, r=pcwalton

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).