Skip to content

Commit f5948b2

Browse files
committed
---
yaml --- r: 145182 b: refs/heads/try2 c: e1507f3 h: refs/heads/master v: v3
1 parent 73a3d77 commit f5948b2

35 files changed

+339
-857
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: 07e821aa6ba47df7fd579c35960c0cb0d4073c76
8+
refs/heads/try2: e1507f3120a14399af1a4bb097240c9be865634d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
[attr]rust text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4
22

3-
* text eol=lf
3+
* text=auto
44
*.cpp rust
55
*.h rust
66
*.rs rust
77
src/rt/msvc/* -whitespace
88
src/rt/vg/* -whitespace
99
src/rt/linenoise/* -whitespace
1010
src/rt/jemalloc/**/* -whitespace
11+
src/rt/jemalloc/include/jemalloc/jemalloc.h.in text eol=lf
12+
src/rt/jemalloc/include/jemalloc/jemalloc_defs.h.in text eol=lf
13+
src/rt/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in text eol=lf

branches/try2/doc/tutorial-tasks.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ concurrency at this writing:
4747

4848
* [`std::task`] - All code relating to tasks and task scheduling,
4949
* [`std::comm`] - The message passing interface,
50-
* [`extra::comm`] - Additional messaging types based on `std::comm`,
50+
* [`std::pipes`] - The underlying messaging infrastructure,
51+
* [`extra::comm`] - Additional messaging types based on `std::pipes`,
5152
* [`extra::sync`] - More exotic synchronization tools, including locks,
5253
* [`extra::arc`] - The Arc (atomically reference counted) type,
5354
for safely sharing immutable data,
5455
* [`extra::future`] - A type representing values that may be computed concurrently and retrieved at a later time.
5556

5657
[`std::task`]: std/task.html
5758
[`std::comm`]: std/comm.html
59+
[`std::pipes`]: std/pipes.html
5860
[`extra::comm`]: extra/comm.html
5961
[`extra::sync`]: extra/sync.html
6062
[`extra::arc`]: extra/arc.html
@@ -123,7 +125,7 @@ receiving messages. Pipes are low-level communication building-blocks and so
123125
come in a variety of forms, each one appropriate for a different use case. In
124126
what follows, we cover the most commonly used varieties.
125127

126-
The simplest way to create a pipe is to use the `comm::stream`
128+
The simplest way to create a pipe is to use the `pipes::stream`
127129
function to create a `(Port, Chan)` pair. In Rust parlance, a *channel*
128130
is a sending endpoint of a pipe, and a *port* is the receiving
129131
endpoint. Consider the following example of calculating two results

branches/try2/man/rustpkg.1

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This tool is a package manager for applications written in the Rust language,
1111
available at <\fBhttps://www.rust-lang.org\fR>. It provides commands to build,
1212
install and test Rust programs.
1313

14+
\fBrustpkg\fR is still a work in progress. See \fBdoc/rustpkg.md\fR in the Rust source distribution for future plans.
15+
1416
.SH COMMANDS
1517

1618
.TP
@@ -25,10 +27,6 @@ Remove all generated files from the \fIbuild\fR directory in the target's worksp
2527
Builds the specified target, and all its dependencies, and then installs the
2628
build products into the \fIlib\fR and \fIbin\fR directories of their respective
2729
workspaces.
28-
.TP
29-
\fBtest\fR
30-
Builds the module called \fItest.rs\fR in the specified workspace, and then runs
31-
the resulting executable in test mode.
3230

3331
.SS "BUILD COMMAND"
3432

@@ -58,20 +56,9 @@ of the first entry in RUST_PATH.
5856

5957
Examples:
6058

61-
$ rustpkg install git://github.com/mozilla/servo.git#1.2
59+
$ rustpkg install github.com/mozilla/servo.git#1.2
6260
$ rustpkg install rust-glfw
6361

