Skip to content

Commit 1080f07

Browse files
committed
---
yaml --- r: 40946 b: refs/heads/dist-snap c: e0f9f89 h: refs/heads/master v: v3
1 parent a101e20 commit 1080f07

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 9cbc0fd0d9cee2f4138226c3bfd612788ddc5433
10+
refs/heads/dist-snap: e0f9f89c6575c79fc2afba6abf0c17c384c81e3b
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -308,46 +308,6 @@ fn is_four(x: int) -> bool {
308308
}
309309
~~~~
310310

311-
If all those things are expressions, you might conclude that you have
312-
to add a terminating semicolon after *every* statement, even ones that
313-
are not traditionally terminated with a semicolon in C (like `while`).
314-
That is not the case, though. Expressions that end in a block only
315-
need a semicolon if that block contains a trailing expression. `while`
316-
loops do not allow trailing expressions, and `if` statements tend to
317-
only have a trailing expression when you want to use their value for
318-
something—in which case you'll have embedded it in a bigger statement.
319-
320-
~~~
321-
# fn foo() -> bool { true }
322-
# fn bar() -> bool { true }
323-
# fn baz() -> bool { true }
324-
// `let` is not an expression, so it is semicolon-terminated;
325-
let x = foo();
326-
327-
// When used in statement position, bracy expressions do not
328-
// usually need to be semicolon terminated
329-
if x {
330-
bar();
331-
} else {
332-
baz();
333-
} // No semi-colon
334-
335-
// Although, if `bar` and `baz` have non-nil return types, and
336-
// we try to use them as the tail expressions, rustc will
337-
// make us terminate the expression.
338-
if x {
339-
bar()
340-
} else {
341-
baz()
342-
}; // Semi-colon to ignore non-nil block type
343-
344-
// An `if` embedded in `let` again requires a semicolon to terminate
345-
// the `let` statement
346-
let y = if x { foo() } else { bar() };
347-
~~~
348-
349-
This may sound intricate, but it is super-useful and will grow on you.
350-
351311
## Types
352312

353313
The basic types include the usual boolean, integral, and floating-point types.

0 commit comments

Comments
 (0)