Skip to content

Commit e634bc4

Browse files
committed
---
yaml --- r: 148313 b: refs/heads/try2 c: e6a2742 h: refs/heads/master i: 148311: 210a5e3 v: v3
1 parent e92ed8b commit e634bc4

Some content is hidden

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

83 files changed

+479
-668
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 62fbd00bed6ec435b52f03525c48f95d5fce8abd
8+
refs/heads/try2: e6a27424adba041d64d29c4339edc5015536f285
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ export CFG_PREFIX
421421
export CFG_LIBDIR
422422
export CFG_RUSTLIBDIR
423423
export CFG_LIBDIR_RELATIVE
424+
export CFG_DISABLE_INJECT_STD_VERSION
424425

425426
######################################################################
426427
# Subprograms

branches/try2/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.

branches/try2/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)

branches/try2/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

branches/try2/src/libextra/comm.rs

Lines changed: 8 additions & 6 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

branches/try2/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> {

branches/try2/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"];

branches/try2/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;

branches/try2/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

branches/try2/src/libextra/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ mod tests {
14591459
}
14601460
14611461
#[test]
1462-
#[ignore(cfg(android))] // FIXME #10958
1462+
#[ignore(cfg(target_os = "android"))] // FIXME #10958
14631463
fn run_tests() {
14641464
// The tests race on tzset. So instead of having many independent
14651465
// tests, we will just call the functions now.

branches/try2/src/libgreen/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#[macro_escape];
1414

1515
use std::fmt;
16-
use std::libc;
1716

1817
// Indicates whether we should perform expensive sanity checks, including rtassert!
1918
// XXX: Once the runtime matures remove the `true` below to turn off rtassert, etc.
@@ -124,6 +123,7 @@ memory and partly incapable of presentation to others.",
124123
abort();
125124

126125
fn abort() -> ! {
127-
unsafe { libc::abort() }
126+
use std::unstable::intrinsics;
127+
unsafe { intrinsics::abort() }
128128
}
129129
}

branches/try2/src/libgreen/sched.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ fn new_sched_rng() -> XorShiftRng {
958958

959959
#[cfg(test)]
960960
mod test {
961+
use std::comm;
961962
use std::task::TaskOpts;
962963
use std::rt::Runtime;
963964
use std::rt::task::Task;
@@ -1376,7 +1377,7 @@ mod test {
13761377
// This task should not be able to starve the sender;
13771378
// The sender should get stolen to another thread.
13781379
do spawn {
1379-
while port.try_recv().is_none() { }
1380+
while port.try_recv() != comm::Data(()) { }
13801381
}
13811382

13821383
chan.send(());
@@ -1393,7 +1394,7 @@ mod test {
13931394
// This task should not be able to starve the other task.
13941395
// The sends should eventually yield.
13951396
do spawn {
1396-
while port.try_recv().is_none() {
1397+
while port.try_recv() != comm::Data(()) {
13971398
chan2.send(());
13981399
}
13991400
}

branches/try2/src/libnative/lib.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,6 @@ static OS_DEFAULT_STACK_ESTIMATE: uint = 1 << 20;
3939
#[cfg(unix, not(android))]
4040
static OS_DEFAULT_STACK_ESTIMATE: uint = 2 * (1 << 20);
4141

42-
43-
// XXX: this should not exist here
44-
#[cfg(stage0, nativestart)]
45-
#[lang = "start"]
46-
pub fn lang_start(main: *u8, argc: int, argv: **u8) -> int {
47-
use std::cast;
48-
use std::task;
49-
50-
do start(argc, argv) {
51-
// Instead of invoking main directly on this thread, invoke it on
52-
// another spawned thread that we are guaranteed to know the size of the
53-
// stack of. Currently, we do not have a method of figuring out the size
54-
// of the main thread's stack, so for stack overflow detection to work
55-
// we must spawn the task in a subtask which we know the stack size of.
56-
let main: extern "Rust" fn() = unsafe { cast::transmute(main) };
57-
let mut task = task::task();
58-
task.name("<main>");
59-
match do task.try { main() } {
60-
Ok(()) => { os::set_exit_status(0); }
61-
Err(..) => { os::set_exit_status(rt::DEFAULT_ERROR_CODE); }
62-
}
63-
}
64-
}
65-
6642
/// Executes the given procedure after initializing the runtime with the given
6743
/// argc/argv.
6844
///

branches/try2/src/librustc/back/abi.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ pub static tydesc_field_align: uint = 1u;
4545
pub static tydesc_field_take_glue: uint = 2u;
4646
pub static tydesc_field_drop_glue: uint = 3u;
4747
pub static tydesc_field_visit_glue: uint = 4u;
48-
pub static tydesc_field_borrow_offset: uint = 5u;
49-
pub static tydesc_field_name_offset: uint = 6u;
50-
pub static n_tydesc_fields: uint = 7u;
48+
pub static tydesc_field_name_offset: uint = 5u;
49+
pub static n_tydesc_fields: uint = 6u;
5150

5251
// The two halves of a closure: code and environment.
5352
pub static fn_field_code: uint = 0u;

branches/try2/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
10111011
for details)", "FEATURE"),
10121012
optopt("", "android-cross-path",
10131013
"The path to the Android NDK", "PATH"),
1014-
optflagopt("W", "warn",
1014+
optmulti("W", "warn",
10151015
"Set lint warnings", "OPT"),
10161016
optmulti("A", "allow",
10171017
"Set lint allowed", "OPT"),

branches/try2/src/librustc/front/std_inject.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ use syntax::fold;
2121
use syntax::opt_vec;
2222
use syntax::util::small_vector::SmallVector;
2323

24+
// NOTE: upgrade to 0.10-pre after the next snapshot
25+
pub static VERSION: &'static str = "0.9";
26+
2427
pub fn maybe_inject_libstd_ref(sess: Session, crate: ast::Crate)
2528
-> ast::Crate {
2629
if use_std(&crate) {
@@ -53,11 +56,21 @@ struct StandardLibraryInjector {
5356
sess: Session,
5457
}
5558

59+
pub fn with_version(crate: &str) -> Option<(@str, ast::StrStyle)> {
60+
match option_env!("CFG_DISABLE_INJECT_STD_VERSION") {
61+
Some("1") => None,
62+
_ => {
63+
Some((format!("{}\\#{}", crate, VERSION).to_managed(),
64+
ast::CookedStr))
65+
}
66+
}
67+
}
68+
5669
impl fold::Folder for StandardLibraryInjector {
5770
fn fold_crate(&mut self, crate: ast::Crate) -> ast::Crate {
5871
let mut vis = ~[ast::ViewItem {
5972
node: ast::ViewItemExternMod(self.sess.ident_of("std"),
60-
None,
73+
with_version("std"),
6174
ast::DUMMY_NODE_ID),
6275
attrs: ~[],
6376
vis: ast::Private,
@@ -67,15 +80,15 @@ impl fold::Folder for StandardLibraryInjector {
6780
if use_uv(&crate) && !self.sess.building_library.get() {
6881
vis.push(ast::ViewItem {
6982
node: ast::ViewItemExternMod(self.sess.ident_of("green"),
70-
None,
83+
with_version("green"),
7184
ast::DUMMY_NODE_ID),
7285
attrs: ~[],
7386
vis: ast::Private,
7487
span: DUMMY_SP
7588
});
7689
vis.push(ast::ViewItem {
7790
node: ast::ViewItemExternMod(self.sess.ident_of("rustuv"),
78-
None,
91+
with_version("rustuv"),
7992
ast::DUMMY_NODE_ID),
8093
attrs: ~[],
8194
vis: ast::Private,

0 commit comments

Comments
 (0)