Skip to content

Commit c8096b4

Browse files
committed
---
yaml --- r: 81299 b: refs/heads/snap-stage3 c: f6df7ab h: refs/heads/master i: 81297: 05a29d3 81295: 53a4c70 v: v3
1 parent ffe5981 commit c8096b4

File tree

819 files changed

+4795
-4797
lines changed

Some content is hidden

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

819 files changed

+4795
-4797
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: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1f52cf439bec551cd88010fa6d9bcdf681a8b3af
4+
refs/heads/snap-stage3: f6df7ab839fef099af163463ae99b9541d3d12c5
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ifneq ($(wildcard $(NON_BUILD_TARGET_TRIPLES)),)
8888
CFG_INFO := $(info cfg: non-build target triples $(NON_BUILD_TARGET_TRIPLES))
8989
endif
9090

91-
CFG_RUSTC_FLAGS := $(RUSTFLAGS) --cfg nofmt
91+
CFG_RUSTC_FLAGS := $(RUSTFLAGS)
9292
CFG_GCCISH_CFLAGS :=
9393
CFG_GCCISH_LINK_FLAGS :=
9494

branches/snap-stage3/doc/rust.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -683,15 +683,15 @@ mod math {
683683
type complex = (f64, f64);
684684
fn sin(f: f64) -> f64 {
685685
...
686-
# fail2!();
686+
# fail!();
687687
}
688688
fn cos(f: f64) -> f64 {
689689
...
690-
# fail2!();
690+
# fail!();
691691
}
692692
fn tan(f: f64) -> f64 {
693693
...
694-
# fail2!();
694+
# fail!();
695695
}
696696
}
697697
~~~~~~~~
@@ -817,14 +817,12 @@ An example of `use` declarations:
817817
use std::num::sin;
818818
use std::option::{Some, None};
819819
820-
# fn foo<T>(_: T){}
821-
822820
fn main() {
823-
// Equivalent to 'std::num::sin(1.0);'
824-
sin(1.0);
821+
// Equivalent to 'info!(std::num::sin(1.0));'
822+
info!(sin(1.0));
825823
826-
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
827-
foo(~[Some(1.0), None]);
824+
// Equivalent to 'info!(~[std::option::Some(1.0), std::option::None]);'
825+
info!(~[Some(1.0), None]);
828826
}
829827
~~~~
830828

@@ -1042,8 +1040,8 @@ output slot type would normally be. For example:
10421040

10431041
~~~~
10441042
fn my_err(s: &str) -> ! {
1045-
info2!("{}", s);
1046-
fail2!();
1043+
info!(s);
1044+
fail!();
10471045
}
10481046
~~~~
10491047

@@ -1061,7 +1059,7 @@ were declared without the `!` annotation, the following code would not
10611059
typecheck:
10621060

10631061
~~~~
1064-
# fn my_err(s: &str) -> ! { fail2!() }
1062+
# fn my_err(s: &str) -> ! { fail!() }
10651063
10661064
fn f(i: int) -> int {
10671065
if i == 42 {
@@ -2384,7 +2382,7 @@ fn ten_times(f: &fn(int)) {
23842382
}
23852383
}
23862384
2387-
ten_times(|j| println!("hello, {}", j));
2385+
ten_times(|j| println(fmt!("hello, %d", j)));
23882386
23892387
~~~~
23902388

@@ -2596,9 +2594,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
25962594
let x: List<int> = Cons(10, @Cons(11, @Nil));
25972595
25982596
match x {
2599-
Cons(_, @Nil) => fail2!("singleton list"),
2597+
Cons(_, @Nil) => fail!("singleton list"),
26002598
Cons(*) => return,
2601-
Nil => fail2!("empty list")
2599+
Nil => fail!("empty list")
26022600
}
26032601
~~~~
26042602

@@ -2635,7 +2633,7 @@ match x {
26352633
return;
26362634
}
26372635
_ => {
2638-
fail2!();
2636+
fail!();
26392637
}
26402638
}
26412639
~~~~
@@ -2689,7 +2687,7 @@ guard may refer to the variables bound within the pattern they follow.
26892687
let message = match maybe_digit {
26902688
Some(x) if x < 10 => process_digit(x),
26912689
Some(x) => process_other(x),
2692-
None => fail2!()
2690+
None => fail!()
26932691
};
26942692
~~~~
26952693

@@ -3474,20 +3472,20 @@ that demonstrates all four of them:
34743472

34753473
```rust
34763474
fn main() {
3477-
error2!("This is an error log")
3478-
warn2!("This is a warn log")
3479-
info2!("this is an info log")
3480-
debug2!("This is a debug log")
3475+
error!("This is an error log")
3476+
warn!("This is a warn log")
3477+
info!("this is an info log")
3478+
debug!("This is a debug log")
34813479
}
34823480
```
34833481

34843482
These four log levels correspond to levels 1-4, as controlled by `RUST_LOG`:
34853483

34863484
```bash
34873485
$ RUST_LOG=rust=3 ./rust
3488-
This is an error log
3489-
This is a warn log
3490-
this is an info log
3486+
rust: ~"\"This is an error log\""
3487+
rust: ~"\"This is a warn log\""
3488+
rust: ~"\"this is an info log\""
34913489
```
34923490

34933491
# Appendix: Rationales and design tradeoffs

