Skip to content

Commit 6dd5d14

Browse files
committed
Translate code comments
1 parent b9ef4ad commit 6dd5d14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dropck.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,10 @@ struct Inspector<T: fmt::Display>(T, &'static str);
452452
453453
impl<T: fmt::Display> Drop for Inspector<T> {
454454
fn drop(&mut self) {
455-
// There is a hidden call to `<T as Display>::fmt` below, which
456-
// could access a borrow e.g. if `T` is `&'a _`
455+
// 以下のコードには隠れている、 `<T as Display>::fmt` の呼び出しがあります。
456+
// もし `T` が `&'a _` である場合、この呼び出しで借用されたデータにアクセス出来てしまうでしょう。
457+
458+
// Inspector({}, {}) はうっかり破棄されたデータにアクセスしてしまいます。
457459
println!("Inspector({}, {}) unwittingly inspects expired data.",
458460
self.0, self.1);
459461
}

0 commit comments

Comments
 (0)