Stop ICE when using foreign statics in statics

Only change is to stop an ICE when a foreign static are referenced in
consts and statics.

See: #16538, #16479, #14227, #13325
auto merge of #17973 : whataloadofwhat/rust/master, r=alexcrichton

(I am new to Git and Github so I'm really sorry if I messed up somewhere)