Skip to content

Commit c38877a

Browse files
committed
Fixes hardcoded output
Resolves #2275
1 parent 6fb3705 commit c38877a

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$ cargo run
2+
Compiling functions v0.1.0 (file:///projects/functions)
3+
error: expected expression, found statement (`let`)
4+
--> src/main.rs:2:14
5+
|
6+
2 | let x = (let y = 6);
7+
| ^^^
8+
|
9+
= note: variable declaration using `let` is a statement

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,7 @@ to another variable, as the following code tries to do; you’ll get an error:
137137

138138
When you run this program, the error you’ll get looks like this:
139139

140-
<!--TODO: not extracting this because the new error message is incorrect; see
141-
https://github.com/rust-lang/rust/issues/65254 -->
142-
143-
```text
144-
$ cargo run
145-
Compiling functions v0.1.0 (file:///projects/functions)
146-
error: expected expression, found statement (`let`)
147-
--> src/main.rs:2:14
148-
|
149-
2 | let x = (let y = 6);
150-
| ^^^
151-
|
152-
= note: variable declaration using `let` is a statement
153-
```
140+
{{#include ../listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt}}
154141

155142
The `let y = 6` statement does not return a value, so there isn’t anything for
156143
`x` to bind to. This is different from what happens in other languages, such as

0 commit comments

Comments
 (0)