Skip to content

Commit ff50ef5

Browse files
committed
---
yaml --- r: 95166 b: refs/heads/dist-snap c: 012f909 h: refs/heads/master v: v3
1 parent d508eae commit ff50ef5

File tree

1,023 files changed

+9931
-10976
lines changed

Some content is hidden

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

1,023 files changed

+9931
-10976
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 28e88b4c6f752203c4ceff7d87094de63e8fdb8d
9+
refs/heads/dist-snap: 012f909f3546dc7515b43ba389cfc0a1ead0d21f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/Makefile.in

Lines changed: 7 additions & 3 deletions
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

@@ -141,11 +141,11 @@ endif
141141

142142
# version-string calculation
143143
CFG_GIT_DIR := $(CFG_SRC_DIR).git
144-
CFG_RELEASE = 0.8
144+
CFG_RELEASE = 0.9-pre
145145
CFG_VERSION = $(CFG_RELEASE)
146146
# windows exe's need numeric versions - don't use anything but
147147
# numbers and dots here
148-
CFG_VERSION_WIN = 0.8
148+
CFG_VERSION_WIN = 0.9
149149

150150
ifneq ($(wildcard $(CFG_GIT)),)
151151
ifneq ($(wildcard $(CFG_GIT_DIR)),)
@@ -608,6 +608,10 @@ config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
608608
# Primary-target makefiles
609609
######################################################################
610610

611+
# Issue #9531: If you change the order of any of the following (or add
612+
# new definitions), make sure definitions always precede their uses,
613+
# especially for the dependency lists of recipes.
614+
611615
include $(CFG_SRC_DIR)mk/target.mk
612616
include $(CFG_SRC_DIR)mk/host.mk
613617
include $(CFG_SRC_DIR)mk/stage0.mk

branches/dist-snap/doc/rust.md

Lines changed: 58 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -363,19 +363,17 @@ A _floating-point literal_ has one of two forms:
363363
second decimal literal.
364364
* A single _decimal literal_ followed by an _exponent_.
365365

366-
By default, a floating-point literal is of type `float`. A
367-
floating-point literal may be followed (immediately, without any
368-
spaces) by a _floating-point suffix_, which changes the type of the
369-
literal. There are three floating-point suffixes: `f` (for the base
370-
`float` type), `f32`, and `f64` (the 32-bit and 64-bit floating point
371-
types).
366+
By default, a floating-point literal has a generic type, but will fall back to
367+
`f64`. A floating-point literal may be followed (immediately, without any
368+
spaces) by a _floating-point suffix_, which changes the type of the literal.
369+
There are two floating-point suffixes: `f32`, and `f64` (the 32-bit and 64-bit
370+
floating point types).
372371

373372
Examples of floating-point literals of various forms:
374373

375374
~~~~
376-
123.0; // type float
377-
0.1; // type float
378-
3f; // type float
375+
123.0; // type f64
376+
0.1; // type f64
379377
0.1f32; // type f32
380378
12E+99_f64; // type f64
381379
~~~~
@@ -683,15 +681,15 @@ mod math {
683681
type complex = (f64, f64);
684682
fn sin(f: f64) -> f64 {
685683
...
686-
# fail!();
684+
# fail2!();
687685
}
688686
fn cos(f: f64) -> f64 {
689687
...
690-
# fail!();
688+
# fail2!();
691689
}
692690
fn tan(f: f64) -> f64 {
693691
...
694-
# fail!();
692+
# fail2!();
695693
}
696694
}
697695
~~~~~~~~
@@ -817,12 +815,14 @@ An example of `use` declarations:
817815
use std::num::sin;
818816
use std::option::{Some, None};
819817
818+
# fn foo<T>(_: T){}
819+
820820
fn main() {
821-
// Equivalent to 'info!(std::num::sin(1.0));'
822-
info!(sin(1.0));
821+
// Equivalent to 'std::num::sin(1.0);'
822+
sin(1.0);
823823
824-
// Equivalent to 'info!(~[std::option::Some(1.0), std::option::None]);'
825-
info!(~[Some(1.0), None]);
824+
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
825+
foo(~[Some(1.0), None]);
826826
}
827827
~~~~
828828

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

10411041
~~~~
10421042
fn my_err(s: &str) -> ! {
1043-
info!(s);
1044-
fail!();
1043+
info2!("{}", s);
1044+
fail2!();
10451045
}
10461046
~~~~
10471047

