librustc: Stop trying to make invalid slice with vec in statics.

Fixes  #5917.