Skip to content

Commit d8ff218

Browse files
committed
---
yaml --- r: 98150 b: refs/heads/master c: 58a15f3 h: refs/heads/master v: v3
1 parent f544719 commit d8ff218

Some content is hidden

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

95 files changed

+1210
-721
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 421d24582d278c510fcaa8a3918d4eeff739f556
2+
refs/heads/master: 58a15f3d5a2213d37bbf653e4562c36a130f14ee
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b6400f998497c3958f40997a71756ead344a776d
55
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36

trunk/Makefile.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ 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+
374377
define DEF_LLVM_VARS
375378
# The configure script defines these variables with the target triples
376379
# separated by Z. This defines new ones with the expected format.
@@ -418,6 +421,7 @@ export CFG_PREFIX
418421
export CFG_LIBDIR
419422
export CFG_RUSTLIBDIR
420423
export CFG_LIBDIR_RELATIVE
424+
export CFG_DISABLE_INJECT_STD_VERSION
421425

422426
######################################################################
423427
# Subprograms

trunk/configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ opt clang 0 "prefer clang to gcc for building the runtime"
381381
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
382382
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
383383
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
384+
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
384385
valopt prefix "/usr/local" "set installation prefix"
385386
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
386387
valopt llvm-root "" "set LLVM root"
@@ -1042,6 +1043,7 @@ putvar CFG_DISABLE_MANAGE_SUBMODULES
10421043
putvar CFG_ANDROID_CROSS_PATH
10431044
putvar CFG_MINGW32_CROSS_PATH
10441045
putvar CFG_MANDIR
1046+
putvar CFG_DISABLE_INJECT_STD_VERSION
10451047

10461048
# Avoid spurious warnings from clang by feeding it original source on
10471049
# ccache-miss rather than preprocessed input.

trunk/doc/index.md

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

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

1213
# Guides
1314

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)
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)
2425

2526
# Libraries
2627

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

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

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

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

3940
# Tooling
4041

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

4345
# FAQs
4446

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)
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)
5052

5153
# External resources
5254

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)
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)

trunk/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))
31+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1)) ONLY_TOOLS="$$(LLVM_TOOLS)"
3232
$$(Q)touch $$(LLVM_CONFIG_$(1))
3333
endif
3434

trunk/src/compiletest/header.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,14 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
9090
fn xfail_target(config: &config) -> ~str {
9191
~"xfail-" + util::get_os(config.target)
9292
}
93+
fn xfail_stage(config: &config) -> ~str {
94+
~"xfail-" + config.stage_id.split('-').next().unwrap()
95+
}
9396
9497
let val = iter_header(testfile, |ln| {
9598
if parse_name_directive(ln, "xfail-test") { false }
9699
else if parse_name_directive(ln, xfail_target(config)) { false }
100+
else if parse_name_directive(ln, xfail_stage(config)) { false }
97101
else if config.mode == common::mode_pretty &&
98102
parse_name_directive(ln, "xfail-pretty") { false }
99103
else { true }

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
8383
syn keyword rustTrait Times
8484

8585
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
86-
syn keyword rustTrait Bitwise BitCount Bounded
87-
syn keyword rustTrait Integer Fractional Real RealExt
86+
syn keyword rustTrait Bitwise Bounded Integer Fractional Real RealExt
8887
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
8988
syn keyword rustTrait Orderable Signed Unsigned Round
9089
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive

trunk/src/libextra/base64.rs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,25 @@ 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], ~str>;
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+
}
158176
}
159177

