Skip to content

Commit 37dcb5b

Browse files
committed
---
yaml --- r: 94785 b: refs/heads/try c: 2277d78 h: refs/heads/master i: 94783: 48675ab v: v3
1 parent 8e077cc commit 37dcb5b

File tree

156 files changed

+4458
-7401
lines changed

Some content is hidden

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

156 files changed

+4458
-7401
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 292269708701f1dfc663668aa72584617b3d9ccc
5+
refs/heads/try: 2277d78d33f1a110ba107064b4da5c2f5b7d941f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ Therefore, if you plan to compile your crate as a library, you should annotate i
30713071
30723072
# #[crate_type = "lib"];
30733073
// Package ID
3074-
#[crate_id = "farm#2.5"];
3074+
#[pkgid = "farm#2.5"];
30753075
30763076
// ...
30773077
# fn farm() {}
@@ -3095,7 +3095,7 @@ or setting the crate type (library or executable) explicitly:
30953095
// ...
30963096
30973097
// This crate is a library ("bin" is the default)
3098-
#[crate_id = "farm#2.5"];
3098+
#[pkgid = "farm#2.5"];
30993099
#[crate_type = "lib"];
31003100
31013101
// Turn on a warning
@@ -3116,7 +3116,7 @@ We define two crates, and use one of them as a library in the other.
31163116

31173117
~~~~
31183118
// world.rs
3119-
#[crate_id = "world#0.42"];
3119+
#[pkgid = "world#0.42"];
31203120
# extern mod extra;
31213121
pub fn explore() -> &'static str { "world" }
31223122
# fn main() {}

branches/try/mk/rt.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ endif
7474

7575
RUNTIME_CS_$(1)_$(2) := \
7676
rt/rust_builtin.c \
77+
rt/rust_upcall.c \
7778
rt/miniz.c \
7879
rt/rust_android_dummy.c \
7980
rt/rust_test_helpers.c

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ syn keyword rustTrait Default
7878
syn keyword rustTrait Hash
7979
syn keyword rustTrait FromStr
8080
syn keyword rustTrait FromIterator Extendable
81-
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
81+
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator ClonableIterator
8282
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
8383
syn keyword rustTrait Times
8484

