Skip to content

Commit 97d8397

Browse files
committed
ch15 スマートポインタの和訳を最新版に更新
rust-lang/book@19c40bf
1 parent 2296c28 commit 97d8397

File tree

62 files changed

+801
-1245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+801
-1245
lines changed

dot/trpl15-04.dot

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
digraph {
2+
node[shape=record];
3+
rankdir=LR;
4+
5+
l1[label="{<data> 5| <next>}"];
6+
l2[label="{<data> 10| <next>}"];
7+
8+
{node[shape=point height=0] invisible_start invisible_end}
9+
10+
a -> l1:n;
11+
b -> l2:n;
12+
invisible_start:n -> l1[arrowtail=none];
13+
invisible_start:s -> invisible_end:s[dir=none];
14+
l1:next:c -> l2:data;
15+
l2:next:c -> invisible_end:n[arrowhead=none];
16+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "box-example"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "cons-list"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "cons-list"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
$ cargo run
22
Compiling cons-list v0.1.0 (file:///projects/cons-list)
33
error[E0072]: recursive type `List` has infinite size
4+
(エラー: 再帰的な型`List`は無限のサイズを持ちます)
45
--> src/main.rs:1:1
56
|
67
1 | enum List {
7-
| ^^^^^^^^^ recursive type has infinite size
8+
| ^^^^^^^^^
89
2 | Cons(i32, List),
910
| ---- recursive without indirection
1011
|
11-
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `List` representable
12-
13-
error[E0391]: cycle detected when processing `List`
14-
--> src/main.rs:1:1
15-
|
16-
1 | enum List {
17-
| ^^^^^^^^^
12+
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
13+
(ヘルプ: 何らかの間接参照(例: `Box`、`Rc`、あるいは`&`)を挿入して、循環参照を断ち切ってください)
1814
|
19-
= note: ...which again requires processing `List`, completing the cycle
20-
= note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, def_id: None }, value: List } }`
21-
22-
error: aborting due to 2 previous errors
23-
24-
Some errors have detailed explanations: E0072, E0391.
25-
For more information about an error, try `rustc --explain E0072`.
26-
error: could not compile `cons-list`.
15+
2 | Cons(i32, Box<List>),
16+
| ++++ +
2717

28-
To learn more, run the command again with --verbose.
18+
For more information about this error, try `rustc --explain E0072`.
19+
error: could not compile `cons-list` (bin "cons-list") due to 1 previous error
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "cons-list"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "deref-example"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "deref-example"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "deref-example"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "deref-example"
33
version = "0.1.0"
4-
authors = ["Your Name <[email protected]>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]

0 commit comments

Comments
 (0)