Skip to content

Commit 1b49a01

Browse files
committed
ci: generate pages at 2560a7a [ci skip]
1 parent 2560a7a commit 1b49a01

5 files changed

+128
-48
lines changed

docs/ch03-03-how-functions-work.html

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -429,15 +429,38 @@ <h3><a class="header" href="#関数本体は文と式を含む" id="関数本体
429429
<p>このプログラムを実行すると、以下のようなエラーが出るでしょう:</p>
430430
<pre><code class="language-text">$ cargo run
431431
Compiling functions v0.1.0 (file:///projects/functions)
432+
error[E0658]: `let` expressions in this position are experimental
433+
--&gt; src/main.rs:2:14
434+
|
435+
2 | let x = (let y = 6);
436+
| ^^^^^^^^^
437+
|
438+
= note: see issue #53667 &lt;https://github.com/rust-lang/rust/issues/53667&gt; for more information
439+
432440
error: expected expression, found statement (`let`)
433441
(エラー: 式を予期しましたが、文が見つかりました (`let`))
434442
--&gt; src/main.rs:2:14
435443
|
436444
2 | let x = (let y = 6);
437-
| ^^^
445+
| ^^^^^^^^^
438446
|
439447
= note: variable declaration using `let` is a statement
440448
(注釈: `let`を使う変数宣言は、文です)
449+
450+
warning: unnecessary parentheses around assigned value
451+
--&gt; src/main.rs:2:13
452+
|
453+
2 | let x = (let y = 6);
454+
| ^^^^^^^^^^^ help: remove these parentheses
455+
|
456+
= note: `#[warn(unused_parens)]` on by default
457+
458+
error: aborting due to 2 previous errors; 1 warning emitted
459+
460+
For more information about this error, try `rustc --explain E0658`.
461+
error: could not compile `functions`
462+
463+
To learn more, run the command again with --verbose.
441464
</code></pre>
442465
<!--
443466
The `let y = 6` statement does not return a value, so there isn’t anything for
@@ -611,20 +634,26 @@ <h3><a class="header" href="#戻り値のある関数" id="戻り値のある関
611634
Running this code produces an error, as follows:
612635
-->
613636
<p>このコードを実行すると、以下のようにエラーが出ます:</p>
614-
<pre><code class="language-text">error[E0308]: mismatched types
637+
<pre><code class="language-text">$ cargo run
638+
Compiling functions v0.1.0 (file:///projects/functions)
639+
error[E0308]: mismatched types
615640
(型が合いません)
616-
--&gt; src/main.rs:7:28
617-
|
618-
7 | fn plus_one(x: i32) -&gt; i32 {
619-
| ____________________________^
620-
8 | | x + 1;
621-
| | - help: consider removing this semicolon
622-
9 | | }
623-
| |_^ expected i32, found ()
624-
| (i32を予期したのに、()型が見つかりました)
641+
642+
--&gt; src/main.rs:7:24
625643
|
626-
= note: expected type `i32`
627-
found type `()`
644+
7 | fn plus_one(x: i32) -&gt; i32 {
645+
| -------- ^^^ expected `i32`, found `()`
646+
| |
647+
| implicitly returns `()` as its body has no tail or `return` expression
648+
8 | x + 1;
649+
| - help: consider removing this semicolon
650+
651+
error: aborting due to previous error
652+
653+
For more information about this error, try `rustc --explain E0308`.
654+
error: could not compile `functions`
655+
656+
To learn more, run the command again with --verbose.
628657
</code></pre>
629658
<!--
630659
The main error message, “mismatched types,” reveals the core issue with this

docs/ch04-02-references-and-borrowing.html

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382,28 +382,39 @@ <h3><a class="header" href="#可変な参照" id="可変な参照">可変な参
382382
<span class="filename">Filename: src/main.rs</span>
383383
-->
384384
<p><span class="filename">ファイル名: src/main.rs</span></p>
385-
<pre><code class="language-rust ignore">let mut s = String::from(&quot;hello&quot;);
385+
<pre><code class="language-rust ignore"> let mut s = String::from(&quot;hello&quot;);
386386

387-
let r1 = &amp;mut s;
388-
let r2 = &amp;mut s;
387+
let r1 = &amp;mut s;
388+
let r2 = &amp;mut s;
389+
390+
println!(&quot;{}, {}&quot;, r1, r2);
389391
</code></pre>
390392
<!--
391393
Here’s the error:
392394
-->
393395
<p>これがエラーです:</p>
394-
<pre><code class="language-text">error[E0499]: cannot borrow `s` as mutable more than once at a time
396+
<pre><code class="language-text">$ cargo run
397+
Compiling ownership v0.1.0 (file:///projects/ownership)
398+
error[E0499]: cannot borrow `s` as mutable more than once at a time
395399
(エラー: 一度に`s`を可変として2回以上借用することはできません)
396-
--&gt; borrow_twice.rs:5:19
400+
--&gt; src/main.rs:5:14
397401
|
398402
4 | let r1 = &amp;mut s;
399-
| - first mutable borrow occurs here
403+
| ------ first mutable borrow occurs here
400404
| (最初の可変な参照はここ)
401405
5 | let r2 = &amp;mut s;
402-
| ^ second mutable borrow occurs here
406+
| ^^^^^^ second mutable borrow occurs here
403407
| (二つ目の可変な参照はここ)
404-
6 | }
405-
| - first borrow ends here
406-
| (最初の借用はここで終わり)
408+
6 |
409+
7 | println!(&quot;{}, {}&quot;, r1, r2);
410+
| -- first borrow later used here
411+
412+
error: aborting due to previous error
413+
414+
For more information about this error, try `rustc --explain E0499`.
415+
error: could not compile `ownership`
416+
417+
To learn more, run the command again with --verbose.
407418
</code></pre>
408419
<!--
409420
This restriction allows for mutation but in a very controlled fashion. It’s

docs/print.html

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4164,15 +4164,38 @@ <h3><a class="header" href="#関数本体は文と式を含む" id="関数本体
41644164
<p>このプログラムを実行すると、以下のようなエラーが出るでしょう:</p>
41654165
<pre><code class="language-text">$ cargo run
41664166
Compiling functions v0.1.0 (file:///projects/functions)
4167+
error[E0658]: `let` expressions in this position are experimental
4168+
--&gt; src/main.rs:2:14
4169+
|
4170+
2 | let x = (let y = 6);
4171+
| ^^^^^^^^^
4172+
|
4173+
= note: see issue #53667 &lt;https://github.com/rust-lang/rust/issues/53667&gt; for more information
4174+
41674175
error: expected expression, found statement (`let`)
41684176
(エラー: 式を予期しましたが、文が見つかりました (`let`))
41694177
--&gt; src/main.rs:2:14
41704178
|
41714179
2 | let x = (let y = 6);
4172-
| ^^^
4180+
| ^^^^^^^^^
41734181
|
41744182
= note: variable declaration using `let` is a statement
41754183
(注釈: `let`を使う変数宣言は、文です)
4184+
4185+
warning: unnecessary parentheses around assigned value
4186+
--&gt; src/main.rs:2:13
4187+
|
4188+
2 | let x = (let y = 6);
4189+
| ^^^^^^^^^^^ help: remove these parentheses
4190+
|
4191+
= note: `#[warn(unused_parens)]` on by default
4192+
4193+
error: aborting due to 2 previous errors; 1 warning emitted
4194+
4195+
For more information about this error, try `rustc --explain E0658`.
4196+
error: could not compile `functions`
4197+
4198+
To learn more, run the command again with --verbose.
41764199
</code></pre>
41774200
<!--
41784201
The `let y = 6` statement does not return a value, so there isn’t anything for
@@ -4346,20 +4369,26 @@ <h3><a class="header" href="#戻り値のある関数" id="戻り値のある関
43464369
Running this code produces an error, as follows:
43474370
-->
43484371
<p>このコードを実行すると、以下のようにエラーが出ます:</p>
4349-
<pre><code class="language-text">error[E0308]: mismatched types
4372+
<pre><code class="language-text">$ cargo run
4373+
Compiling functions v0.1.0 (file:///projects/functions)
4374+
error[E0308]: mismatched types
43504375
(型が合いません)
4351-
--&gt; src/main.rs:7:28
4352-
|
4353-
7 | fn plus_one(x: i32) -&gt; i32 {
4354-
| ____________________________^
4355-
8 | | x + 1;
4356-
| | - help: consider removing this semicolon
4357-
9 | | }
4358-
| |_^ expected i32, found ()
4359-
| (i32を予期したのに、()型が見つかりました)
4376+
4377+
--&gt; src/main.rs:7:24
43604378
|
4361-
= note: expected type `i32`
4362-
found type `()`
4379+
7 | fn plus_one(x: i32) -&gt; i32 {
4380+
| -------- ^^^ expected `i32`, found `()`
4381+
| |
4382+
| implicitly returns `()` as its body has no tail or `return` expression
4383+
8 | x + 1;
4384+
| - help: consider removing this semicolon
4385+
4386+
error: aborting due to previous error
4387+
4388+
For more information about this error, try `rustc --explain E0308`.
4389+
error: could not compile `functions`
4390+
4391+
To learn more, run the command again with --verbose.
43634392
</code></pre>
43644393
<!--
43654394
The main error message, “mismatched types,” reveals the core issue with this
@@ -6335,28 +6364,39 @@ <h3><a class="header" href="#可変な参照" id="可変な参照">可変な参
63356364
<span class="filename">Filename: src/main.rs</span>
63366365
-->
63376366
<p><span class="filename">ファイル名: src/main.rs</span></p>
6338-
<pre><code class="language-rust ignore">let mut s = String::from(&quot;hello&quot;);
6367+
<pre><code class="language-rust ignore"> let mut s = String::from(&quot;hello&quot;);
63396368

6340-
let r1 = &amp;mut s;
6341-
let r2 = &amp;mut s;
6369+
let r1 = &amp;mut s;
6370+
let r2 = &amp;mut s;
6371+
6372+
println!(&quot;{}, {}&quot;, r1, r2);
63426373
</code></pre>
63436374
<!--
63446375
Here’s the error:
63456376
-->
63466377
<p>これがエラーです:</p>
6347-
<pre><code class="language-text">error[E0499]: cannot borrow `s` as mutable more than once at a time
6378+
<pre><code class="language-text">$ cargo run
6379+
Compiling ownership v0.1.0 (file:///projects/ownership)
6380+
error[E0499]: cannot borrow `s` as mutable more than once at a time
63486381
(エラー: 一度に`s`を可変として2回以上借用することはできません)
6349-
--&gt; borrow_twice.rs:5:19
6382+
--&gt; src/main.rs:5:14
63506383
|
63516384
4 | let r1 = &amp;mut s;
6352-
| - first mutable borrow occurs here
6385+
| ------ first mutable borrow occurs here
63536386
| (最初の可変な参照はここ)
63546387
5 | let r2 = &amp;mut s;
6355-
| ^ second mutable borrow occurs here
6388+
| ^^^^^^ second mutable borrow occurs here
63566389
| (二つ目の可変な参照はここ)
6357-
6 | }
6358-
| - first borrow ends here
6359-
| (最初の借用はここで終わり)
6390+
6 |
6391+
7 | println!(&quot;{}, {}&quot;, r1, r2);
6392+
| -- first borrow later used here
6393+
6394+
error: aborting due to previous error
6395+
6396+
For more information about this error, try `rustc --explain E0499`.
6397+
error: could not compile `ownership`
6398+
6399+
To learn more, run the command again with --verbose.
63606400
</code></pre>
63616401
<!--
63626402
This restriction allows for mutation but in a very controlled fashion. It’s

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)