Make BufMut an unsafe trait (#432)

Users of `BufMut` are unable to defend against incorrect implementations
of `BufMut`, this makes the trait unsafe to implement.

Fixes #329
This commit is contained in:
Carl Lerche
2020-10-16 15:45:38 -07:00
committed by GitHub
parent 94c543f74b
commit ced050730c
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ fn test_mut_slice() {
fn test_deref_bufmut_forwards() {
struct Special;
impl BufMut for Special {
unsafe impl BufMut for Special {
fn remaining_mut(&self) -> usize {
unreachable!("remaining_mut");
}