Skip to content

Commit 17c369c

Browse files
committed
Translate a paragraph
1 parent ee4a8b4 commit 17c369c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dropck.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,18 @@ directly within it.
471471
そして勿論、これら全てのアクセスは、何か他のメソッド内に直接書かれるよりも、
472472
デストラクタによって呼び出されたメソッドの内部に更に隠されうる事があります。
473473

474+
<!--
474475
In all of the above cases where the `&'a u8` is accessed in the
475476
destructor, adding the `#[may_dangle]`
476477
attribute makes the type vulnerable to misuse that the borrower
477478
checker will not catch, inviting havoc. It is better to avoid adding
478479
the attribute.
480+
-->
481+
482+
デストラクタ内の `&'a u8` にアクセスされる上記の全てのケースにおいて、
483+
`#[may_dangle]` アトリビュートを付け足すことで、借用チェッカが捕捉しないような
484+
誤用に対して型が脆弱になり、これによって惨事を引き起こします。
485+
このアトリビュートを付け足すのは避ける方がよいでしょう。
479486

480487
# Is that all about drop checker?
481488

0 commit comments

Comments
 (0)