Mark MutBuf::mut_buf as unsafe

`MutBuf::mut_buf` allows access to uninitialized memory.
This commit is contained in:
Carl Lerche
2015-07-26 11:02:46 -07:00
parent 296cac263c
commit b4abd1431a
6 changed files with 19 additions and 18 deletions
+4 -1
View File
@@ -30,7 +30,10 @@ pub fn test_vec_as_mut_buf() {
let mut buf = vec![];
assert_eq!(buf.remaining(), usize::MAX);
assert_eq!(buf.mut_bytes().len(), 64);
unsafe {
assert_eq!(buf.mut_bytes().len(), 64);
}
buf.write(&b"zomg"[..]).unwrap();