64-
.SS "TEST COMMAND"
65-
66-
rustpkg test \fI[pkgname]\fR
67-
68-
The test command is a shortcut for the command line:
69-
70-
$ rustc --test <filename> -o <filestem>test~ && ./<filestem>test~
71-
72-
Note the suffix on the output filename (the word "test" followed by a tilde),
73-
which should ensure the file does not clash with a user-generated files.
74-
7562
.SH "ENVIRONMENT"
7663

7764
.TP
@@ -186,7 +173,7 @@ rust, rustc, rustdoc, rusti
186173
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
187174

188175
.SH "AUTHOR"
189-
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
176+
See \fBAUTHORS.txt\fR in the Rust source distribution. Graydon Hoare
190177
<\fI[email protected]\fR> is the project leader.
191178

192179
.SH "COPYRIGHT"

branches/try2/mk/platform.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ else
4747
CFG_GCCISH_CFLAGS += -O2
4848
endif
4949

50-
# The soname thing is for supporting a statically linked jemalloc.
51-
# see https://blog.mozilla.org/jseward/2012/06/05/valgrind-now-supports-jemalloc-builds-directly/
5250
ifdef CFG_VALGRIND
5351
CFG_VALGRIND += --error-exitcode=100 \
54-
--soname-synonyms=somalloc=NONE \
5552
--quiet \
5653
--suppressions=$(CFG_SRC_DIR)src/etc/x86.supp \
5754
$(OS_SUPP)

branches/try2/src/libextra/json.rs

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,18 @@ impl serialize::Encoder for Encoder {
135135
_id: uint,
136136
cnt: uint,
137137
f: &fn(&mut Encoder)) {
138-
// enums are encoded as strings or objects
138+
// enums are encoded as strings or vectors:
139139
// Bunny => "Bunny"
140-
// Kangaroo(34,"William") => {"variant": "Kangaroo", "fields": [34,"William"]}
140+
// Kangaroo(34,"William") => ["Kangaroo",[34,"William"]]
141+
141142
if cnt == 0 {
142143
self.wr.write_str(escape_str(name));
143144
} else {
144-
self.wr.write_char('{');
145-
self.wr.write_str("\"variant\"");
146-
self.wr.write_char(':');
145+
self.wr.write_char('[');
147146
self.wr.write_str(escape_str(name));
148147
self.wr.write_char(',');
149-
self.wr.write_str("\"fields\"");
150-
self.wr.write_str(":[");
151148
f(self);
152-
self.wr.write_str("]}");
149+
self.wr.write_char(']');
153150
}
154151
}
155152

