Skip to content

Commit c565b6b

Browse files
committed
static_lifetime.md > Reference lifetime の節を翻訳
1 parent 5e49aad commit c565b6b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/scope/lifetime/static_lifetime.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,32 @@ let s: &'static str = "hello world";
1717
fn generic<T>(x: T) where T: 'static {}
1818
```
1919

20+
<!--
2021
Both are related but subtly different and this is a common source for
2122
confusion when learning Rust. Here are some examples for each situation:
23+
-->
24+
2つの状況における`static`は微妙に異なる意味を持っており、Rustを学ぶときの混乱の元になっています。
25+
いくつかの例とともにそれぞれの状況について見てみましょう。
2226

27+
<!--
2328
## Reference lifetime
29+
-->
30+
## 参照のライフタイム
2431

32+
<!--
2533
As a reference lifetime `'static` indicates that the data pointed to by
2634
the reference lives for the entire lifetime of the running program.
2735
It can still be coerced to a shorter lifetime.
36+
-->
37+
参照のライフタイムが`'static`であることは、参照が指し示すデータがプログラムの実行中に渡って生き続けることを示します。
38+
また、より短いライフタイムに強制することも可能です。
2839

40+
<!--
2941
There are two ways to make a variable with `'static` lifetime, and both
3042
are stored in the read-only memory of the binary:
43+
-->
44+
`'static`ライフタイムを持つ変数を作るには下記の2つ方法があります。
45+
どちらの場合も、データは読み取り専用のメモリ領域に格納されます。
3146

3247
<!--
3348
* Make a constant with the `static` declaration.

0 commit comments

Comments
 (0)