Skip to content

Commit 5b27fd6

Browse files
committed
---
yaml --- r: 94788 b: refs/heads/try c: c0d4abf h: refs/heads/master v: v3
1 parent da74d89 commit 5b27fd6

File tree

150 files changed

+7227
-4345
lines changed

Some content is hidden

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

150 files changed

+7227
-4345
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: 87157361170ef5cd0f8a7a307d19d2343ed3618f
5+
refs/heads/try: c0d4abf8c5d368fb6861fb015c82811e94b7566b
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-
#[pkgid = "farm#2.5"];
3074+
#[crate_id = "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-
#[pkgid = "farm#2.5"];
3098+
#[crate_id = "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-
#[pkgid = "world#0.42"];
3119+
#[crate_id = "world#0.42"];
31203120
# extern mod extra;
31213121
pub fn explore() -> &'static str { "world" }
31223122
# fn main() {}

branches/try/mk/rt.mk

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

7575
RUNTIME_CS_$(1)_$(2) := \
7676
rt/rust_builtin.c \
77-
rt/rust_upcall.c \
7877
rt/miniz.c \
7978
rt/rust_android_dummy.c \
8079
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 ClonableIterator
81+
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
8282
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
8383
syn keyword rustTrait Times
8484

branches/try/src/libextra/ebml.rs

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

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

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) {
602+
fn write_sized_vuint(w: &mut MemWriter, n: uint, size: uint) {
612603
match size {
613604
1u => w.write(&[0x80u8 | (n as u8)]),
614605
2u => w.write(&[0x40u8 | ((n >> 8_u) as u8), n as u8]),
@@ -620,15 +611,15 @@ pub mod writer {
620611
};
621612
}
622613

623-
fn write_vuint(w: @mut MemWriter, n: uint) {
614+
fn write_vuint(w: &mut MemWriter, n: uint) {
624615
if n < 0x7f_u { write_sized_vuint(w, n, 1u); return; }
625616
if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; }
626617
if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; }
627618
if n < 0x10000000_u { write_sized_vuint(w, n, 4u); return; }
628619
fail!("vint to write too big: {}", n);
629620
}
630621

631-
pub fn Encoder(w: @mut MemWriter) -> Encoder {
622+
pub fn Encoder<'a>(w: &'a mut MemWriter) -> Encoder<'a> {
632623
let size_positions: ~[uint] = ~[];
633624
Encoder {
634625
writer: w,
@@ -637,7 +628,15 @@ pub mod writer {
637628
}
638629

639630
// FIXME (#2741): Provide a function to write the standard ebml header.
640-
impl Encoder {
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+
641640
pub fn start_tag(&mut self, tag_id: uint) {
642641
debug!("Start tag {}", tag_id);
643642

@@ -739,7 +738,7 @@ pub mod writer {
739738
// Totally lame approach.
740739
static DEBUG: bool = true;
741740

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

760-
impl Encoder {
761758
pub fn emit_opaque(&mut self, f: |&mut Encoder|) {
762759
self.start_tag(EsOpaque as uint);
763760
f(self);
764761
self.end_tag();
765762
}
766763
}
767764

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

771768
fn emit_uint(&mut self, v: uint) {
@@ -820,7 +817,7 @@ pub mod writer {
820817
self.wr_tagged_str(EsStr as uint, v)
821818
}
822819

823-
fn emit_enum(&mut self, name: &str, f: |&mut Encoder|) {
820+
fn emit_enum(&mut self, name: &str, f: |&mut Encoder<'a>|) {
824821
self._emit_label(name);
825822
self.start_tag(EsEnum as uint);
826823
f(self);
@@ -831,98 +828,103 @@ pub mod writer {
831828
_: &str,
832829
v_id: uint,
833830
_: uint,
834-
f: |&mut Encoder|) {
831+
f: |&mut Encoder<'a>|) {
835832
self._emit_tagged_uint(EsEnumVid, v_id);
836833
self.start_tag(EsEnumBody as uint);
837834
f(self);
838835
self.end_tag();
839836
}
840837

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

845842
fn emit_enum_struct_variant(&mut self,
846843
v_name: &str,
847844
v_id: uint,
848845
cnt: uint,
849-
f: |&mut Encoder|) {
846+
f: |&mut Encoder<'a>|) {
850847
self.emit_enum_variant(v_name, v_id, cnt, f)
851848
}
852849

853850
fn emit_enum_struct_variant_field(&mut self,
854851
_: &str,
855852
idx: uint,
856-
f: |&mut Encoder|) {
853+
f: |&mut Encoder<'a>|) {
857854
self.emit_enum_variant_arg(idx, f)
858855
}
859856

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

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

872-
fn emit_tuple(&mut self, len: uint, f: |&mut Encoder|) {
872+
fn emit_tuple(&mut self, len: uint, f: |&mut Encoder<'a>|) {
873873
self.emit_seq(len, f)
874874
}
875-
fn emit_tuple_arg(&mut self, idx: uint, f: |&mut Encoder|) {
875+
fn emit_tuple_arg(&mut self, idx: uint, f: |&mut Encoder<'a>|) {
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|) {
882+
f: |&mut Encoder<'a>|) {
883883
self.emit_seq(len, f)
884884
}
885-
fn emit_tuple_struct_arg(&mut self, idx: uint, f: |&mut Encoder|) {
885+
fn emit_tuple_struct_arg(&mut self,
886+
idx: uint,
887+
f: |&mut Encoder<'a>|) {
886888
self.emit_seq_elt(idx, f)
887889
}
888890

889-
fn emit_option(&mut self, f: |&mut Encoder|) {
891+
fn emit_option(&mut self, f: |&mut Encoder<'a>|) {
890892
self.emit_enum("Option", f);
891893
}
892894
fn emit_option_none(&mut self) {
893895
self.emit_enum_variant("None", 0, 0, |_| ())
894896
}
895-
fn emit_option_some(&mut self, f: |&mut Encoder|) {
897+
fn emit_option_some(&mut self, f: |&mut Encoder<'a>|) {
896898
self.emit_enum_variant("Some", 1, 1, f)
897899
}
898900

899-
fn emit_seq(&mut self, len: uint, f: |&mut Encoder|) {
901+
fn emit_seq(&mut self, len: uint, f: |&mut Encoder<'a>|) {
900902
self.start_tag(EsVec as uint);
901903
self._emit_tagged_uint(EsVecLen, len);
902904
f(self);
903905
self.end_tag();
904906
}
905907

906-
fn emit_seq_elt(&mut self, _idx: uint, f: |&mut Encoder|) {
908+
fn emit_seq_elt(&mut self, _idx: uint, f: |&mut Encoder<'a>|) {
907909
self.start_tag(EsVecElt as uint);
908910
f(self);
909911
self.end_tag();
910912
}
911913

912-
fn emit_map(&mut self, len: uint, f: |&mut Encoder|) {
914+
fn emit_map(&mut self, len: uint, f: |&mut Encoder<'a>|) {
913915
self.start_tag(EsMap as uint);
914916
self._emit_tagged_uint(EsMapLen, len);
915917
f(self);
916918
self.end_tag();
917919
}
918920

919-
fn emit_map_elt_key(&mut self, _idx: uint, f: |&mut Encoder|) {
921+
fn emit_map_elt_key(&mut self, _idx: uint, f: |&mut Encoder<'a>|) {
920922
self.start_tag(EsMapKey as uint);
921923
f(self);
922924
self.end_tag();
923925
}
924926

925-
fn emit_map_elt_val(&mut self, _idx: uint, f: |&mut Encoder|) {
927+
fn emit_map_elt_val(&mut self, _idx: uint, f: |&mut Encoder<'a>|) {
926928
self.start_tag(EsMapVal as uint);
927929
f(self);
928930
self.end_tag();
@@ -948,9 +950,11 @@ mod tests {
948950
fn test_option_int() {
949951
fn test_v(v: Option<int>) {
950952
debug!("v == {:?}", v);
951-
let wr = @mut MemWriter::new();
952-
let mut ebml_w = writer::Encoder(wr);
953-
v.encode(&mut ebml_w);
953+
let mut wr = MemWriter::new();
954+
{
955+
let mut ebml_w = writer::Encoder(&mut wr);
956+
v.encode(&mut ebml_w);
957+
}
954958
let ebml_doc = reader::Doc(*wr.inner_ref());
955959
let mut deser = reader::Decoder(ebml_doc);
956960
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)]
16+
#[deriving(Clone, Eq, IterBytes, ToStr, Encodable, Decodable)]
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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Rust extras are part of the standard Rust distribution.
2020
2121
*/
2222

23-
// NOTE: remove after snapshot
24-
#[pkgid = "extra#0.9-pre"];
2523
#[crate_id = "extra#0.9-pre"];
2624
#[comment = "Rust extras"];
2725
#[license = "MIT/ASL2"];

branches/try/src/libgreen/lib.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
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"];
2120
#[crate_id = "green#0.9-pre"];
2221
#[license = "MIT/ASL2"];
2322
#[crate_type = "rlib"];
@@ -215,11 +214,7 @@ impl SchedPool {
215214
pool.handles.push(sched.make_handle());
216215
let sched = sched;
217216
pool.threads.push(do Thread::start {
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);
217+
sched.bootstrap();
223218
});
224219
}
225220

@@ -271,13 +266,7 @@ impl SchedPool {
271266
let ret = sched.make_handle();
272267
self.handles.push(sched.make_handle());
273268
let sched = sched;
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-
});
269+
self.threads.push(do Thread::start { sched.bootstrap() });
281270

282271
return ret;
283272
}

0 commit comments

Comments
 (0)