Skip to content

Commit 7087112

Browse files
author
taku-a11y
authored
Update Ch3-3 error output
エラーの内容を原文のものと同じにしました。まだ翻訳はしていません。 原文: https://doc.rust-lang.org/book/ch03-03-how-functions-work.html
1 parent 771c4e2 commit 7087112

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/ch03-03-how-functions-work.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,38 @@ When you run this program, the error you’ll get looks like this:
337337
```text
338338
$ cargo run
339339
Compiling functions v0.1.0 (file:///projects/functions)
340+
error[E0658]: `let` expressions in this position are experimental
341+
--> src/main.rs:2:14
342+
|
343+
2 | let x = (let y = 6);
344+
| ^^^^^^^^^
345+
|
346+
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
347+
340348
error: expected expression, found statement (`let`)
341349
(エラー: 式を予期しましたが、文が見つかりました (`let`))
342350
--> src/main.rs:2:14
343351
|
344352
2 | let x = (let y = 6);
345-
| ^^^
353+
| ^^^^^^^^^
346354
|
347355
= note: variable declaration using `let` is a statement
348356
(注釈: `let`を使う変数宣言は、文です)
357+
358+
warning: unnecessary parentheses around assigned value
359+
--> src/main.rs:2:13
360+
|
361+
2 | let x = (let y = 6);
362+
| ^^^^^^^^^^^ help: remove these parentheses
363+
|
364+
= note: `#[warn(unused_parens)]` on by default
365+
366+
error: aborting due to 2 previous errors; 1 warning emitted
367+
368+
For more information about this error, try `rustc --explain E0658`.
369+
error: could not compile `functions`
370+
371+
To learn more, run the command again with --verbose.
349372
```
350373

351374
<!--

0 commit comments

Comments
 (0)