Skip to content

Commit 843f462

Browse files
committed
---
yaml --- r: 56771 b: refs/heads/try c: 7ebe577 h: refs/heads/master i: 56769: 801e378 56767: 245e3d3 v: v3
1 parent bca04ce commit 843f462

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

+1483
-978
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: 1edfed7914f458172f182c13a2451a0120334092
5+
refs/heads/try: 7ebe5779b6965dc06e1204fe7eb2676792c8cb22
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ then
533533
LLVM_VERSION=$($LLVM_CONFIG --version)
534534

535535
case $LLVM_VERSION in
536-
(3.2svn|3.2|3.1svn|3.1|3.0svn|3.0)
536+
(3.3|3.3svn|3.2|3.2svn)
537537
msg "found ok version of LLVM: $LLVM_VERSION"
538538
;;
539539
(*)

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.6");
21-
extern mod std(vers = "0.6");
20+
extern mod core(vers = "0.7-rc");
21+
extern mod std(vers = "0.7-rc");
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.6");
12+
extern mod core(vers = "0.7-rc");
1313

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

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

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

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

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

2929
#[cfg(rustc)]
30-
extern mod this(name = "rustc", vers = "0.6");
30+
extern mod this(name = "rustc", vers = "0.7-rc");
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.6" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
10+
<language name="Rust" version="0.7-rc" 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: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,32 @@ totaleq_impl!(i64)
6464
totaleq_impl!(int)
6565
totaleq_impl!(uint)
6666

67-
#[deriving(Eq)]
68-
pub enum Ordering { Less, Equal, Greater }
67+
#[deriving(Clone, Eq)]
68+
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
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+
7593
macro_rules! totalord_impl(
7694
($t:ty) => {
7795
impl TotalOrd for $t {
@@ -180,4 +198,10 @@ mod test {
180198
assert!(5.equals(&5));
181199
assert!(!2.equals(&17));
182200
}
201+
202+
#[test]
203+
fn test_ordering_order() {
204+
assert!(Less < Equal);
205+
assert_eq!(Greater.cmp(&Less), Greater);
206+
}
183207
}

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.6",
51+
vers = "0.7-rc",
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.6");
69+
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-rc");
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: 17 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ use result;
4242
use task::rt::{task_id, sched_id, rust_task};
4343
use util;
4444
use util::replace;
45+
use unstable::finally::Finally;
4546

4647
#[cfg(test)] use comm::SharedChan;
4748

@@ -565,51 +566,27 @@ pub fn get_scheduler() -> Scheduler {
565566
* ~~~
566567
*/
567568
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-
583569
unsafe {
584570
let t = rt::rust_get_task();
585-
let _allow_failure = AllowFailure(t);
586571
rt::rust_task_inhibit_kill(t);
587-
f()
572+
do (|| {
573+
f()
574+
}).finally {
575+
rt::rust_task_allow_kill(t);
576+
}
588577
}
589578
}
590579
591580
/// The inverse of unkillable. Only ever to be used nested in unkillable().
592581
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-
608582
unsafe {
609583
let t = rt::rust_get_task();
610-
let _allow_failure = DisallowFailure(t);
611584
rt::rust_task_allow_kill(t);
612-
f()
585+
do (|| {
586+
f()
587+
}).finally {
588+
rt::rust_task_inhibit_kill(t);
589+
}
613590
}
614591
}
615592
@@ -618,28 +595,16 @@ pub unsafe fn rekillable<U>(f: &fn() -> U) -> U {
618595
* For use with exclusive ARCs, which use pthread mutexes directly.
619596
*/
620597
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-
637598
unsafe {
638599
let t = rt::rust_get_task();
639-
let _interrupts = DeferInterrupts(t);
640600
rt::rust_task_inhibit_kill(t);
641601
rt::rust_task_inhibit_yield(t);
642-
f()
602+
do (|| {
603+
f()
604+
}).finally {
605+
rt::rust_task_allow_yield(t);
606+
rt::rust_task_allow_kill(t);
607+
}
643608
}
644609
}
645610

branches/try/src/libcore/unstable.rs

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

2021
#[path = "unstable/at_exit.rs"]
2122
pub mod at_exit;
@@ -229,25 +230,13 @@ fn LittleLock() -> LittleLock {
229230
pub impl LittleLock {
230231
#[inline(always)]
231232
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-
247233
do atomically {
248234
rustrt::rust_lock_little_lock(self.l);
249-
let _r = Unlock(self.l);
250-
f()
235+
do (|| {
236+
f()
237+
}).finally {
238+
rustrt::rust_unlock_little_lock(self.l);
239+
}
251240
}
252241
}
253242
}

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.6",
13+
vers = "0.7-rc",
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.6");
30-
extern mod std(vers = "0.6");
31-
extern mod syntax(vers = "0.6");
29+
extern mod core(vers = "0.7-rc");
30+
extern mod std(vers = "0.7-rc");
31+
extern mod syntax(vers = "0.7-rc");
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.6",
16+
vers = "0.7-rc",
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.6");
23+
extern mod core(vers = "0.7-rc");
2424

2525
use core::run;
2626

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,7 @@ 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-
entry_fn: @mut None,
702-
entry_type: @mut None,
701+
main_fn: @mut None,
703702
span_diagnostic: span_diagnostic_handler,
704703
filesearch: filesearch,
705704
building_library: @mut false,

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,14 @@ 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-
157147
pub struct Session_ {
158148
targ_cfg: @config,
159149
opts: @options,
160150
cstore: @mut metadata::cstore::CStore,
161151
parse_sess: @mut ParseSess,
162152
codemap: @codemap::CodeMap,
163153
// For a library crate, this is always none
164-
entry_fn: @mut Option<(node_id, codemap::span)>,
165-
entry_type: @mut Option<EntryFnType>,
154+
main_fn: @mut Option<(node_id, codemap::span)>,
166155
span_diagnostic: @diagnostic::span_handler,
167156
filesearch: @filesearch::FileSearch,
168157
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.6";
22+
static CORE_VERSION: &'static str = "0.7-rc";
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.6");
268+
let vers = ast::lit_str(@~"0.7-rc");
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_bounds = 0x5b,
130+
tag_table_param_defs = 0x5b,
131131
tag_table_inferred_modes = 0x5c,
132132
tag_table_mutbl = 0x5d,
133133
tag_table_last_use = 0x5e,

0 commit comments

Comments
 (0)