Skip to content

Commit 3bc3be8

Browse files
committed
---
yaml --- r: 116373 b: refs/heads/snap-stage3 c: 66ee71a h: refs/heads/master i: 116371: c60e818 v: v3
1 parent c9f230b commit 3bc3be8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: bee4e6adac17f87b1cdc26ab69f8c0f5d82575a3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f740e8dde1a9ffa11865eb0d980423192142f049
4+
refs/heads/snap-stage3: 66ee71a51732f3d36cd6efe14ca1e02031d26fb3
55
refs/heads/try: 009d898a9422ac04c1aa60c0e9aff3abc5fa4672
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/doc/rust.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,8 @@ fn main() {
886886
// Equivalent to 'std::iter::range_step(0, 10, 2);'
887887
range_step(0, 10, 2);
888888
889-
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
890-
foo(~[Some(1.0), None]);
889+
// Equivalent to 'foo(vec![std::option::Some(1.0), std::option::None]);'
890+
foo(vec![Some(1.0), None]);
891891
}
892892
~~~~
893893

@@ -995,8 +995,8 @@ the function name.
995995
fn iter<T>(seq: &[T], f: |T|) {
996996
for elt in seq.iter() { f(elt); }
997997
}
998-
fn map<T, U>(seq: &[T], f: |T| -> U) -> ~[U] {
999-
let mut acc = ~[];
998+
fn map<T, U>(seq: &[T], f: |T| -> U) -> Vec<U> {
999+
let mut acc = vec![];
10001000
for elt in seq.iter() { acc.push(f(elt)); }
10011001
acc
10021002
}
@@ -1159,19 +1159,19 @@ except that they have the `extern` modifier.
11591159

11601160
~~~~
11611161
// Declares an extern fn, the ABI defaults to "C"
1162-
extern fn new_vec() -> ~[int] { ~[] }
1162+
extern fn new_int() -> int { 0 }
11631163
11641164
// Declares an extern fn with "stdcall" ABI
1165-
extern "stdcall" fn new_vec_stdcall() -> ~[int] { ~[] }
1165+
extern "stdcall" fn new_int_stdcall() -> int { 0 }
11661166
~~~~
11671167

11681168
Unlike normal functions, extern fns have an `extern "ABI" fn()`.
11691169
This is the same type as the functions declared in an extern
11701170
block.
11711171

11721172
~~~~
1173-
# extern fn new_vec() -> ~[int] { ~[] }
1174-
let fptr: extern "C" fn() -> ~[int] = new_vec;
1173+
# extern fn new_int() -> int { 0 }
1174+
let fptr: extern "C" fn() -> int = new_int;
11751175
~~~~
11761176

11771177
Extern functions may be called directly from Rust code as Rust uses large,
@@ -1509,7 +1509,7 @@ Implementation parameters are written after the `impl` keyword.
15091509

15101510
~~~~
15111511
# trait Seq<T> { }
1512-
impl<T> Seq<T> for ~[T] {
1512+
impl<T> Seq<T> for Vec<T> {
15131513
/* ... */
15141514
}
15151515
impl Seq<bool> for u32 {
@@ -3347,7 +3347,7 @@ Such a definite-sized vector type is a first-class type, since its size is known
33473347
A vector without such a size is said to be of _indefinite_ size,
33483348
and is therefore not a _first-class_ type.
33493349
An indefinite-size vector can only be instantiated through a pointer type,
3350-
such as `&[T]` or `~[T]`.
3350+
such as `&[T]` or `Vec<T>`.
33513351
The kind of a vector type depends on the kind of its element type,
33523352
as with other simple structural types.
33533353

0 commit comments

Comments
 (0)