Correctly encode item visibility in metadata

This fixes private statics and functions from being usable cross-crates