Skip to content

Commit f544719

Browse files
committed
---
yaml --- r: 98149 b: refs/heads/master c: 421d245 h: refs/heads/master i: 98147: 186747b v: v3
1 parent 6d06f15 commit f544719

Some content is hidden

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

96 files changed

+738
-1215
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: 80a3f453db387d02dcb596745731031e7a8c9048
2+
refs/heads/master: 421d24582d278c510fcaa8a3918d4eeff739f556
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b6400f998497c3958f40997a71756ead344a776d
55
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36

trunk/Makefile.in

Lines changed: 0 additions & 4 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.
@@ -421,7 +418,6 @@ export CFG_PREFIX
421418
export CFG_LIBDIR
422419
export CFG_RUSTLIBDIR
423420
export CFG_LIBDIR_RELATIVE
424-
export CFG_DISABLE_INJECT_STD_VERSION
425421

426422
######################################################################
427423
# Subprograms

trunk/configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ 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"
385384
valopt prefix "/usr/local" "set installation prefix"
386385
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
387386
valopt llvm-root "" "set LLVM root"
@@ -1043,7 +1042,6 @@ putvar CFG_DISABLE_MANAGE_SUBMODULES
10431042
putvar CFG_ANDROID_CROSS_PATH
10441043
putvar CFG_MINGW32_CROSS_PATH
10451044
putvar CFG_MANDIR
1046-
putvar CFG_DISABLE_INJECT_STD_VERSION
10471045

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

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

trunk/doc/rust.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,9 @@ path_glob : ident [ "::" path_glob ] ?
806806

807807
A _use declaration_ creates one or more local name bindings synonymous
808808
with some other [path](#paths).
809-
Usually a `use` declaration is used to shorten the path required to refer to a module item.
809+
Usually a `use` declaration is used to shorten the path required to refer to a
810+
module item. These declarations may appear at the top of [modules](#modules) and
811+
[blocks](#blocks).
810812

811813
*Note*: Unlike in many languages,
812814
`use` declarations in Rust do *not* declare linkage dependency with external crates.
@@ -2318,14 +2320,24 @@ let base = Point3d {x: 1, y: 2, z: 3};
23182320
Point3d {y: 0, z: 10, .. base};
23192321
~~~~
23202322

2321-
### Record expressions
2323+
### Block expressions
23222324

23232325
~~~~ {.ebnf .gram}
2324-
rec_expr : '{' ident ':' expr
2325-
[ ',' ident ':' expr ] *
2326-
[ ".." expr ] '}'
2326+
block_expr : '{' [ view_item ] *
2327+
[ stmt ';' | item ] *
2328+
[ expr ] '}'
23272329
~~~~
23282330

2331+
A _block expression_ is similar to a module in terms of the declarations that
2332+
are possible. Each block conceptually introduces a new namespace scope. View
2333+
items can bring new names into scopes and declared items are in scope for only
2334+
the block itself.
2335+
2336+
A block will execute each statement sequentially, and then execute the
2337+
expression (if given). If the final expression is omitted, the type and return
2338+
value of the block are `()`, but if it is provided, the type and return value
2339+
of the block are that of the expression itself.
2340+
23292341
### Method-call expressions
23302342

23312343
~~~~ {.ebnf .gram}

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

trunk/src/compiletest/header.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,10 @@ 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-
}
9693
9794
let val = iter_header(testfile, |ln| {
9895
if parse_name_directive(ln, "xfail-test") { false }
9996
else if parse_name_directive(ln, xfail_target(config)) { false }
100-
else if parse_name_directive(ln, xfail_stage(config)) { false }
10197
else if config.mode == common::mode_pretty &&
10298
parse_name_directive(ln, "xfail-pretty") { false }
10399
else { true }

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ 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 Bounded Integer Fractional Real RealExt
86+
syn keyword rustTrait Bitwise BitCount Bounded
87+
syn keyword rustTrait Integer Fractional Real RealExt
8788
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
8889
syn keyword rustTrait Orderable Signed Unsigned Round
8990
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive

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

trunk/src/libextra/comm.rs

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

1717
#[allow(missing_doc)];
1818

19-
use std::comm;
20-
2119
/// An extension of `pipes::stream` that allows both sending and receiving.
2220
pub struct DuplexStream<T, U> {
2321
priv chan: Chan<T>,
@@ -42,7 +40,7 @@ impl<T:Send,U:Send> DuplexStream<T, U> {
4240
pub fn recv(&self) -> U {
4341
self.port.recv()
4442
}
45-
pub fn try_recv(&self) -> comm::TryRecvResult<U> {
43+
pub fn try_recv(&self) -> Option<U> {
4644
self.port.try_recv()
4745
}
4846
pub fn recv_opt(&self) -> Option<U> {
@@ -79,11 +77,11 @@ impl<T: Send> SyncPort<T> {
7977
})
8078
}
8179

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-
}
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+
})
8785
}
8886
}
8987

@@ -127,9 +125,9 @@ mod test {
127125
// Rendezvous streams should be able to handle any number of messages being sent
128126
let (port, chan) = rendezvous();
129127
do spawn {
130-
10000.times(|| { chan.send(()) })
128+
1000000.times(|| { chan.send(()) })
131129
}
132-
10000.times(|| { port.recv() })
130+
1000000.times(|| { port.recv() })
133131
}
134132

135133
#[test]

trunk/src/libextra/enum_set.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
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-
1816
#[deriving(Clone, Eq, IterBytes, ToStr, Encodable, Decodable)]
1917
/// A specialized Set implementation to use enum types.
2018
pub struct EnumSet<E> {

trunk/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
}

trunk/src/libextra/lib.rs

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

23-
// NOTE: upgrade to 0.10-pre after the next snapshot
24-
#[crate_id = "extra#0.9"];
23+
#[crate_id = "extra#0.10-pre"];
2524
#[comment = "Rust extras"];
2625
#[license = "MIT/ASL2"];
2726
#[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::{Bitwise, ToPrimitive, FromPrimitive};
25+
use std::num::{ToPrimitive, FromPrimitive};
2626
use std::rand::Rng;
2727
use std::str;
2828
use std::uint;

0 commit comments

Comments
 (0)