Skip to content

Commit 723e9a2

Browse files
committed
---
yaml --- r: 119181 b: refs/heads/dist-snap c: 6f1c06d h: refs/heads/master i: 119179: 30dddd3 v: v3
1 parent 81d6ab5 commit 723e9a2

Some content is hidden

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

70 files changed

+742
-766
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: 46790a7d27be661e94716a5ff8f17688f384a9a4
9+
refs/heads/dist-snap: 6f1c06d6a1b97fcd80d85c38bb33f8350c750401
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/RELEASES.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ Version 0.10 (April 2014)
66
* Language
77
* A new RFC process is now in place for modifying the language.
88
* Patterns with `@`-pointers have been removed from the language.
9-
* Patterns with unique vectors have been removed from the language.
9+
* Patterns with unique vectors (`~[T]`) have been removed from the
10+
language.
11+
* Patterns with unique strings (`~str`) have been removed from the
12+
language.
1013
* `@str` has been removed from the language.
1114
* `@[T]` has been removed from the language.
1215
* `@self` has been removed from the language.
@@ -25,9 +28,10 @@ Version 0.10 (April 2014)
2528
* Camel Case types
2629
* Uppercase variables
2730
* Publicly visible private types
31+
* `#[deriving]` with raw pointers
2832
* Unsafe functions can no longer be coerced to closures.
2933
* Various obscure macros such as `log_syntax!` are now behind feature gates.
30-
* The #[simd] attribute is now behind a feature gate.
34+
* The `#[simd]` attribute is now behind a feature gate.
3135
* Visibility is no longer allowed on `extern crate` statements, and
3236
unnecessary visibility (`priv`) is no longer allowed on `use` statements.
3337
* Trailing commas are now allowed in argument lists and tuple patterns.
@@ -39,7 +43,7 @@ Version 0.10 (April 2014)
3943
* The `Share` trait has been added for types that can be shared among
4044
threads.
4145
* Labels in macros are now hygienic.
42-
* Expresson/statement macro invocations can be delimited with `{}` now.
46+
* Expression/statement macro invocations can be delimited with `{}` now.
4347
* Treatment of types allowed in `static mut` locations has been tweaked.
4448
* The `*` and `.` operators are now overloadable through the `Deref` and
4549
`DerefMut` traits.
@@ -132,7 +136,7 @@ Version 0.10 (April 2014)
132136
* Tooling
133137
* `rustpkg` has been deprecated and removed from the main repository. Its
134138
replacement, `cargo`, is under development.
135-
* Nightly builds of rust are now available (INSERT URL HERE)
139+
* Nightly builds of rust are now available
136140
* The memory usage of rustc has been improved many times throughout this
137141
release cycle.
138142
* The build process supports disabling rpath support for the rustc binary
@@ -145,16 +149,20 @@ Version 0.10 (April 2014)
145149
* Output flags have been centralized into one `--emit` flag.
146150
* Crate type flags have been centralized into one `--crate-type` flag.
147151
* Codegen flags have been consolidated behind a `-C` flag.
148-
* `rustdoc` now implements syntax highlighting and rendering markdown files.
149-
* `rustdoc --test` now tests all code blocks by default.
150-
* `rustdoc` now shows documented macros.
151-
* `rustdoc` inlines documentation for reexported types.
152-
* `rustdoc` search works across crates now.
153152
* Linking against outdated crates now has improved error messages.
154153
* Error messages with lifetimes will often suggest how to annotate the
155154
function to fix the error.
156155
* Many more types are documented in the standard library, and new guides
157156
were written.
157+
* Many `rustdoc` improvements:
158+
* code blocks are syntax highlighted.
159+
* render standalone markdown files.
160+
* the --test flag tests all code blocks by default.
161+
* exported macros are displayed.
162+
* reexported types have their documentation inlined at the location of the
163+
first reexport.
164+
* search works across crates that have been rendered to the same output
165+
directory.
158166

159167
Version 0.9 (January 2014)
160168
--------------------------

