Report error for non constant vector repeat count

Fix issue #3645
auto merge of #5072 : youknowone/rust/repeat_count, r=brson

Fix issue #3645