branches/snap-stage3/doc/tutorial-conditions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ use std::int;
6666
fn main() {
6767
let pairs = read_int_pairs();
6868
for &(a,b) in pairs.iter() {
69-
println!("{:4.4d}, {:4.4d}", a, b);
69+
println(fmt!("%4.4d, %4.4d", a, b));
7070
}
7171
}
7272
@@ -281,7 +281,7 @@ fn main() {
281281
// The protected logic.
282282
let pairs = read_int_pairs();
283283
for &(a,b) in pairs.iter() {
284-
println!("{:4.4d}, {:4.4d}", a, b);
284+
println(fmt!("%4.4d, %4.4d", a, b));
285285
}
286286
287287
};
@@ -387,7 +387,7 @@ condition! {
387387
fn main() {
388388
let pairs = read_int_pairs();
389389
for &(a,b) in pairs.iter() {
390-
println!("{:4.4d}, {:4.4d}", a, b);
390+
println(fmt!("%4.4d, %4.4d", a, b));
391391
}
392392
}
393393
@@ -462,7 +462,7 @@ fn main() {
462462
// The protected logic.
463463
let pairs = read_int_pairs();
464464
for &(a,b) in pairs.iter() {
465-
println!("{:4.4d}, {:4.4d}", a, b);
465+
println(fmt!("%4.4d, %4.4d", a, b));
466466
}
467467
468468
}
@@ -540,7 +540,7 @@ fn main() {
540540
// The protected logic.
541541
let pairs = read_int_pairs();
542542
for &(a,b) in pairs.iter() {
543-
println!("{:4.4d}, {:4.4d}", a, b);
543+
println(fmt!("%4.4d, %4.4d", a, b));
544544
}
545545
546546
}
@@ -636,7 +636,7 @@ fn main() {
636636
// The protected logic.
637637
let pairs = read_int_pairs();
638638
for &(a,b) in pairs.iter() {
639-
println!("{:4.4d}, {:4.4d}", a, b);
639+
println(fmt!("%4.4d, %4.4d", a, b));
640640
}
641641
642642
}
@@ -766,7 +766,7 @@ fn main() {
766766
// The protected logic.
767767
let pairs = read_int_pairs();
768768
for &(a,b) in pairs.iter() {
769-
println!("{:4.4d}, {:4.4d}", a, b);
769+
println(fmt!("%4.4d, %4.4d", a, b));
770770
}
771771
772772
}

branches/snap-stage3/doc/tutorial-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ match x {
226226
// complicated stuff goes here
227227
return result + val;
228228
},
229-
_ => fail2!("Didn't get good_2")
229+
_ => fail!("Didn't get good_2")
230230
}
231231
}
232232
_ => return 0 // default value
@@ -268,7 +268,7 @@ macro_rules! biased_match (
268268
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
269269
binds g1, val )
270270
biased_match!((g1.body) ~ (good_2(result) )
271-
else { fail2!("Didn't get good_2") };
271+
else { fail!("Didn't get good_2") };
272272
binds result )
273273
// complicated stuff goes here
274274
return result + val;
@@ -369,7 +369,7 @@ macro_rules! biased_match (
369369
# fn f(x: t1) -> uint {
370370
biased_match!(
371371
(x) ~ (good_1(g1, val)) else { return 0 };
372-
(g1.body) ~ (good_2(result) ) else { fail2!("Didn't get good_2") };
372+
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
373373
binds val, result )
374374
// complicated stuff goes here
375375
return result + val;

branches/snap-stage3/doc/tutorial-tasks.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,15 @@ execution. Like any closure, the function passed to `spawn` may capture
9999
an environment that it carries across tasks.
100100

101101
~~~
102+
# use std::io::println;
102103
# use std::task::spawn;
103104
# fn generate_task_number() -> int { 0 }
104105
// Generate some state locally
105106
let child_task_number = generate_task_number();
106107
107108
do spawn {
108109
// Capture it in the remote task
109-
println!("I am child number {}", child_task_number);
110+
println(fmt!("I am child number %d", child_task_number));
110111
}
111112
~~~
112113

@@ -281,7 +282,7 @@ fn fib(n: uint) -> uint {
281282
282283
let mut delayed_fib = extra::future::Future::spawn (|| fib(50) );
283284
make_a_sandwich();
284-
println!("fib(50) = {:?}", delayed_fib.get())
285+
println(fmt!("fib(50) = %?", delayed_fib.get()))
285286
~~~
286287

287288
The call to `future::spawn` returns immediately a `future` object regardless of how long it
@@ -309,7 +310,7 @@ fn main() {
309310
for ft in futures.mut_iter() {
310311
final_res += ft.get();
311312
}
312-
println!("π^2/6 is not far from : {}", final_res);
313+
println(fmt!("π^2/6 is not far from : %?", final_res));
313314
}
314315
~~~
315316

@@ -337,7 +338,7 @@ fn pnorm(nums: &~[float], p: uint) -> float {
337338
338339
fn main() {
339340
let numbers = vec::from_fn(1000000, |_| rand::random::<float>());
340-
println!("Inf-norm = {}", *numbers.iter().max().unwrap());
341+
println(fmt!("Inf-norm = %?", *numbers.iter().max().unwrap()));
341342
342343
let numbers_arc = Arc::new(numbers);
343344
@@ -348,7 +349,7 @@ fn main() {
348349
do spawn {
349350
let local_arc : Arc<~[float]> = port.recv();
350351
let task_numbers = local_arc.get();
351-
println!("{}-norm = {}", num, pnorm(task_numbers, num));
352+
println(fmt!("%u-norm = %?", num, pnorm(task_numbers, num)));
352353
}
353354
}
354355
}

0 commit comments

Comments
 (0)