Skip to content

Commit 0bd908b

Browse files
committed
---
yaml --- r: 120814 b: refs/heads/dist-snap c: 66ee71a h: refs/heads/master v: v3
1 parent cc19c78 commit 0bd908b

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
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: f740e8dde1a9ffa11865eb0d980423192142f049
9+
refs/heads/dist-snap: 66ee71a51732f3d36cd6efe14ca1e02031d26fb3
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)