Skip to content

Commit 4c61dc4

Browse files
committed
---
yaml --- r: 36851 b: refs/heads/try2 c: e0f9f89 h: refs/heads/master i: 36849: ef9f661 36847: 4ffbd5b v: v3
1 parent 4d0c547 commit 4c61dc4

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9cbc0fd0d9cee2f4138226c3bfd612788ddc5433
8+
refs/heads/try2: e0f9f89c6575c79fc2afba6abf0c17c384c81e3b
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/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)