Skip to content

Commit 1afd76c

Browse files
committed
Translate a paragraph
1 parent d3b2572 commit 1afd76c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/subtyping.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,23 @@ subtyping of its outputs. There are two kinds of variance in Rust:
101101
-->
102102

103103
* もし `T``U` の派生型である時、 `F<T>``F<U>` の派生型であるならば、 `F`
104-
*変性*です。(派生型の「パススルー」)
104+
`T` において*変性*です。(派生型の「パススルー」)
105105
* それ以外の場合、 `T`*非変性*です。(いかなる派生型の関係も継承されません)
106106

107+
<!--
107108
(For those of you who are familiar with variance from other languages, what we
108109
refer to as "just" variance is in fact *covariance*. Rust has *contravariance*
109110
for functions. The future of contravariance is uncertain and it may be
110111
scrapped. For now, `fn(T)` is contravariant in `T`, which is used in matching
111112
methods in trait implementations to the trait definition. Traits don't have
112113
inferred variance, so `Fn(T)` is invariant in `T`).
114+
-->
115+
116+
(他の言語で変性に慣れている方にとって、「単に」変性と言及しているものは実は*共変性*です。
117+
Rust では関数に*反変性*が存在します。将来的に反変性がどうなるかは未定で、
118+
反変性が廃止されるかもしれません。今の所、 `fn(T)``T` の反変性で、これは
119+
トレイトの定義に対してトレイトの実装内のメソッドをマッチさせるのに使われます。
120+
トレイトは推論された変性を持たないため、 `fn(T)``T` において変性ではありません。)
113121

114122
Some important variances:
115123

0 commit comments

Comments
 (0)