Skip to content

Commit bca04ce

Browse files
author
James Miller
committed
---
yaml --- r: 56770 b: refs/heads/try c: 1edfed7 h: refs/heads/master v: v3
1 parent 801e378 commit bca04ce

Some content is hidden

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

62 files changed

+978
-1483
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: 0fea2bd8a110bba08964ec3b050e18505a06e21a
5+
refs/heads/try: 1edfed7914f458172f182c13a2451a0120334092
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/compiletest.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#[allow(deprecated_mode)];
1818
#[allow(deprecated_pattern)];
1919

20-
extern mod core(vers = "0.7-rc");
21-
extern mod std(vers = "0.7-rc");
20+
extern mod core(vers = "0.6");
21+
extern mod std(vers = "0.6");
2222

2323
use core::*;
2424

branches/try/src/driver/driver.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
// except according to those terms.
1010

1111
#[no_core];
12-
extern mod core(vers = "0.7-rc");
12+
extern mod core(vers = "0.6");
1313

1414
#[cfg(rustpkg)]
15-
extern mod this(name = "rustpkg", vers = "0.7-rc");
15+
extern mod this(name = "rustpkg", vers = "0.6");
1616

1717
#[cfg(fuzzer)]
18-
extern mod this(name = "fuzzer", vers = "0.7-rc");
18+
extern mod this(name = "fuzzer", vers = "0.6");
1919

2020
#[cfg(rustdoc)]
21-
extern mod this(name = "rustdoc", vers = "0.7-rc");
21+
extern mod this(name = "rustdoc", vers = "0.6");
2222

2323
#[cfg(rusti)]
24-
extern mod this(name = "rusti", vers = "0.7-rc");
24+
extern mod this(name = "rusti", vers = "0.6");
2525

2626
#[cfg(rust)]
27-
extern mod this(name = "rust", vers = "0.7-rc");
27+
extern mod this(name = "rust", vers = "0.6");
2828

2929
#[cfg(rustc)]
30-
extern mod this(name = "rustc", vers = "0.7-rc");
30+
extern mod this(name = "rustc", vers = "0.6");
3131

3232
fn main() { this::main() }

branches/try/src/etc/kate/rust.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
88
<!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
99
]>
10-
<language name="Rust" version="0.7-rc" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
10+
<language name="Rust" version="0.6" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
1111
<highlighting>
1212
<list name="fn">
1313
<item> fn </item>

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
110110
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
111111
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
112112

113-
syn region rustCommentDoc start="/\*[\*!]" end="\*/"
114-
syn region rustCommentDoc start="//[/!]" skip="\\$" end="$" keepend
113+
syn region rustCommentDoc start="/\*\*" end="\*/"
114+
syn region rustCommentDoc start="///" skip="\\$" end="$" keepend
115115
syn match rustComment "/\*\*/"
116-
syn region rustComment start="/\*\([^\*!]\|$\)" end="\*/" contains=rustTodo
117-
syn region rustComment start="//\([^/!]\|$\)" skip="\\$" end="$" contains=rustTodo keepend
116+
syn region rustComment start="/\*\([^\*]\|$\)" end="\*/" contains=rustTodo
117+
syn region rustComment start="//\([^/]\|$\)" skip="\\$" end="$" contains=rustTodo keepend
118118

119119
syn keyword rustTodo contained TODO FIXME XXX NB
120120

branches/try/src/libcore/cmp.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,14 @@ totaleq_impl!(i64)
6464
totaleq_impl!(int)
6565
totaleq_impl!(uint)
6666

67-
#[deriving(Clone, Eq)]
68-
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
67+
#[deriving(Eq)]
68+
pub enum Ordering { Less, Equal, Greater }
6969

7070
/// Trait for types that form a total order
7171
pub trait TotalOrd: TotalEq {
7272
fn cmp(&self, other: &Self) -> Ordering;
7373
}
7474

