Skip to content

Commit 3ae03c2

Browse files
committed
Translate code comments
1 parent 3df14af commit 3ae03c2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/subtyping.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,14 @@ in multiple fields.
415415
use std::cell::Cell;
416416

417417
struct Foo<'a, 'b, A: 'a, B: 'b, C, D, E, F, G, H> {
418-
a: &'a A, // variant over 'a and A
419-
b: &'b mut B, // variant over 'b and invariant over B
420-
c: *const C, // variant over C
421-
d: *mut D, // invariant over D
422-
e: Vec<E>, // variant over E
423-
f: Cell<F>, // invariant over F
424-
g: G, // variant over G
425-
h1: H, // would also be variant over H except...
426-
h2: Cell<H>, // invariant over H, because invariance wins
418+
a: &'a A, // 'a と A において変性
419+
b: &'b mut B, // 'b において変性、 B において非変性
420+
c: *const C, // C において変性
421+
d: *mut D, // D において非変性
422+
e: Vec<E>, // E において変性
423+
f: Cell<F>, // F において非変性
424+
g: G, // G において変性
425+
h1: H, // これも H において変性に見えるでしょうが...
426+
h2: Cell<H>, // H において非変性です。非変性が勝つのです
427427
}
428428
```

0 commit comments

Comments
 (0)