From 2aaf25571bcadda6c5cb74eb2493482e5f00df92 Mon Sep 17 00:00:00 2001 From: nomicon-kr Date: Sun, 23 Jun 2024 19:50:04 +0900 Subject: [PATCH] Update working-with-unsafe.md --- src/working-with-unsafe.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/working-with-unsafe.md b/src/working-with-unsafe.md index c4f81e7..ffd63a4 100644 --- a/src/working-with-unsafe.md +++ b/src/working-with-unsafe.md @@ -77,6 +77,8 @@ fn make_room(&mut self) { } ``` +이 코드는 100% 안전한 러스트이지만, 동시에 완전히 불건전합니다. 용량을 변경하는 것은 Vec의 불변의 원칙을 파괴합니다. + This code is 100% Safe Rust but it is also completely unsound. Changing the capacity violates the invariants of Vec (that `cap` reflects the allocated space in the Vec). This is not something the rest of Vec can guard against. It *has*