75-
impl TotalOrd for Ordering {
76-
#[inline(always)]
77-
fn cmp(&self, other: &Ordering) -> Ordering {
78-
(*self as int).cmp(&(*other as int))
79-
}
80-
}
81-
82-
impl Ord for Ordering {
83-
#[inline(always)]
84-
fn lt(&self, other: &Ordering) -> bool { (*self as int) < (*other as int) }
85-
#[inline(always)]
86-
fn le(&self, other: &Ordering) -> bool { (*self as int) <= (*other as int) }
87-
#[inline(always)]
88-
fn gt(&self, other: &Ordering) -> bool { (*self as int) > (*other as int) }
89-
#[inline(always)]
90-
fn ge(&self, other: &Ordering) -> bool { (*self as int) >= (*other as int) }
91-
}
92-
9375
macro_rules! totalord_impl(
9476
($t:ty) => {
9577
impl TotalOrd for $t {
@@ -198,10 +180,4 @@ mod test {
198180
assert!(5.equals(&5));
199181
assert!(!2.equals(&17));
200182
}
201-
202-
#[test]
203-
fn test_ordering_order() {
204-
assert!(Less < Equal);
205-
assert_eq!(Greater.cmp(&Less), Greater);
206-
}
207183
}

branches/try/src/libcore/core.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ they contained the following prologue:
4848

4949

5050
#[link(name = "core",
51-
vers = "0.7-rc",
51+
vers = "0.6",
5252
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
5353
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
5454

@@ -66,7 +66,7 @@ they contained the following prologue:
6666
#[allow(deprecated_drop)];
6767

6868
// Make core testable by not duplicating lang items. See #2912
69-
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-rc");
69+
#[cfg(test)] extern mod realcore(name = "core", vers = "0.6");
7070
#[cfg(test)] pub use kinds = realcore::kinds;
7171
#[cfg(test)] pub use ops = realcore::ops;
7272
#[cfg(test)] pub use cmp = realcore::cmp;

branches/try/src/libcore/task/mod.rs

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use result;
4242
use task::rt::{task_id, sched_id, rust_task};
4343
use util;
4444
use util::replace;
45-
use unstable::finally::Finally;
4645

4746
#[cfg(test)] use comm::SharedChan;
4847

@@ -566,27 +565,51 @@ pub fn get_scheduler() -> Scheduler {
566565
* ~~~
567566
*/
568567
pub unsafe fn unkillable<U>(f: &fn() -> U) -> U {
568+
struct AllowFailure {
569+
t: *rust_task,
570+
drop {
571+
unsafe {
572+
rt::rust_task_allow_kill(self.t);
573+
}
574+
}
575+
}
576+
577+
fn AllowFailure(t: *rust_task) -> AllowFailure{
578+
AllowFailure {
579+
t: t
580+
}
581+
}
582+
569583
unsafe {
570584
let t = rt::rust_get_task();
585+
let _allow_failure = AllowFailure(t);
571586
rt::rust_task_inhibit_kill(t);
572-
do (|| {
573-
f()
574-
}).finally {
575-
rt::rust_task_allow_kill(t);
576-
}
587+
f()
577588
}
578589
}
579590
580591
/// The inverse of unkillable. Only ever to be used nested in unkillable().
581592
pub unsafe fn rekillable<U>(f: &fn() -> U) -> U {
593+
struct DisallowFailure {
594+
t: *rust_task,
595+
drop {
596+
unsafe {
597+
rt::rust_task_inhibit_kill(self.t);
598+
}
599+
}
600+
}
601+
602+
fn DisallowFailure(t: *rust_task) -> DisallowFailure {
603+
DisallowFailure {
604+
t: t
605+
}
606+
}
607+
582608
unsafe {
583609
let t = rt::rust_get_task();
610+
let _allow_failure = DisallowFailure(t);
584611
rt::rust_task_allow_kill(t);
585-
do (|| {
586-
f()
587-
}).finally {
588-
rt::rust_task_inhibit_kill(t);
589-
}
612+
f()
590613
}
591614
}
592615
@@ -595,16 +618,28 @@ pub unsafe fn rekillable<U>(f: &fn() -> U) -> U {
595618
* For use with exclusive ARCs, which use pthread mutexes directly.
596619
*/
597620
pub unsafe fn atomically<U>(f: &fn() -> U) -> U {
621+
struct DeferInterrupts {
622+
t: *rust_task,
623+
drop {
624+
unsafe {
625+
rt::rust_task_allow_yield(self.t);
626+
rt::rust_task_allow_kill(self.t);
627+
}
628+
}
629+
}
630+
631+
fn DeferInterrupts(t: *rust_task) -> DeferInterrupts {
632+
DeferInterrupts {
633+
t: t
634+
}
635+
}
636+
598637
unsafe {
599638
let t = rt::rust_get_task();
639+
let _interrupts = DeferInterrupts(t);
600640
rt::rust_task_inhibit_kill(t);
601641
rt::rust_task_inhibit_yield(t);
602-
do (|| {
603-
f()
604-
}).finally {
605-
rt::rust_task_allow_yield(t);
606-
rt::rust_task_allow_kill(t);
607-
}
642+
f()
608643
}
609644
}
610645

branches/try/src/libcore/unstable.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use comm::{GenericChan, GenericPort};
1616
use prelude::*;
1717
use task;
1818
use task::atomically;
19-
use self::finally::Finally;
2019

2120
#[path = "unstable/at_exit.rs"]
2221
pub mod at_exit;
@@ -230,13 +229,25 @@ fn LittleLock() -> LittleLock {
230229
pub impl LittleLock {
231230
#[inline(always)]
232231
unsafe fn lock<T>(&self, f: &fn() -> T) -> T {
232+
struct Unlock {
233+
l: rust_little_lock,
234+
drop {
235+
unsafe {
236+
rustrt::rust_unlock_little_lock(self.l);
237+
}
238+
}
239+
}
240+
241+
fn Unlock(l: rust_little_lock) -> Unlock {
242+
Unlock {
243+
l: l
244+
}
245+
}
246+
233247
do atomically {
234248
rustrt::rust_lock_little_lock(self.l);
235-
do (|| {
236-
f()
237-
}).finally {
238-
rustrt::rust_unlock_little_lock(self.l);
239-
}
249+
let _r = Unlock(self.l);
250+
f()
240251
}
241252
}
242253
}

branches/try/src/libfuzzer/fuzzer.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
#[link(name = "fuzzer",
13-
vers = "0.7-rc",
13+
vers = "0.6",
1414
uuid = "d6418797-2736-4833-bd82-d3c684b7c1b0",
1515
url = "https://github.com/mozilla/rust/tree/master/src/libfuzzer")];
1616

@@ -26,9 +26,9 @@
2626
#[allow(deprecated_mode)];
2727
#[allow(deprecated_pattern)];
2828

29-
extern mod core(vers = "0.7-rc");
30-
extern mod std(vers = "0.7-rc");
31-
extern mod syntax(vers = "0.7-rc");
29+
extern mod core(vers = "0.6");
30+
extern mod std(vers = "0.6");
31+
extern mod syntax(vers = "0.6");
3232

3333
use core::*;
3434
use core::io::WriterUtil;

branches/try/src/librust/rust.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
// FIXME #2238 Make run only accept source that emits an executable
1414

1515
#[link(name = "rust",
16-
vers = "0.7-rc",
16+
vers = "0.6",
1717
uuid = "4a24da33-5cc8-4037-9352-2cbe9bd9d27c",
1818
url = "https://github.com/mozilla/rust/tree/master/src/rust")];
1919

2020
#[license = "MIT/ASL2"];
2121
#[crate_type = "lib"];
2222

23-
extern mod core(vers = "0.7-rc");
23+
extern mod core(vers = "0.6");
2424

2525
use core::run;
2626

branches/try/src/librustc/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The 3 central data structures:
7575
Control and information flow within the compiler:
7676
-------------------------------------------------
7777

78-
- main() in rustc.rc assumes control on startup. Options are
78+
- main() in driver/rustc.rs assumes control on startup. Options are
7979
parsed, platform is detected, etc.
8080

8181
- libsyntax/parse/parser.rs parses the input files and produces an AST

branches/try/src/librustc/driver/driver.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ pub fn build_session_(sopts: @session::options,
698698
parse_sess: p_s,
699699
codemap: cm,
700700
// For a library crate, this is always none
701-
main_fn: @mut None,
701+
entry_fn: @mut None,
702+
entry_type: @mut None,
702703
span_diagnostic: span_diagnostic_handler,
703704
filesearch: filesearch,
704705
building_library: @mut false,

branches/try/src/librustc/driver/session.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,25 @@ pub struct crate_metadata {
144144
data: ~[u8]
145145
}
146146

147+
// The type of entry function, so
148+
// users can have their own entry
149+
// functions that don't start a
150+
// scheduler
151+
#[deriving(Eq)]
152+
pub enum EntryFnType {
153+
EntryMain,
154+
EntryStart
155+
}
156+
147157
pub struct Session_ {
148158
targ_cfg: @config,
149159
opts: @options,
150160
cstore: @mut metadata::cstore::CStore,
151161
parse_sess: @mut ParseSess,
152162
codemap: @codemap::CodeMap,
153163
// For a library crate, this is always none
154-
main_fn: @mut Option<(node_id, codemap::span)>,
164+
entry_fn: @mut Option<(node_id, codemap::span)>,
165+
entry_type: @mut Option<EntryFnType>,
155166
span_diagnostic: @diagnostic::span_handler,
156167
filesearch: @filesearch::FileSearch,
157168
building_library: @mut bool,

branches/try/src/librustc/front/core_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use syntax::codemap;
1919
use syntax::codemap::dummy_sp;
2020
use syntax::fold;
2121

22-
static CORE_VERSION: &'static str = "0.7-rc";
22+
static CORE_VERSION: &'static str = "0.6";
2323

2424
pub fn maybe_inject_libcore_ref(sess: Session,
2525
crate: @ast::crate) -> @ast::crate {

branches/try/src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ mod __test {
265265
*/
266266

267267
fn mk_std(cx: &TestCtxt) -> @ast::view_item {
268-
let vers = ast::lit_str(@~"0.7-rc");
268+
let vers = ast::lit_str(@~"0.6");
269269
let vers = nospan(vers);
270270
let mi = ast::meta_name_value(@~"vers", vers);
271271
let mi = nospan(mi);

branches/try/src/librustc/metadata/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub enum astencode_tag { // Reserves 0x50 -- 0x6f
127127
tag_table_node_type_subst = 0x58,
128128
tag_table_freevars = 0x59,
129129
tag_table_tcache = 0x5a,
130-
tag_table_param_defs = 0x5b,
130+
tag_table_param_bounds = 0x5b,
131131
tag_table_inferred_modes = 0x5c,
132132
tag_table_mutbl = 0x5d,
133133
tag_table_last_use = 0x5e,

0 commit comments

Comments
 (0)