@@ -1059,7 +1059,7 @@ were declared without the `!` annotation, the following code would not
10591059
typecheck:
10601060

10611061
~~~~
1062-
# fn my_err(s: &str) -> ! { fail!() }
1062+
# fn my_err(s: &str) -> ! { fail2!() }
10631063
10641064
fn f(i: int) -> int {
10651065
if i == 42 {
@@ -1177,8 +1177,8 @@ a = Cat;
11771177
Enumeration constructors can have either named or unnamed fields:
11781178
~~~~
11791179
enum Animal {
1180-
Dog (~str, float),
1181-
Cat { name: ~str, weight: float }
1180+
Dog (~str, f64),
1181+
Cat { name: ~str, weight: f64 }
11821182
}
11831183
11841184
let mut a: Animal = Dog(~"Cocoa", 37.2);
@@ -1342,17 +1342,17 @@ For example:
13421342
trait Num {
13431343
fn from_int(n: int) -> Self;
13441344
}
1345-
impl Num for float {
1346-
fn from_int(n: int) -> float { n as float }
1345+
impl Num for f64 {
1346+
fn from_int(n: int) -> f64 { n as f64 }
13471347
}
1348-
let x: float = Num::from_int(42);
1348+
let x: f64 = Num::from_int(42);
13491349
~~~~
13501350

13511351
Traits may inherit from other traits. For example, in
13521352

13531353
~~~~
1354-
trait Shape { fn area() -> float; }
1355-
trait Circle : Shape { fn radius() -> float; }
1354+
trait Shape { fn area() -> f64; }
1355+
trait Circle : Shape { fn radius() -> f64; }
13561356
~~~~
13571357

13581358
the syntax `Circle : Shape` means that types that implement `Circle` must also have an implementation for `Shape`.
@@ -1365,9 +1365,9 @@ methods of the supertrait may be called on values of subtrait-bound type paramet
13651365
Referring to the previous example of `trait Circle : Shape`:
13661366

13671367
~~~
1368-
# trait Shape { fn area(&self) -> float; }
1369-
# trait Circle : Shape { fn radius(&self) -> float; }
1370-
fn radius_times_area<T: Circle>(c: T) -> float {
1368+
# trait Shape { fn area(&self) -> f64; }
1369+
# trait Circle : Shape { fn radius(&self) -> f64; }
1370+
fn radius_times_area<T: Circle>(c: T) -> f64 {
13711371
// `c` is both a Circle and a Shape
13721372
c.radius() * c.area()
13731373
}
@@ -1376,10 +1376,10 @@ fn radius_times_area<T: Circle>(c: T) -> float {
13761376
Likewise, supertrait methods may also be called on trait objects.
13771377

13781378
~~~ {.xfail-test}
1379-
# trait Shape { fn area(&self) -> float; }
1380-
# trait Circle : Shape { fn radius(&self) -> float; }
1381-
# impl Shape for int { fn area(&self) -> float { 0.0 } }
1382-
# impl Circle for int { fn radius(&self) -> float { 0.0 } }
1379+
# trait Shape { fn area(&self) -> f64; }
1380+
# trait Circle : Shape { fn radius(&self) -> f64; }
1381+
# impl Shape for int { fn area(&self) -> f64 { 0.0 } }
1382+
# impl Circle for int { fn radius(&self) -> f64 { 0.0 } }
13831383
# let mycircle = 0;
13841384
13851385
let mycircle: Circle = @mycircle as @Circle;
@@ -1393,14 +1393,14 @@ An _implementation_ is an item that implements a [trait](#traits) for a specific
13931393
Implementations are defined with the keyword `impl`.
13941394

13951395
~~~~
1396-
# struct Point {x: float, y: float};
1396+
# struct Point {x: f64, y: f64};
13971397
# type Surface = int;
1398-
# struct BoundingBox {x: float, y: float, width: float, height: float};
1398+
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
13991399
# trait Shape { fn draw(&self, Surface); fn bounding_box(&self) -> BoundingBox; }
14001400
# fn do_draw_circle(s: Surface, c: Circle) { }
14011401
14021402
struct Circle {
1403-
radius: float,
1403+
radius: f64,
14041404
center: Point,
14051405
}
14061406
@@ -1968,7 +1968,7 @@ values.
19681968

19691969
~~~~~~~~ {.tuple}
19701970
(0,);
1971-
(0f, 4.5f);
1971+
(0.0, 4.5);
19721972
("a", 4u, true);
19731973
~~~~~~~~
19741974

@@ -2000,12 +2000,12 @@ A _unit-like structure expression_ consists only of the [path](#paths) of a [str
20002000
The following are examples of structure expressions:
20012001

20022002
~~~~
2003-
# struct Point { x: float, y: float }
2004-
# struct TuplePoint(float, float);
2003+
# struct Point { x: f64, y: f64 }
2004+
# struct TuplePoint(f64, f64);
20052005
# mod game { pub struct User<'self> { name: &'self str, age: uint, score: uint } }
20062006
# struct Cookie; fn some_fn<T>(t: T) {}
2007-
Point {x: 10f, y: 20f};
2008-
TuplePoint(10f, 20f);
2007+
Point {x: 10.0, y: 20.0};
2008+
TuplePoint(10.0, 20.0);
20092009
let u = game::User {name: "Joe", age: 35, score: 100_000};
20102010
some_fn::<Cookie>(Cookie);
20112011
~~~~
@@ -2246,12 +2246,12 @@ Any other cast is unsupported and will fail to compile.
22462246
An example of an `as` expression:
22472247

22482248
~~~~
2249-
# fn sum(v: &[float]) -> float { 0.0 }
2250-
# fn len(v: &[float]) -> int { 0 }
2249+
# fn sum(v: &[f64]) -> f64 { 0.0 }
2250+
# fn len(v: &[f64]) -> int { 0 }
22512251
2252-
fn avg(v: &[float]) -> float {
2253-
let sum: float = sum(v);
2254-
let sz: float = len(v) as float;
2252+
fn avg(v: &[f64]) -> f64 {
2253+
let sum: f64 = sum(v);
2254+
let sz: f64 = len(v) as f64;
22552255
return sum / sz;
22562256
}
22572257
~~~~
@@ -2382,7 +2382,7 @@ fn ten_times(f: &fn(int)) {
23822382
}
23832383
}
23842384
2385-
ten_times(|j| println(fmt!("hello, %d", j)));
2385+
ten_times(|j| println!("hello, {}", j));
23862386
23872387
~~~~
23882388

@@ -2594,9 +2594,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
25942594
let x: List<int> = Cons(10, @Cons(11, @Nil));
25952595
25962596
match x {
2597-
Cons(_, @Nil) => fail!("singleton list"),
2597+
Cons(_, @Nil) => fail2!("singleton list"),
25982598
Cons(*) => return,
2599-
Nil => fail!("empty list")
2599+
Nil => fail2!("empty list")
26002600
}
26012601
~~~~
26022602

@@ -2633,7 +2633,7 @@ match x {
26332633
return;
26342634
}
26352635
_ => {
2636-
fail!();
2636+
fail2!();
26372637
}
26382638
}
26392639
~~~~
@@ -2687,7 +2687,7 @@ guard may refer to the variables bound within the pattern they follow.
26872687
let message = match maybe_digit {
26882688
Some(x) if x < 10 => process_digit(x),
26892689
Some(x) => process_other(x),
2690-
None => fail!()
2690+
None => fail2!()
26912691
};
26922692
~~~~
26932693

@@ -2765,19 +2765,6 @@ size, in bits, is equal to the size of the rust type `uint` on the same target
27652765
machine.
27662766

27672767

2768-
#### Machine-dependent floating point type
2769-
2770-
The Rust type `float` is a machine-specific type equal to one of the supported
2771-
Rust floating-point machine types (`f32` or `f64`). It is the largest
2772-
floating-point type that is directly supported by hardware on the target
2773-
machine, or if the target machine has no floating-point hardware support, the
2774-
largest floating-point type supported by the software floating-point library
2775-
used to support the other floating-point machine types.
2776-
2777-
Note that due to the preference for hardware-supported floating-point, the
2778-
type `float` may not be equal to the largest *supported* floating-point type.
2779-
2780-
27812768
### Textual types
27822769

27832770
The types `char` and `str` hold textual data.
@@ -3472,20 +3459,20 @@ that demonstrates all four of them:
34723459

34733460
```rust
34743461
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")
3462+
error2!("This is an error log")
3463+
warn2!("This is a warn log")
3464+
info2!("this is an info log")
3465+
debug2!("This is a debug log")
34793466
}
34803467
```
34813468

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

34843471
```bash
34853472
$ 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\""
3473+
This is an error log
3474+
This is a warn log
3475+
this is an info log
34893476
```
34903477

34913478
# Appendix: Rationales and design tradeoffs

0 commit comments

Comments
 (0)