branches/try/src/libextra/ebml.rs

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -593,13 +593,22 @@ pub mod writer {
593593
use std::io::extensions::u64_to_be_bytes;
594594

595595
// ebml writing
596-
pub struct Encoder<'a> {
596+
pub struct Encoder {
597597
// FIXME(#5665): this should take a trait object
598-
writer: &'a mut MemWriter,
598+
writer: @mut MemWriter,
599599
priv size_positions: ~[uint],
600600
}
601601

602-
fn write_sized_vuint(w: &mut MemWriter, n: uint, size: uint) {
602+
impl Clone for Encoder {
603+
fn clone(&self) -> Encoder {
604+
Encoder {
605+
writer: self.writer,
606+
size_positions: self.size_positions.clone(),
607+
}
608+
}
609+
}
610+
611+
fn write_sized_vuint(w: @mut MemWriter, n: uint, size: uint) {
603612
match size {
604613
1u => w.write(&[0x80u8 | (n as u8)]),
605614
2u => w.write(&[0x40u8 | ((n >> 8_u) as u8), n as u8]),
@@ -611,15 +620,15 @@ pub mod writer {
611620
};
612621
}
613622

614-
fn write_vuint(w: &mut MemWriter, n: uint) {
623+
fn write_vuint(w: @mut MemWriter, n: uint) {
615624
if n < 0x7f_u { write_sized_vuint(w, n, 1u); return; }
616625
if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; }
617626
if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; }
618627
if n < 0x10000000_u { write_sized_vuint(w, n, 4u); return; }
619628
fail!("vint to write too big: {}", n);
620629
}
621630

622-
pub fn Encoder<'a>(w: &'a mut MemWriter) -> Encoder<'a> {
631+
pub fn Encoder(w: @mut MemWriter) -> Encoder {
623632
let size_positions: ~[uint] = ~[];
624633
Encoder {
625634
writer: w,
@@ -628,15 +637,7 @@ pub mod writer {
628637
}
629638

630639
// FIXME (#2741): Provide a function to write the standard ebml header.
631-
impl<'a> Encoder<'a> {
632-
/// XXX(pcwalton): Workaround for badness in trans. DO NOT USE ME.
633-
pub unsafe fn unsafe_clone(&self) -> Encoder<'a> {
634-
Encoder {
635-
writer: cast::transmute_copy(&self.writer),
636-
size_positions: self.size_positions.clone(),
637-
}
638-
}
639-
640+
impl Encoder {
640641
pub fn start_tag(&mut self, tag_id: uint) {
641642
debug!("Start tag {}", tag_id);
642643

@@ -738,7 +739,7 @@ pub mod writer {
738739
// Totally lame approach.
739740
static DEBUG: bool = true;
740741

741-
impl<'a> Encoder<'a> {
742+
impl Encoder {
742743
// used internally to emit things like the vector length and so on
743744
fn _emit_tagged_uint(&mut self, t: EbmlEncoderTag, v: uint) {
744745
assert!(v <= 0xFFFF_FFFF_u);
@@ -754,15 +755,17 @@ pub mod writer {
754755
// try and check failures more quickly.
755756
if DEBUG { self.wr_tagged_str(EsLabel as uint, label) }
756757
}
758+
}
757759

760+
impl Encoder {
758761
pub fn emit_opaque(&mut self, f: |&mut Encoder|) {
759762
self.start_tag(EsOpaque as uint);
760763
f(self);
761764
self.end_tag();
762765
}
763766
}
764767

765-
impl<'a> ::serialize::Encoder for Encoder<'a> {
768+
impl ::serialize::Encoder for Encoder {
766769
fn emit_nil(&mut self) {}
767770

768771
fn emit_uint(&mut self, v: uint) {
@@ -817,7 +820,7 @@ pub mod writer {
817820
self.wr_tagged_str(EsStr as uint, v)
818821
}
819822

820-
fn emit_enum(&mut self, name: &str, f: |&mut Encoder<'a>|) {
823+
fn emit_enum(&mut self, name: &str, f: |&mut Encoder|) {
821824
self._emit_label(name);
822825
self.start_tag(EsEnum as uint);
823826
f(self);
@@ -828,103 +831,98 @@ pub mod writer {
828831
_: &str,
829832
v_id: uint,
830833
_: uint,
831-
f: |&mut Encoder<'a>|) {
834+
f: |&mut Encoder|) {
832835
self._emit_tagged_uint(EsEnumVid, v_id);
833836
self.start_tag(EsEnumBody as uint);
834837
f(self);
835838
self.end_tag();
836839
}
837840

838-
fn emit_enum_variant_arg(&mut self, _: uint, f: |&mut Encoder<'a>|) {
841+
fn emit_enum_variant_arg(&mut self, _: uint, f: |&mut Encoder|) {
839842
f(self)
840843
}
841844

842845
fn emit_enum_struct_variant(&mut self,
843846
v_name: &str,
844847
v_id: uint,
845848
cnt: uint,
846-
f: |&mut Encoder<'a>|) {
849+
f: |&mut Encoder|) {
847850
self.emit_enum_variant(v_name, v_id, cnt, f)
848851
}
849852

850853
fn emit_enum_struct_variant_field(&mut self,
851854
_: &str,
852855
idx: uint,
853-
f: |&mut Encoder<'a>|) {
856+
f: |&mut Encoder|) {
854857
self.emit_enum_variant_arg(idx, f)
855858
}
856859

857-
fn emit_struct(&mut self,
858-
_: &str,
859-
_len: uint,
860-
f: |&mut Encoder<'a>|) {
860+
fn emit_struct(&mut self, _: &str, _len: uint, f: |&mut Encoder|) {
861861
f(self)
862862
}
863863

864864
fn emit_struct_field(&mut self,
865865
name: &str,
866866
_: uint,
867-
f: |&mut Encoder<'a>|) {
867+
f: |&mut Encoder|) {
868868
self._emit_label(name);
869869
f(self)
870870
}
871871

872-
fn emit_tuple(&mut self, len: uint, f: |&mut Encoder<'a>|) {
872+
fn emit_tuple(&mut self, len: uint, f: |&mut Encoder|) {
873873
self.emit_seq(len, f)
874874
}
875-
fn emit_tuple_arg(&mut self, idx: uint, f: |&mut Encoder<'a>|) {
875+
fn emit_tuple_arg(&mut self, idx: uint, f: |&mut Encoder|) {
876876
self.emit_seq_elt(idx, f)
877877
}
878878

879879
fn emit_tuple_struct(&mut self,
880880
_: &str,
881881
len: uint,
882-
f: |&mut Encoder<'a>|) {
882+
f: |&mut Encoder|) {
883883
self.emit_seq(len, f)
884884
}
885-
fn emit_tuple_struct_arg(&mut self,
886-
idx: uint,
887-
f: |&mut Encoder<'a>|) {
885+
fn emit_tuple_struct_arg(&mut self, idx: uint, f: |&mut Encoder|) {
888886
self.emit_seq_elt(idx, f)
889887
}
890888

891-
fn emit_option(&mut self, f: |&mut Encoder<'a>|) {
889+
fn emit_option(&mut self, f: |&mut Encoder|) {
892890
self.emit_enum("Option", f);
893891
}
894892
fn emit_option_none(&mut self) {
895893
self.emit_enum_variant("None", 0, 0, |_| ())
896894
}
897-
fn emit_option_some(&mut self, f: |&mut Encoder<'a>|) {
895+
fn emit_option_some(&mut self, f: |&mut Encoder|) {
898896
self.emit_enum_variant("Some", 1, 1, f)
899897
}
900898

901-
fn emit_seq(&mut self, len: uint, f: |&mut Encoder<'a>|) {
899+
fn emit_seq(&mut self, len: uint, f: |&mut Encoder|) {
902900
self.start_tag(EsVec as uint);
903901
self._emit_tagged_uint(EsVecLen, len);
904902
f(self);
905903
self.end_tag();
906904
}
907905

908-
fn emit_seq_elt(&mut self, _idx: uint, f: |&mut Encoder<'a>|) {
906+
fn emit_seq_elt(&mut self, _idx: uint, f: |&mut Encoder|) {
909907
self.start_tag(EsVecElt as uint);
910908
f(self);
911909
self.end_tag();
912910
}
913911

914-
fn emit_map(&mut self, len: uint, f: |&mut Encoder<'a>|) {
912+
fn emit_map(&mut self, len: uint, f: |&mut Encoder|) {
915913
self.start_tag(EsMap as uint);
916914
self._emit_tagged_uint(EsMapLen, len);
917915
f(self);
918916
self.end_tag();
919917
}
920918

921-
fn emit_map_elt_key(&mut self, _idx: uint, f: |&mut Encoder<'a>|) {
919+
fn emit_map_elt_key(&mut self, _idx: uint, f: |&mut Encoder|) {
922920
self.start_tag(EsMapKey as uint);
923921
f(self);
924922
self.end_tag();
925923
}
926924

927-
fn emit_map_elt_val(&mut self, _idx: uint, f: |&mut Encoder<'a>|) {
925+
fn emit_map_elt_val(&mut self, _idx: uint, f: |&mut Encoder|) {
928926
self.start_tag(EsMapVal as uint);
929927
f(self);
930928
self.end_tag();
@@ -950,11 +948,9 @@ mod tests {
950948
fn test_option_int() {
951949
fn test_v(v: Option<int>) {
952950
debug!("v == {:?}", v);
953-
let mut wr = MemWriter::new();
954-
{
955-
let mut ebml_w = writer::Encoder(&mut wr);
956-
v.encode(&mut ebml_w);
957-
}
951+
let wr = @mut MemWriter::new();
952+
let mut ebml_w = writer::Encoder(wr);
953+
v.encode(&mut ebml_w);
958954
let ebml_doc = reader::Doc(*wr.inner_ref());
959955
let mut deser = reader::Decoder(ebml_doc);
960956
let v1 = serialize::Decodable::decode(&mut deser);

branches/try/src/libextra/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! This module defines a container which uses an efficient bit mask
1414
//! representation to hold C-like enum variants.
1515
16-
#[deriving(Clone, Eq, IterBytes, ToStr, Encodable, Decodable)]
16+
#[deriving(Clone, Eq, IterBytes, ToStr)]
1717
/// A specialized Set implementation to use enum types.
1818
pub struct EnumSet<E> {
1919
// We must maintain the invariant that no bits are set

branches/try/src/libextra/lib.rs

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

23+
// NOTE: remove after snapshot
24+
#[pkgid = "extra#0.9-pre"];
2325
#[crate_id = "extra#0.9-pre"];
2426
#[comment = "Rust extras"];
2527
#[license = "MIT/ASL2"];

branches/try/src/libgreen/lib.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
//! This can be optionally linked in to rust programs in order to provide M:N
1818
//! functionality inside of 1:1 programs.
1919
20+
#[pkgid = "green#0.9-pre"];
2021
#[crate_id = "green#0.9-pre"];
2122
#[license = "MIT/ASL2"];
2223
#[crate_type = "rlib"];
@@ -214,7 +215,11 @@ impl SchedPool {
214215
pool.handles.push(sched.make_handle());
215216
let sched = sched;
216217
pool.threads.push(do Thread::start {
217-
sched.bootstrap();
218+
let mut sched = sched;
219+
let task = do GreenTask::new(&mut sched.stack_pool, None) {
220+
rtdebug!("boostraping a non-primary scheduler");
221+
};
222+
sched.bootstrap(task);
218223
});
219224
}
220225

@@ -266,7 +271,13 @@ impl SchedPool {
266271
let ret = sched.make_handle();
267272
self.handles.push(sched.make_handle());
268273
let sched = sched;
269-
self.threads.push(do Thread::start { sched.bootstrap() });
274+
self.threads.push(do Thread::start {
275+
let mut sched = sched;
276+
let task = do GreenTask::new(&mut sched.stack_pool, None) {
277+
rtdebug!("boostraping a non-primary scheduler");
278+
};
279+
sched.bootstrap(task);
280+
});
270281

271282
return ret;
272283
}

0 commit comments

Comments
 (0)