Skip to content

Commit 7c795d9

Browse files
committed
---
yaml --- r: 81302 b: refs/heads/snap-stage3 c: dec3705 h: refs/heads/master v: v3
1 parent 4c9c2dd commit 7c795d9

File tree

829 files changed

+5179
-5104
lines changed

Some content is hidden

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

829 files changed

+5179
-5104
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: d379ff474fac357f599d111f364449f2a6aaf3cb
4+
refs/heads/snap-stage3: dec37051dd01b3faf921163a5d8370223ff77682
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)
91+
CFG_RUSTC_FLAGS := $(RUSTFLAGS) --cfg nofmt
9292
CFG_GCCISH_CFLAGS :=
9393
CFG_GCCISH_LINK_FLAGS :=
9494

branches/snap-stage3/doc/rust.md

Lines changed: 24 additions & 22 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-
# fail!();
686+
# fail2!();
687687
}
688688
fn cos(f: f64) -> f64 {
689689
...
690-
# fail!();
690+
# fail2!();
691691
}
692692
fn tan(f: f64) -> f64 {
693693
...
694-
# fail!();
694+
# fail2!();
695695
}
696696
}
697697
~~~~~~~~
@@ -817,12 +817,14 @@ An example of `use` declarations:
817817
use std::num::sin;
818818
use std::option::{Some, None};
819819
820+
# fn foo<T>(_: T){}
821+
820822
fn main() {
821-
// Equivalent to 'info!(std::num::sin(1.0));'
822-
info!(sin(1.0));
823+
// Equivalent to 'std::num::sin(1.0);'
824+
sin(1.0);
823825
824-
// Equivalent to 'info!(~[std::option::Some(1.0), std::option::None]);'
825-
info!(~[Some(1.0), None]);
826+
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
827+
foo(~[Some(1.0), None]);
826828
}
827829
~~~~
828830

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

10411043
~~~~
10421044
fn my_err(s: &str) -> ! {
1043-
info!(s);
1044-
fail!();
1045+
info2!("{}", s);
1046+
fail2!();
10451047
}
10461048
~~~~
10471049

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

10611063
~~~~
1062-
# fn my_err(s: &str) -> ! { fail!() }
1064+
# fn my_err(s: &str) -> ! { fail2!() }
10631065
10641066
fn f(i: int) -> int {
10651067
if i == 42 {
@@ -2382,7 +2384,7 @@ fn ten_times(f: &fn(int)) {
23822384
}
23832385
}
23842386
2385-
ten_times(|j| println(fmt!("hello, %d", j)));
2387+
ten_times(|j| println!("hello, {}", j));
23862388
23872389
~~~~
23882390

@@ -2594,9 +2596,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
25942596
let x: List<int> = Cons(10, @Cons(11, @Nil));
25952597
25962598
match x {
2597-
Cons(_, @Nil) => fail!("singleton list"),
2599+
Cons(_, @Nil) => fail2!("singleton list"),
25982600
Cons(*) => return,
2599-
Nil => fail!("empty list")
2601+
Nil => fail2!("empty list")
26002602
}
26012603
~~~~
26022604

@@ -2633,7 +2635,7 @@ match x {
26332635
return;
26342636
}
26352637
_ => {
2636-
fail!();
2638+
fail2!();
26372639
}
26382640
}
26392641
~~~~
@@ -2687,7 +2689,7 @@ guard may refer to the variables bound within the pattern they follow.
26872689
let message = match maybe_digit {
26882690
Some(x) if x < 10 => process_digit(x),
26892691
Some(x) => process_other(x),
2690-
None => fail!()
2692+
None => fail2!()
26912693
};
26922694
~~~~
26932695

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

34733475
```rust
34743476
fn main() {
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")
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")
34793481
}
34803482
```
34813483

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

34843486
```bash
34853487
$ RUST_LOG=rust=3 ./rust
3486-
rust: ~"\"This is an error log\""
3487-
rust: ~"\"This is a warn log\""
3488-
rust: ~"\"this is an info log\""
3488+
This is an error log
3489+
This is a warn log
3490+
this is an info log
34893491
```
34903492

34913493
# 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(fmt!("%4.4d, %4.4d", a, b));
69+
println!("{: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(fmt!("%4.4d, %4.4d", a, b));
284+
println!("{: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(fmt!("%4.4d, %4.4d", a, b));
390+
println!("{: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(fmt!("%4.4d, %4.4d", a, b));
465+
println!("{: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(fmt!("%4.4d, %4.4d", a, b));
543+
println!("{: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(fmt!("%4.4d, %4.4d", a, b));
639+
println!("{: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(fmt!("%4.4d, %4.4d", a, b));
769+
println!("{: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-
_ => fail!("Didn't get good_2")
229+
_ => fail2!("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 { fail!("Didn't get good_2") };
271+
else { fail2!("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 { fail!("Didn't get good_2") };
372+
(g1.body) ~ (good_2(result) ) else { fail2!("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: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,14 @@ 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;
103102
# use std::task::spawn;
104103
# fn generate_task_number() -> int { 0 }
105104
// Generate some state locally
106105
let child_task_number = generate_task_number();
107106
108107
do spawn {
109108
// Capture it in the remote task
110-
println(fmt!("I am child number %d", child_task_number));
109+
println!("I am child number {}", child_task_number);
111110
}
112111
~~~
113112

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

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

@@ -338,7 +337,7 @@ fn pnorm(nums: &~[float], p: uint) -> float {
338337
339338
fn main() {
340339
let numbers = vec::from_fn(1000000, |_| rand::random::<float>());
341-
println(fmt!("Inf-norm = %?", *numbers.iter().max().unwrap()));
340+
println!("Inf-norm = {}", *numbers.iter().max().unwrap());
342341
343342
let numbers_arc = Arc::new(numbers);
344343
@@ -349,7 +348,7 @@ fn main() {
349348
do spawn {
350349
let local_arc : Arc<~[float]> = port.recv();
351350
let task_numbers = local_arc.get();
352-
println(fmt!("%u-norm = %?", num, pnorm(task_numbers, num)));
351+
println!("{}-norm = {}", num, pnorm(task_numbers, num));
353352
}
354353
}
355354
}

0 commit comments

Comments
 (0)