Fix vec::mut_slice

Fix #5984.
Resolve the problem which exists in #6780.