Skip to content

Commit 5b7f5df

Browse files
committed
---
yaml --- r: 92192 b: refs/heads/auto c: 0f82cbd h: refs/heads/master v: v3
1 parent f1e3293 commit 5b7f5df

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: d00a407e00a28a3607ff363cfcc1166eb4559673
16+
refs/heads/auto: 0f82cbd19a0bd2d0d5e91c2fc807c7af21288eb4
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/doc/tutorial.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,24 +361,28 @@ Rust's set of operators contains very few surprises. Arithmetic is done with
361361
also a unary prefix operator that negates numbers. As in C, the bitwise operators
362362
`>>`, `<<`, `&`, `|`, and `^` are also supported.
363363

364-
Note that, if applied to an integer value, `!` flips all the bits (like `~` in
365-
C).
364+
Note that, if applied to an integer value, `!` flips all the bits (bitwise
365+
NOT, like `~` in C).
366366

367367
The comparison operators are the traditional `==`, `!=`, `<`, `>`,
368368
`<=`, and `>=`. Short-circuiting (lazy) boolean operators are written
369369
`&&` (and) and `||` (or).
370370

371-
For type casting, Rust uses the binary `as` operator. It takes an
372-
expression on the left side and a type on the right side and will,
373-
if a meaningful conversion exists, convert the result of the
374-
expression to the given type.
371+
For compile-time type casting, Rust uses the binary `as` operator. It takes
372+
an expression on the left side and a type on the right side and will, if a
373+
meaningful conversion exists, convert the result of the expression to the
374+
given type. Generally, `as` is only used with the primitive numeric types or
375+
pointers, and is not overloadable. [`transmute`][transmute] can be used for
376+
unsafe C-like casting of same-sized types.
375377

376378
~~~~
377379
let x: f64 = 4.0;
378380
let y: uint = x as uint;
379381
assert!(y == 4u);
380382
~~~~
381383

384+
[transmute]: http://static.rust-lang.org/doc/master/std/cast/fn.transmute.html
385+
382386
## Syntax extensions
383387

384388
*Syntax extensions* are special forms that are not built into the language,

0 commit comments

Comments
 (0)