Skip to content

Commit 449e427

Browse files
committed
---
yaml --- r: 97739 b: refs/heads/snap-stage3 c: 0e94ae4 h: refs/heads/master i: 97737: 7c89dc5 97735: 105505e v: v3
1 parent 8829d00 commit 449e427

File tree

15 files changed

+147
-120
lines changed

15 files changed

+147
-120
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 9434e7c6cb658367d91eb8aae5fac6a5c8b5f769
4+
refs/heads/snap-stage3: 0e94ae4d8a4d6aa103bca4e48885538f478c56b5
55
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,6 @@ DRIVER_CRATE := $(S)src/driver/driver.rs
371371
LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser jit mcjit \
372372
interpreter instrumentation
373373

374-
# Only build these LLVM tools
375-
LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt
376-
377374
define DEF_LLVM_VARS
378375
# The configure script defines these variables with the target triples
379376
# separated by Z. This defines new ones with the expected format.

branches/snap-stage3/doc/index.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,52 @@
44
<style type="text/css">
55
#TOC { display: none; }
66
.header-section-number { display: none; }
7-
li {list-style-type: none; }
87
</style>
98

10-
* [The Rust tutorial](tutorial.html) (* [PDF](tutorial.pdf))
11-
* [The Rust reference manual](rust.html) (* [PDF](rust.pdf))
9+
[The Rust tutorial](tutorial.html) ([PDF](tutorial.pdf))
10+
[The Rust reference manual](rust.html) ([PDF](rust.pdf))
1211

1312
# Guides
1413

