Add a test for #6976

Closes #6976
Better error message when using vectors in statics

Closes #10487
auto merge of #10511 : cmr/rust/addtests, r=huonw

Commit messages have all