160178
impl<'a> FromBase64 for &'a str {
@@ -188,7 +206,7 @@ impl<'a> FromBase64 for &'a str {
188206
* }
189207
* ```
190208
*/
191-
fn from_base64(&self) -> Result<~[u8], ~str> {
209+
fn from_base64(&self) -> Result<~[u8], FromBase64Error> {
192210
let mut r = ~[];
193211
let mut buf: u32 = 0;
194212
let mut modulus = 0;
@@ -205,8 +223,7 @@ impl<'a> FromBase64 for &'a str {
205223
'/'|'_' => buf |= 0x3F,
206224
'\r'|'\n' => continue,
207225
'=' => break,
208-
_ => return Err(format!("Invalid character '{}' at position {}",
209-
self.char_at(idx), idx))
226+
_ => return Err(InvalidBase64Character(self.char_at(idx), idx)),
210227
}
211228

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

222239
for (idx, byte) in it {
223240
if (byte as char) != '=' {
224-
return Err(format!("Invalid character '{}' at position {}",
225-
self.char_at(idx), idx));
241+
return Err(InvalidBase64Character(self.char_at(idx), idx));
226242
}
227243
}
228244

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

241257
Ok(r)

trunk/src/libextra/comm.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Higher level communication abstractions.
1616

1717
#[allow(missing_doc)];
1818

19+
use std::comm;
20+
1921
/// An extension of `pipes::stream` that allows both sending and receiving.
2022
pub struct DuplexStream<T, U> {
2123
priv chan: Chan<T>,
@@ -40,7 +42,7 @@ impl<T:Send,U:Send> DuplexStream<T, U> {
4042
pub fn recv(&self) -> U {
4143
self.port.recv()
4244
}
43-
pub fn try_recv(&self) -> Option<U> {
45+
pub fn try_recv(&self) -> comm::TryRecvResult<U> {
4446
self.port.try_recv()
4547
}
4648
pub fn recv_opt(&self) -> Option<U> {
@@ -77,11 +79,11 @@ impl<T: Send> SyncPort<T> {
7779
})
7880
}
7981

80-
pub fn try_recv(&self) -> Option<T> {
81-
self.duplex_stream.try_recv().map(|val| {
82-
self.duplex_stream.try_send(());
83-
val
84-
})
82+
pub fn try_recv(&self) -> comm::TryRecvResult<T> {
83+
match self.duplex_stream.try_recv() {
84+
comm::Data(t) => { self.duplex_stream.try_send(()); comm::Data(t) }
85+
state => state,
86+
}
8587
}
8688
}
8789

@@ -125,9 +127,9 @@ mod test {
125127
// Rendezvous streams should be able to handle any number of messages being sent
126128
let (port, chan) = rendezvous();
127129
do spawn {
128-
1000000.times(|| { chan.send(()) })
130+
10000.times(|| { chan.send(()) })
129131
}
130-
1000000.times(|| { port.recv() })
132+
10000.times(|| { port.recv() })
131133
}
132134

133135
#[test]

trunk/src/libextra/enum_set.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
//! This module defines a container which uses an efficient bit mask
1414
//! representation to hold C-like enum variants.
1515
16+
use std::num::Bitwise;
17+
1618
#[deriving(Clone, Eq, IterBytes, ToStr, Encodable, Decodable)]
1719
/// A specialized Set implementation to use enum types.
1820
pub struct EnumSet<E> {

trunk/src/libextra/hex.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,25 @@ 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], ~str>;
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+
}
5775
}
5876

5977
impl<'a> FromHex for &'a str {
@@ -83,7 +101,7 @@ impl<'a> FromHex for &'a str {
83101
* }
84102
* ```
85103
*/
86-
fn from_hex(&self) -> Result<~[u8], ~str> {
104+
fn from_hex(&self) -> Result<~[u8], FromHexError> {
87105
// This may be an overestimate if there is any whitespace
88106
let mut b = vec::with_capacity(self.len() / 2);
89107
let mut modulus = 0;
@@ -100,8 +118,7 @@ impl<'a> FromHex for &'a str {
100118
buf >>= 4;
101119
continue
102120
}
103-
_ => return Err(format!("Invalid character '{}' at position {}",
104-
self.char_at(idx), idx))
121+
_ => return Err(InvalidHexCharacter(self.char_at(idx), idx)),
105122
}
106123

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

114131
match modulus {
115132
0 => Ok(b),
116-
_ => Err(~"Invalid input length")
133+
_ => Err(InvalidHexLength),
117134
}
118135
}
119136
}

trunk/src/libextra/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Rust extras are part of the standard Rust distribution.
2020
2121
*/
2222

23-
#[crate_id = "extra#0.10-pre"];
23+
// NOTE: upgrade to 0.10-pre after the next snapshot
24+
#[crate_id = "extra#0.9"];
2425
#[comment = "Rust extras"];
2526
#[license = "MIT/ASL2"];
2627
#[crate_type = "rlib"];

trunk/src/libextra/num/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A `BigInt` is a combination of `BigUint` and `Sign`.
2222
use std::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
2323
use std::num;
2424
use std::num::{Zero, One, ToStrRadix, FromStrRadix, Orderable};
25-
use std::num::{ToPrimitive, FromPrimitive};
25+
use std::num::{Bitwise, ToPrimitive, FromPrimitive};
2626
use std::rand::Rng;
2727
use std::str;
2828
use std::uint;

trunk/src/libextra/sync.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
use std::borrow;
22+
use std::comm;
2223
use std::unstable::sync::Exclusive;
2324
use std::sync::arc::UnsafeArc;
2425
use std::sync::atomics;
@@ -49,7 +50,7 @@ impl WaitQueue {
4950
// Signals one live task from the queue.
5051
fn signal(&self) -> bool {
5152
match self.head.try_recv() {
52-
Some(ch) => {
53+
comm::Data(ch) => {
5354
// Send a wakeup signal. If the waiter was killed, its port will
5455
// have closed. Keep trying until we get a live task.
5556
if ch.try_send_deferred(()) {
@@ -58,20 +59,20 @@ impl WaitQueue {
5859
self.signal()
5960
}
6061
}
61-
None => false
62+
_ => false
6263
}
6364
}
6465

6566
fn broadcast(&self) -> uint {
6667
let mut count = 0;
6768
loop {
6869
match self.head.try_recv() {
69-
None => break,
70-
Some(ch) => {
70+
comm::Data(ch) => {
7171
if ch.try_send_deferred(()) {
7272
count += 1;
7373
}
7474
}
75+
_ => break
7576
}
7677
}
7778
count

0 commit comments

Comments
 (0)