@@ -950,20 +947,14 @@ impl serialize::Decoder for Decoder {
950947
debug!("read_enum_variant(names=%?)", names);
951948
let name = match self.stack.pop() {
952949
String(s) => s,
953-
Object(o) => {
954-
let n = match o.find(&~"variant").expect("invalidly encoded json") {
955-
&String(ref s) => s.clone(),
956-
_ => fail!("invalidly encoded json"),
957-
};
958-
match o.find(&~"fields").expect("invalidly encoded json") {
959-
&List(ref l) => {
960-
for field in l.rev_iter() {
961-
self.stack.push(field.clone());
962-
}
963-
},
964-
_ => fail!("invalidly encoded json")
950+
List(list) => {
951+
for v in list.move_rev_iter() {
952+
self.stack.push(v);
953+
}
954+
match self.stack.pop() {
955+
String(s) => s,
956+
value => fail!("invalid variant name: %?", value),
965957
}
966-
n
967958
}
968959
ref json => fail!("invalid variant: %?", *json),
969960
};
@@ -1526,7 +1517,7 @@ mod tests {
15261517
let mut encoder = Encoder(wr);
15271518
animal.encode(&mut encoder);
15281519
},
1529-
~"{\"variant\":\"Frog\",\"fields\":[\"Henry\",349]}"
1520+
~"[\"Frog\",\"Henry\",349]"
15301521
);
15311522
assert_eq!(
15321523
do io::with_str_writer |wr| {
@@ -1930,14 +1921,14 @@ mod tests {
19301921
assert_eq!(value, Dog);
19311922

19321923
let mut decoder =
1933-
Decoder(from_str("{\"variant\":\"Frog\",\"fields\":[\"Henry\",349]}").unwrap());
1924+
Decoder(from_str("[\"Frog\",\"Henry\",349]").unwrap());
19341925
let value: Animal = Decodable::decode(&mut decoder);
19351926
assert_eq!(value, Frog(~"Henry", 349));
19361927
}
19371928
19381929
#[test]
19391930
fn test_decode_map() {
1940-
let s = ~"{\"a\": \"Dog\", \"b\": {\"variant\":\"Frog\",\"fields\":[\"Henry\", 349]}}";
1931+
let s = ~"{\"a\": \"Dog\", \"b\": [\"Frog\", \"Henry\", 349]}";
19411932
let mut decoder = Decoder(from_str(s).unwrap());
19421933
let mut map: TreeMap<~str, Animal> = Decodable::decode(&mut decoder);
19431934

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub struct EncodeParams<'self> {
6060
reexports2: middle::resolve::ExportMap2,
6161
item_symbols: &'self HashMap<ast::NodeId, ~str>,
6262
discrim_symbols: &'self HashMap<ast::NodeId, @str>,
63-
non_inlineable_statics: &'self HashSet<ast::NodeId>,
6463
link_meta: &'self LinkMeta,
6564
cstore: @mut cstore::CStore,
6665
encode_inlined_item: encode_inlined_item<'self>,
@@ -90,7 +89,6 @@ pub struct EncodeContext<'self> {
9089
reexports2: middle::resolve::ExportMap2,
9190
item_symbols: &'self HashMap<ast::NodeId, ~str>,
9291
discrim_symbols: &'self HashMap<ast::NodeId, @str>,
93-
non_inlineable_statics: &'self HashSet<ast::NodeId>,
9492
link_meta: &'self LinkMeta,
9593
cstore: &'self cstore::CStore,
9694
encode_inlined_item: encode_inlined_item<'self>,
@@ -909,9 +907,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
909907
encode_name(ecx, ebml_w, item.ident);
910908
let elt = ast_map::path_pretty_name(item.ident, item.id as u64);
911909
encode_path(ecx, ebml_w, path, elt);
912-
if !ecx.non_inlineable_statics.contains(&item.id) {
913-
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
914-
}
910+
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
915911
ebml_w.end_tag();
916912
}
917913
item_fn(_, purity, _, ref generics, _) => {
@@ -1732,7 +1728,6 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
17321728
encode_inlined_item,
17331729
link_meta,
17341730
reachable,
1735-
non_inlineable_statics,
17361731
_
17371732
} = parms;
17381733
let type_abbrevs = @mut HashMap::new();
@@ -1744,7 +1739,6 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
17441739
reexports2: reexports2,
17451740
item_symbols: item_symbols,
17461741
discrim_symbols: discrim_symbols,
1747-
non_inlineable_statics: non_inlineable_statics,
17481742
link_meta: link_meta,
17491743
cstore: cstore,
17501744
encode_inlined_item: encode_inlined_item,

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,15 @@ fn trans_opt(bcx: @mut Block, o: &Opt) -> opt_result {
324324
return single_result(datumblock.to_result(bcx));
325325
}
326326
lit(ConstLit(lit_id)) => {
327-
let (llval, _) = consts::get_const_val(bcx.ccx(), lit_id);
327+
let llval = consts::get_const_val(bcx.ccx(), lit_id);
328328
return single_result(rslt(bcx, llval));
329329
}
330330
var(disr_val, repr) => {
331331
return adt::trans_case(bcx, repr, disr_val);
332332
}
333333
range(l1, l2) => {
334-
let (l1, _) = consts::const_expr(ccx, l1);
335-
let (l2, _) = consts::const_expr(ccx, l2);
336-
return range_result(rslt(bcx, l1), rslt(bcx, l2));
334+
return range_result(rslt(bcx, consts::const_expr(ccx, l1)),
335+
rslt(bcx, consts::const_expr(ccx, l2)));
337336
}
338337
vec_len(n, vec_len_eq, _) => {
339338
return single_result(rslt(bcx, C_int(ccx, n as int)));

0 commit comments

Comments
 (0)