branches/dist-snap/src/doc/complement-lang-faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ You may also be interested in browsing [GitHub's Rust][github-rust] page.
3131

3232
## Does it run on Windows?
3333

34-
Yes. All development happens in lock-step on all 3 target platforms. Using MinGW, not Cygwin. Note that the windows implementation currently has some limitations: in particular tasks [cannot unwind on windows][unwind], and all Rust executables [require a MinGW installation at runtime][libgcc].
34+
Yes. All development happens in lock-step on all 3 target platforms. Using MinGW, not Cygwin. Note that the windows implementation currently has some limitations: in particular 64-bit build is [not fully supported yet][win64], and all executables created by rustc [depends on libgcc DLL at runtime][libgcc].
3535

36-
[unwind]: https://github.com/mozilla/rust/issues/908
37-
[libgcc]: https://github.com/mozilla/rust/issues/1603
36+
[win64]: https://github.com/mozilla/rust/issues/1237
37+
[libgcc]: https://github.com/mozilla/rust/issues/11782
3838

3939
## Is it OO? How do I do this thing I normally do in an OO language?
4040

branches/dist-snap/src/doc/guide-pointers.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,6 @@ sense, they're simple: just keep whatever ownership the data already has. For
332332
example:
333333

334334
~~~rust
335-
use std::num::sqrt;
336-
337335
struct Point {
338336
x: f32,
339337
y: f32,
@@ -343,7 +341,7 @@ fn compute_distance(p1: &Point, p2: &Point) -> f32 {
343341
let x_d = p1.x - p2.x;
344342
let y_d = p1.y - p2.y;
345343

346-
sqrt(x_d * x_d + y_d * y_d)
344+
(x_d * x_d + y_d * y_d).sqrt()
347345
}
348346

349347
fn main() {

branches/dist-snap/src/doc/guide-runtime.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ into the pool of schedulers in order to spawn a new task.
216216

217217
With two implementations of the runtime available, a choice obviously needs to
218218
be made to see which will be used. The compiler itself will always by-default
219-
link to one of these runtimes. At the time of this writing, the default runtime
220-
is `libgreen` but in the future this will become `libnative`.
219+
link to one of these runtimes.
221220

222221
Having a default decision made in the compiler is done out of necessity and
223222
convenience. The compiler's decision of runtime to link to is *not* an

branches/dist-snap/src/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,14 @@ Use declarations support a number of convenient shortcuts:
826826
An example of `use` declarations:
827827

828828
~~~~
829-
use std::num::sin;
829+
use std::iter::range_step;
830830
use std::option::{Some, None};
831831
832832
# fn foo<T>(_: T){}
833833
834834
fn main() {
835-
// Equivalent to 'std::num::sin(1.0);'
836-
sin(1.0);
835+
// Equivalent to 'std::iter::range_step(0, 10, 2);'
836+
range_step(0, 10, 2);
837837
838838
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
839839
foo(~[Some(1.0), None]);

branches/dist-snap/src/doc/tutorial.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,12 @@ matching in order to bind names to the contents of data types.
504504
505505
~~~~
506506
use std::f64;
507-
use std::num::atan;
508507
fn angle(vector: (f64, f64)) -> f64 {
509508
let pi = f64::consts::PI;
510509
match vector {
511510
(0.0, y) if y < 0.0 => 1.5 * pi,
512511
(0.0, _) => 0.5 * pi,
513-
(x, y) => atan(y / x)
512+
(x, y) => (y / x).atan()
514513
}
515514
}
516515
~~~~
@@ -1430,12 +1429,11 @@ bad, but often copies are expensive. So we’d like to define a function
14301429
that takes the points by pointer. We can use references to do this:
14311430
14321431
~~~
1433-
use std::num::sqrt;
14341432
# struct Point { x: f64, y: f64 }
14351433
fn compute_distance(p1: &Point, p2: &Point) -> f64 {
14361434
let x_d = p1.x - p2.x;
14371435
let y_d = p1.y - p2.y;
1438-
sqrt(x_d * x_d + y_d * y_d)
1436+
(x_d * x_d + y_d * y_d).sqrt()
14391437
}
14401438
~~~
14411439
@@ -2303,7 +2301,7 @@ impl Shape for Circle {
23032301
fn new(area: f64) -> Circle { Circle { radius: (area / PI).sqrt() } }
23042302
}
23052303
impl Shape for Square {
2306-
fn new(area: f64) -> Square { Square { length: (area).sqrt() } }
2304+
fn new(area: f64) -> Square { Square { length: area.sqrt() } }
23072305
}
23082306
23092307
let area = 42.5;

branches/dist-snap/src/libcollections/deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub mod bench {
5252
map: &mut M,
5353
bh: &mut BenchHarness) {
5454
// setup
55-
let mut rng = rand::XorShiftRng::new();
55+
let mut rng = rand::weak_rng();
5656

5757
map.clear();
5858
for _ in range(0, n) {
@@ -89,7 +89,7 @@ pub mod bench {
8989
map: &mut M,
9090
bh: &mut BenchHarness) {
9191
// setup
92-
let mut rng = rand::XorShiftRng::new();
92+
let mut rng = rand::weak_rng();
9393
let mut keys = slice::from_fn(n, |_| rng.gen::<uint>() % n);
9494

9595
for k in keys.iter() {

branches/dist-snap/src/libcollections/hashmap.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,12 +1600,12 @@ mod test_map {
16001600

16011601
#[deriving(Hash, Eq, TotalEq)]
16021602
struct Dropable {
1603-
k: int
1603+
k: uint
16041604
}
16051605

16061606

16071607
impl Dropable {
1608-
fn new(k: int) -> Dropable {
1608+
fn new(k: uint) -> Dropable {
16091609
local_data::get_mut(drop_vector,
16101610
|v| { v.unwrap().as_mut_slice()[k] += 1; });
16111611

@@ -1628,24 +1628,24 @@ mod test_map {
16281628
let mut m = HashMap::new();
16291629

16301630
local_data::get(drop_vector, |v| {
1631-
for i in range(0, 200) {
1631+
for i in range(0u, 200) {
16321632
assert_eq!(v.unwrap().as_slice()[i], 0);
16331633
}
16341634
});
16351635

1636-
for i in range(0, 100) {
1636+
for i in range(0u, 100) {
16371637
let d1 = Dropable::new(i);
16381638
let d2 = Dropable::new(i+100);
16391639
m.insert(d1, d2);
16401640
}
16411641

16421642
local_data::get(drop_vector, |v| {
1643-
for i in range(0, 200) {
1643+
for i in range(0u, 200) {
16441644
assert_eq!(v.unwrap().as_slice()[i], 1);
16451645
}
16461646
});
16471647

1648-
for i in range(0, 50) {
1648+
for i in range(0u, 50) {
16491649
let k = Dropable::new(i);
16501650
let v = m.pop(&k);
16511651

@@ -1658,20 +1658,20 @@ mod test_map {
16581658
}
16591659

16601660
local_data::get(drop_vector, |v| {
1661-
for i in range(0, 50) {
1661+
for i in range(0u, 50) {
16621662
assert_eq!(v.unwrap().as_slice()[i], 0);
16631663
assert_eq!(v.unwrap().as_slice()[i+100], 0);
16641664
}
16651665

1666-
for i in range(50, 100) {
1666+
for i in range(50u, 100) {
16671667
assert_eq!(v.unwrap().as_slice()[i], 1);
16681668
assert_eq!(v.unwrap().as_slice()[i+100], 1);
16691669
}
16701670
});
16711671
}
16721672

16731673
local_data::get(drop_vector, |v| {
1674-
for i in range(0, 200) {
1674+
for i in range(0u, 200) {
16751675
assert_eq!(v.unwrap().as_slice()[i], 0);
16761676
}
16771677
});

branches/dist-snap/src/libflate/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ mod tests {
112112
for _ in range(0, 20) {
113113
let mut input = ~[];
114114
for _ in range(0, 2000) {
115-
input.push_all(r.choose(words.as_slice()));
115+
input.push_all(r.choose(words.as_slice()).as_slice());
116116
}
117117
debug!("de/inflate of {} bytes of random word-sequences",
118118
input.len());

branches/dist-snap/src/libgreen/sched.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,12 @@ impl ClosureConverter for UnsafeTaskReceiver {
967967
// worry there.
968968
#[cfg(windows)]
969969
fn new_sched_rng() -> XorShiftRng {
970-
XorShiftRng::new()
970+
match XorShiftRng::new() {
971+
Ok(r) => r,
972+
Err(e) => {
973+
rtabort!("sched: failed to create seeded RNG: {}", e)
974+
}
975+
}
971976
}
972977
#[cfg(unix)]
973978
fn new_sched_rng() -> XorShiftRng {

branches/dist-snap/src/libnative/io/addrinfo.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ extern "system" {
9696

9797
#[cfg(windows)]
9898
fn get_error(_: c_int) -> IoError {
99-
use super::translate_error;
100-
10199
unsafe {
102-
translate_error(WSAGetLastError() as i32, true)
100+
IoError::from_errno(WSAGetLastError() as uint, true)
103101
}
104102
}
105103

branches/dist-snap/src/libnative/io/mod.rs

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -86,73 +86,10 @@ fn unimpl() -> IoError {
8686
}
8787
}
8888

89-
fn translate_error(errno: i32, detail: bool) -> IoError {
90-
#[cfg(windows)]
91-
fn get_err(errno: i32) -> (io::IoErrorKind, &'static str) {
92-
match errno {
93-
libc::EOF => (io::EndOfFile, "end of file"),
94-
libc::ERROR_NO_DATA => (io::BrokenPipe, "the pipe is being closed"),
95-
libc::ERROR_FILE_NOT_FOUND => (io::FileNotFound, "file not found"),
96-
libc::ERROR_INVALID_NAME => (io::InvalidInput, "invalid file name"),
97-
libc::WSAECONNREFUSED => (io::ConnectionRefused, "connection refused"),
98-
libc::WSAECONNRESET => (io::ConnectionReset, "connection reset"),
99-
libc::WSAEACCES => (io::PermissionDenied, "permission denied"),
100-
libc::WSAEWOULDBLOCK => {
101-
(io::ResourceUnavailable, "resource temporarily unavailable")
102-
}
103-
libc::WSAENOTCONN => (io::NotConnected, "not connected"),
104-
libc::WSAECONNABORTED => (io::ConnectionAborted, "connection aborted"),
105-
libc::WSAEADDRNOTAVAIL => (io::ConnectionRefused, "address not available"),
106-
libc::WSAEADDRINUSE => (io::ConnectionRefused, "address in use"),
107-
libc::ERROR_BROKEN_PIPE => (io::EndOfFile, "the pipe has ended"),
108-
109-
// libuv maps this error code to EISDIR. we do too. if it is found
110-
// to be incorrect, we can add in some more machinery to only
111-
// return this message when ERROR_INVALID_FUNCTION after certain
112-
// win32 calls.
113-
libc::ERROR_INVALID_FUNCTION => (io::InvalidInput,
114-
"illegal operation on a directory"),
115-
116-
_ => (io::OtherIoError, "unknown error")
117-
}
118-
}
119-
120-
#[cfg(not(windows))]
121-
fn get_err(errno: i32) -> (io::IoErrorKind, &'static str) {
122-
// FIXME: this should probably be a bit more descriptive...
123-
match errno {
124-
libc::EOF => (io::EndOfFile, "end of file"),
125-
libc::ECONNREFUSED => (io::ConnectionRefused, "connection refused"),
126-
libc::ECONNRESET => (io::ConnectionReset, "connection reset"),
127-
libc::EPERM | libc::EACCES =>
128-
(io::PermissionDenied, "permission denied"),
129-
libc::EPIPE => (io::BrokenPipe, "broken pipe"),
130-
libc::ENOTCONN => (io::NotConnected, "not connected"),
131-
libc::ECONNABORTED => (io::ConnectionAborted, "connection aborted"),
132-
libc::EADDRNOTAVAIL => (io::ConnectionRefused, "address not available"),
133-
libc::EADDRINUSE => (io::ConnectionRefused, "address in use"),
134-
libc::ENOENT => (io::FileNotFound, "no such file or directory"),
135-
libc::EISDIR => (io::InvalidInput, "illegal operation on a directory"),
136-
137-
// These two constants can have the same value on some systems, but
138-
// different values on others, so we can't use a match clause
139-
x if x == libc::EAGAIN || x == libc::EWOULDBLOCK =>
140-
(io::ResourceUnavailable, "resource temporarily unavailable"),
141-
142-
_ => (io::OtherIoError, "unknown error")
143-
}
144-
}
145-
146-
let (kind, desc) = get_err(errno);
147-
IoError {
148-
kind: kind,
149-
desc: desc,
150-
detail: if detail {Some(os::last_os_error())} else {None},
151-
}
89+
fn last_error() -> IoError {
90+
IoError::last_error()
15291
}
15392

154-
fn last_error() -> IoError { translate_error(os::errno() as i32, true) }
155-
15693
// unix has nonzero values as errors
15794
fn mkerr_libc(ret: libc::c_int) -> IoResult<()> {
15895
if ret != 0 {

branches/dist-snap/src/libnative/io/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn last_error() -> io::IoError {
120120
extern "system" {
121121
fn WSAGetLastError() -> libc::c_int;
122122
}
123-
super::translate_error(unsafe { WSAGetLastError() }, true)
123+
io::IoError::from_errno(unsafe { WSAGetLastError() } as uint, true)
124124
}
125125

126126
#[cfg(not(windows))]

branches/dist-snap/src/libnative/io/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ fn spawn_process_os(config: p::ProcessConfig,
481481
(bytes[1] << 16) as i32 |
482482
(bytes[2] << 8) as i32 |
483483
(bytes[3] << 0) as i32;
484-
Err(super::translate_error(errno, false))
484+
Err(io::IoError::from_errno(errno as uint, false))
485485
}
486486
Err(e) => {
487487
assert!(e.kind == io::BrokenPipe ||

0 commit comments

Comments
 (0)