Skip to content

Commit bc76dc1

Browse files
committed
---
yaml --- r: 148183 b: refs/heads/try2 c: 4fc0452 h: refs/heads/master i: 148181: f48be99 148179: b184c97 148175: 67893ec v: v3
1 parent 591fcc0 commit bc76dc1

File tree

136 files changed

+381
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+381
-478
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: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5a6ca45c8ad26f1ace1c46e6452155d511d065d8
8+
refs/heads/try2: 4fc0452acef1355ba566a30c5bd04ccd3b9acef2
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/guide-conditions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ fn main() {
275275
276276
};
277277
if result.is_err() {
278-
println("parsing failed");
278+
println!("parsing failed");
279279
}
280280
}
281281

branches/try2/doc/guide-container.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ let xs = [2u, 3, 5, 7, 11, 13, 17];
218218

219219
// print out all the elements in the vector
220220
for x in xs.iter() {
221-
println(x.to_str())
221+
println!("{}", *x)
222222
}
223223

224224
// print out all but the first 3 elements in the vector
225225
for x in xs.iter().skip(3) {
226-
println(x.to_str())
226+
println!("{}", *x)
227227
}
228228
~~~
229229

branches/try2/doc/guide-pointers.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ struct Point {
222222
fn main() {
223223
let a = Point { x: 10, y: 20 };
224224
do spawn {
225-
println(a.x.to_str());
225+
println!("{}", a.x);
226226
}
227227
}
228228
~~~
@@ -239,7 +239,7 @@ struct Point {
239239
fn main() {
240240
let a = ~Point { x: 10, y: 20 };
241241
do spawn {
242-
println(a.x.to_str());
242+
println!("{}", a.x);
243243
}
244244
}
245245
~~~
@@ -270,18 +270,22 @@ struct Point {
270270
fn main() {
271271
let a = ~Point { x: 10, y: 20 };
272272
let b = a;
273-
println(b.x.to_str());
274-
println(a.x.to_str());
273+
println!("{}", b.x);
274+
println!("{}", a.x);
275275
}
276276
~~~
277277

278278
You'll get this error:
279279

280280
~~~ {.notrust}
281-
test.rs:10:12: 10:13 error: use of moved value: `a`
282-
test.rs:10 println(a.x.to_str());
283-
^
284-
test.rs:8:8: 8:9 note: `a` moved here because it has type `~Point`, which is moved by default (use `ref` to override)
281+
test.rs:10:20: 10:21 error: use of moved value: `a`
282+
test.rs:10 println!("{}", a.x);
283+
^
284+
note: in expansion of format_args!
285+
<std-macros>:158:27: 158:81 note: expansion site
286+
<std-macros>:157:5: 159:6 note: in expansion of println!
287+
test.rs:10:5: 10:25 note: expansion site
288+
test.rs:8:9: 8:10 note: `a` moved here because it has type `~Point`, which is moved by default (use `ref` to override)
285289
test.rs:8 let b = a;
286290
^
287291
~~~
@@ -297,8 +301,8 @@ struct Point {
297301
fn main() {
298302
let a = @Point { x: 10, y: 20 };
299303
let b = a;
300-
println(b.x.to_str());
301-
println(a.x.to_str());
304+
println!("{}", b.x);
305+
println!("{}", a.x);
302306
}
303307
~~~
304308

@@ -367,7 +371,7 @@ compile?
367371

368372
~~~rust{.xfail-test}
369373
fn main() {
370-
println(x.to_str());
374+
println!("{}", x);
371375
let x = 5;
372376
}
373377
~~~

branches/try2/doc/guide-rustpkg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Next, let's add a source file:
143143
#[license = "MIT"];
144144
145145
pub fn world() {
146-
println("Hello, world.");
146+
println!("Hello, world.");
147147
}
148148
~~~
149149

branches/try2/doc/guide-tasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ closure in the new task.
7272
# use std::task::spawn;
7373
7474
// Print something profound in a different task using a named function
75-
fn print_message() { println("I am running in a different task!"); }
75+
fn print_message() { println!("I am running in a different task!"); }
7676
spawn(print_message);
7777
7878
// Print something more profound in a different task using a lambda expression
79-
spawn(proc() println("I am also running in a different task!") );
79+
spawn(proc() println!("I am also running in a different task!") );
8080
8181
// The canonical way to spawn is using `do` notation
8282
do spawn {
83-
println("I too am running in a different task!");
83+
println!("I too am running in a different task!");
8484
}
8585
~~~~
8686

branches/try2/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,7 +2668,7 @@ An example:
26682668
let mut i = 0;
26692669
26702670
while i < 10 {
2671-
println("hello\n");
2671+
println!("hello");
26722672
i = i + 1;
26732673
}
26742674
~~~~
@@ -3267,7 +3267,7 @@ impl Printable for int {
32673267
}
32683268
32693269
fn print(a: @Printable) {
3270-
println(a.to_string());
3270+
println!("{}", a.to_string());
32713271
}
32723272
32733273
fn main() {

0 commit comments

Comments
 (0)