15-
* [Pointers](guide-pointers.html)
16-
* [References and Lifetimes](guide-lifetimes.html)
17-
* [Containers and Iterators](guide-container.html)
18-
* [Tasks and Communication](guide-tasks.html)
19-
* [Foreign Function Interface](guide-ffi.html)
20-
* [Macros](guide-macros.html)
21-
* [Packaging](guide-rustpkg.html)
22-
* [Testing](guide-testing.html)
23-
* [Conditions](guide-conditions.html)
24-
* [Rust's Runtime](guide-runtime.html)
14+
[Pointers](guide-pointers.html)
15+
[References and Lifetimes](guide-lifetimes.html)
16+
[Containers and Iterators](guide-container.html)
17+
[Tasks and Communication](guide-tasks.html)
18+
[Foreign Function Interface](guide-ffi.html)
19+
[Macros](guide-macros.html)
20+
[Packaging](guide-rustpkg.html)
21+
[Testing](guide-testing.html)
22+
[Conditions](guide-conditions.html)
23+
[Rust's Runtime](guide-runtime.html)
2524

2625
# Libraries
2726

28-
* [The standard library, `libstd`](std/index.html)
29-
* [The extra library, `libextra`](extra/index.html)
27+
[The standard library, `libstd`](std/index.html)
28+
[The extra library, `libextra`](extra/index.html)
3029

31-
* [The M:N runtime library, `libgreen`](green/index.html)
32-
* [The 1:1 runtime library, `libnative`](native/index.html)
30+
[The M:N runtime library, `libgreen`](green/index.html)
31+
[The 1:1 runtime library, `libnative`](native/index.html)
3332

34-
* [The Rust libuv library, `librustuv`](rustuv/index.html)
35-
* [The Rust packaging library, `librustpkg`](rustpkg/index.html)
33+
[The Rust libuv library, `librustuv`](rustuv/index.html)
34+
[The Rust packaging library, `librustpkg`](rustpkg/index.html)
3635

37-
* [The Rust parser, `libsyntax`](syntax/index.html)
38-
* [The Rust compiler, `librustc`](rustc/index.html)
36+
[The Rust parser, `libsyntax`](syntax/index.html)
37+
[The Rust compiler, `librustc`](rustc/index.html)
3938

4039
# Tooling
4140

42-
* [The `rustdoc` manual](rustdoc.html)
43-
* [The `rustpkg` manual](rustpkg.html)
41+
[The `rustpkg` manual](rustpkg.html)
4442

4543
# FAQs
4644

47-
* [Language FAQ](complement-lang-faq.html)
48-
* [Project FAQ](complement-project-faq.html)
49-
* [Usage FAQ](complement-usage-faq.html)
50-
* [Code cheatsheet](complement-cheatsheet.html) - "How do I do X?"
51-
* [How to submit a bug report](complement-bugreport.html)
45+
[Language FAQ](complement-lang-faq.html)
46+
[Project FAQ](complement-project-faq.html)
47+
[Usage FAQ](complement-usage-faq.html)
48+
[Code cheatsheet](complement-cheatsheet.html) - "How do I do X?"
49+
[How to submit a bug report](complement-bugreport.html)
5250

5351
# External resources
5452

55-
* The Rust [IRC channel](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) - `#rust` on irc.mozilla.org
56-
* The Rust community on [Reddit](http://reddit.com/r/rust)
57-
* The Rust [wiki](http://github.com/mozilla/rust/wiki)
53+
The Rust [IRC channel](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) - `#rust` on irc.mozilla.org
54+
The Rust community on [Reddit](http://reddit.com/r/rust)
55+
The Rust [wiki](http://github.com/mozilla/rust/wiki)

branches/snap-stage3/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
2828

2929
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
3030
@$$(call E, make: llvm)
31-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1)) ONLY_TOOLS="$$(LLVM_TOOLS)"
31+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1))
3232
$$(Q)touch $$(LLVM_CONFIG_$(1))
3333
endif
3434

branches/snap-stage3/src/libextra/base64.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,7 @@ impl<'a> ToBase64 for &'a [u8] {
154154
pub trait FromBase64 {
155155
/// Converts the value of `self`, interpreted as base64 encoded data, into
156156
/// an owned vector of bytes, returning the vector.
157-
fn from_base64(&self) -> Result<~[u8], FromBase64Error>;
158-
}
159-
160-
/// Errors that can occur when decoding a base64 encoded string
161-
pub enum FromBase64Error {
162-
/// The input contained a character not part of the base64 format
163-
InvalidBase64Character(char, uint),
164-
/// The input had an invalid length
165-
InvalidBase64Length,
166-
}
167-
168-
impl ToStr for FromBase64Error {
169-
fn to_str(&self) -> ~str {
170-
match *self {
171-
InvalidBase64Character(ch, idx) =>
172-
format!("Invalid character '{}' at position {}", ch, idx),
173-
InvalidBase64Length => ~"Invalid length",
174-
}
175-
}
157+
fn from_base64(&self) -> Result<~[u8], ~str>;
176158
}
177159

178160
impl<'a> FromBase64 for &'a str {
@@ -206,7 +188,7 @@ impl<'a> FromBase64 for &'a str {
206188
* }
207189
* ```
208190
*/
209-
fn from_base64(&self) -> Result<~[u8], FromBase64Error> {
191+
fn from_base64(&self) -> Result<~[u8], ~str> {
210192
let mut r = ~[];
211193
let mut buf: u32 = 0;
212194
let mut modulus = 0;
@@ -223,7 +205,8 @@ impl<'a> FromBase64 for &'a str {
223205
'/'|'_' => buf |= 0x3F,
224206
'\r'|'\n' => continue,
225207
'=' => break,
226-
_ => return Err(InvalidBase64Character(self.char_at(idx), idx)),
208+
_ => return Err(format!("Invalid character '{}' at position {}",
209+
self.char_at(idx), idx))
227210
}
228211

229212
buf <<= 6;
@@ -238,7 +221,8 @@ impl<'a> FromBase64 for &'a str {
238221

239222
for (idx, byte) in it {
240223
if (byte as char) != '=' {
241-
return Err(InvalidBase64Character(self.char_at(idx), idx));
224+
return Err(format!("Invalid character '{}' at position {}",
225+
self.char_at(idx), idx));
242226
}
243227
}
244228

@@ -251,7 +235,7 @@ impl<'a> FromBase64 for &'a str {
251235
r.push((buf >> 8 ) as u8);
252236
}
253237
0 => (),
254-
_ => return Err(InvalidBase64Length),
238+
_ => return Err(~"Invalid Base64 length")
255239
}
256240

257241
Ok(r)

branches/snap-stage3/src/libextra/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ mod test {
127127
// Rendezvous streams should be able to handle any number of messages being sent
128128
let (port, chan) = rendezvous();
129129
do spawn {
130-
10000.times(|| { chan.send(()) })
130+
1000000.times(|| { chan.send(()) })
131131
}
132-
10000.times(|| { port.recv() })
132+
1000000.times(|| { port.recv() })
133133
}
134134

135135
#[test]

branches/snap-stage3/src/libextra/hex.rs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,7 @@ impl<'a> ToHex for &'a [u8] {
5353
pub trait FromHex {
5454
/// Converts the value of `self`, interpreted as hexadecimal encoded data,
5555
/// into an owned vector of bytes, returning the vector.
56-
fn from_hex(&self) -> Result<~[u8], FromHexError>;
57-
}
58-
59-
/// Errors that can occur when decoding a hex encoded string
60-
pub enum FromHexError {
61-
/// The input contained a character not part of the hex format
62-
InvalidHexCharacter(char, uint),
63-
/// The input had a invalid length
64-
InvalidHexLength,
65-
}
66-
67-
impl ToStr for FromHexError {
68-
fn to_str(&self) -> ~str {
69-
match *self {
70-
InvalidHexCharacter(ch, idx) =>
71-
format!("Invalid character '{}' at position {}", ch, idx),
72-
InvalidHexLength => ~"Invalid input length",
73-
}
74-
}
56+
fn from_hex(&self) -> Result<~[u8], ~str>;
7557
}
7658

7759
impl<'a> FromHex for &'a str {
@@ -101,7 +83,7 @@ impl<'a> FromHex for &'a str {
10183
* }
10284
* ```
10385
*/
104-
fn from_hex(&self) -> Result<~[u8], FromHexError> {
86+
fn from_hex(&self) -> Result<~[u8], ~str> {
10587
// This may be an overestimate if there is any whitespace
10688
let mut b = vec::with_capacity(self.len() / 2);
10789
let mut modulus = 0;
@@ -118,7 +100,8 @@ impl<'a> FromHex for &'a str {
118100
buf >>= 4;
119101
continue
120102
}
121-
_ => return Err(InvalidHexCharacter(self.char_at(idx), idx)),
103+
_ => return Err(format!("Invalid character '{}' at position {}",
104+
self.char_at(idx), idx))
122105
}
123106

124107
modulus += 1;
@@ -130,7 +113,7 @@ impl<'a> FromHex for &'a str {
130113

131114
match modulus {
132115
0 => Ok(b),
133-
_ => Err(InvalidHexLength),
116+
_ => Err(~"Invalid input length")
134117
}
135118
}
136119
}

branches/snap-stage3/src/libnative/bookkeeping.rs renamed to branches/snap-stage3/src/libnative/bookeeping.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,13 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! 1:1 Task bookkeeping
11+
//! 1:1 Task bookeeping
1212
//!
1313
//! This module keeps track of the number of running 1:1 tasks so that entry
1414
//! points with libnative know when it's possible to exit the program (once all
1515
//! tasks have exited).
1616
//!
17-
//! The green counterpart for this is bookkeeping on sched pools.
17+
//! The green counterpart for this is bookeeping on sched pools.
1818
1919
use std::sync::atomics;
2020
use std::unstable::mutex::{Mutex, MUTEX_INIT};

branches/snap-stage3/src/libnative/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -29,7 +29,7 @@
2929
use std::os;
3030
use std::rt;
3131

32-
mod bookkeeping;
32+
mod bookeeping;
3333
pub mod io;
3434
pub mod task;
3535

@@ -75,6 +75,6 @@ pub fn start(argc: int, argv: **u8, main: proc()) -> int {
7575
/// number of arguments.
7676
pub fn run(main: proc()) -> int {
7777
main();
78-
bookkeeping::wait_for_other_tasks();
78+
bookeeping::wait_for_other_tasks();
7979
os::get_exit_status()
8080
}

branches/snap-stage3/src/libnative/task.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -27,7 +27,7 @@ use std::unstable::stack;
2727

2828
use io;
2929
use task;
30-
use bookkeeping;
30+
use bookeeping;
3131

3232
/// Creates a new Task which is ready to execute as a 1:1 task.
3333
pub fn new(stack_bounds: (uint, uint)) -> ~Task {
@@ -82,7 +82,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) {
8282
// Note that this increment must happen *before* the spawn in order to
8383
// guarantee that if this task exits it will always end up waiting for the
8484
// spawned task to exit.
85-
bookkeeping::increment();
85+
bookeeping::increment();
8686

8787
// Spawning a new OS thread guarantees that __morestack will never get
8888
// triggered, but we must manually set up the actual stack bounds once this
@@ -104,7 +104,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) {
104104
let mut task = task;
105105
task.put_runtime(ops as ~rt::Runtime);
106106
task.run(|| { f.take_unwrap()() });
107-
bookkeeping::decrement();
107+
bookeeping::decrement();
108108
})
109109
}
110110

branches/snap-stage3/src/libstd/path/windows.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,8 @@ impl GenericPathUnsafe for Path {
261261
let mut s = str::with_capacity(me.repr.len() + 1 + pathlen);
262262
s.push_str(me.repr);
263263
let plen = me.prefix_len();
264-
// if me is "C:" we don't want to add a path separator
265-
match me.prefix {
266-
Some(DiskPrefix) if me.repr.len() == plen => (),
267-
_ if !(me.repr.len() > plen && me.repr[me.repr.len()-1] == sep as u8) => {
268-
s.push_char(sep);
269-
}
270-
_ => ()
264+
if !(me.repr.len() > plen && me.repr[me.repr.len()-1] == sep as u8) {
265+
s.push_char(sep);
271266
}
272267
match path_ {
273268
None => s.push_str(path),
@@ -1554,8 +1549,6 @@ mod tests {
15541549
t!(s: "C:a\\b\\c", "C:d", "C:a\\b\\c\\d");
15551550
t!(s: "C:a\\b", "..\\..\\..\\c", "C:..\\c");
15561551
t!(s: "C:\\a\\b", "..\\..\\..\\c", "C:\\c");
1557-
t!(s: "C:", r"a\b\c", r"C:a\b\c");
1558-
t!(s: "C:", r"..\a", r"C:..\a");
15591552
t!(s: "\\\\server\\share\\foo", "bar", "\\\\server\\share\\foo\\bar");
15601553
t!(s: "\\\\server\\share\\foo", "..\\..\\bar", "\\\\server\\share\\bar");
15611554
t!(s: "\\\\server\\share\\foo", "C:baz", "C:baz");

branches/snap-stage3/src/libstd/rt/task.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -39,12 +39,11 @@ use sync::atomics::{AtomicUint, SeqCst};
3939
use task::{TaskResult, TaskOpts};
4040
use unstable::finally::Finally;
4141

42-
// The Task struct represents all state associated with a rust
43-
// task. There are at this point two primary "subtypes" of task,
44-
// however instead of using a subtype we just have a "task_type" field
45-
// in the struct. This contains a pointer to another struct that holds
46-
// the type-specific state.
47-
42+
/// The Task struct represents all state associated with a rust
43+
/// task. There are at this point two primary "subtypes" of task,
44+
/// however instead of using a subtype we just have a "task_type" field
45+
/// in the struct. This contains a pointer to another struct that holds
46+
/// the type-specific state.
4847
pub struct Task {
4948
heap: LocalHeap,
5049
gc: GarbageCollector,

0 commit comments

Comments
 (0)