core::vec is missing methods for mutable slices
auto merge of #6780 : june0cho/rust/issue5984, r=brson

Fix #5984. Also, I found a problem on type inference and left a comment.