Skip to content

Commit 0365d2e

Browse files
committed
---
yaml --- r: 30809 b: refs/heads/incoming c: 5424f21 h: refs/heads/master i: 30807: 89bc673 v: v3
1 parent bd38701 commit 0365d2e

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: ae1a73029ce422ccd52c3c659a32c19ac60d0d4e
9+
refs/heads/incoming: 5424f21d5dd054e57113ca7814b813ba2d09fa15
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/tutorial-ffi.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Interacting with foreign code
1+
% Rust Foreign Function Interface Tutorial
2+
3+
# Introduction
24

35
One of Rust's aims, as a system programming language, is to
46
interoperate well with C code.
@@ -38,7 +40,7 @@ fn main(args: ~[~str]) {
3840
}
3941
~~~~
4042

41-
## Foreign modules
43+
# Foreign modules
4244

4345
Before we can call `SHA1`, we have to declare it. That is what this
4446
part of the program is responsible for:
@@ -68,7 +70,7 @@ extern mod something {
6870
}
6971
~~~~
7072

71-
## Foreign calling conventions
73+
# Foreign calling conventions
7274

7375
Most foreign code will be C code, which usually uses the `cdecl` calling
7476
convention, so that is what Rust uses by default when calling foreign
@@ -88,7 +90,7 @@ The `"abi"` attribute applies to a foreign module (it can not be applied
8890
to a single function within a module), and must be either `"cdecl"`
8991
or `"stdcall"`. Other conventions may be defined in the future.
9092

91-
## Unsafe pointers
93+
# Unsafe pointers
9294

9395
The foreign `SHA1` function is declared to take three arguments, and
9496
return a pointer.
@@ -118,7 +120,7 @@ caution—unlike Rust's other pointer types, unsafe pointers are
118120
completely unmanaged, so they might point at invalid memory, or be
119121
null pointers.
120122

121-
## Unsafe blocks
123+
# Unsafe blocks
122124

123125
The `sha1` function is the most obscure part of the program.
124126

@@ -159,7 +161,7 @@ unsafe fn kaboom() { ~"I'm harmless!"; }
159161
This function can only be called from an unsafe block or another
160162
unsafe function.
161163

162-
## Pointer fiddling
164+
# Pointer fiddling
163165

164166
The standard library defines a number of helper functions for dealing
165167
with unsafe data, casting between types, and generally subverting
@@ -202,7 +204,7 @@ unsafe pointer that was returned by `SHA1`. SHA1 digests are always
202204
twenty bytes long, so we can pass `20u` for the length of the new
203205
vector.
204206

205-
## Passing structures
207+
# Passing structures
206208

207209
C functions often take pointers to structs as arguments. Since Rust
208210
structs are binary-compatible with C structs, Rust programs can call

branches/incoming/doc/tutorial-macros.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Macros
1+
% Rust Macros Tutorial
2+
3+
# Introduction
24

35
Functions are the programmer's primary tool of abstraction, but there are
46
cases in which they are insufficient, because the programmer wants to
@@ -50,7 +52,7 @@ early_return!(input_2 special_b);
5052

5153
Macros are defined in pattern-matching style:
5254

53-
## Invocation syntax
55+
# Invocation syntax
5456

5557
On the left-hand-side of the `=>` is the macro invocation syntax. It is
5658
free-form, excepting the following rules:
@@ -69,7 +71,7 @@ rules of tokenization apply,
6971
So `($x:ident => (($e:expr)))`, though excessively fancy, would create a macro
7072
that could be invoked like `my_macro!(i=>(( 2+2 )))`.
7173

72-
## Transcription syntax
74+
# Transcription syntax
7375

7476
The right-hand side of the `=>` follows the same rules as the left-hand side,
7577
except that `$` need only be followed by the name of the syntactic fragment
@@ -80,9 +82,9 @@ an expression; currently, user-defined macros can only be invoked in
8082
expression position (even though `macro_rules!` itself can be in item
8183
position).
8284

83-
## Multiplicity
85+
# Multiplicity
8486

85-
### Invocation
87+
## Invocation
8688

8789
Going back to the motivating example, suppose that we wanted each invocation
8890
of `early_return` to potentially accept multiple "special" identifiers. The

branches/incoming/doc/tutorial-tasks.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
% Tasks and communication in Rust
1+
% Rust Tasks and Communication Tutorial
2+
3+
# Introduction
24

35
Rust supports a system of lightweight tasks, similar to what is found
46
in Erlang or other actor systems. Rust tasks communicate via messages

0 commit comments

Comments
 (0)