Skip to content

Commit a92402a

Browse files
committed
---
yaml --- r: 46971 b: refs/heads/try c: 20fd0c5 h: refs/heads/master i: 46969: 07a511c 46967: 5e01573 v: v3
1 parent cc584aa commit a92402a

27 files changed

+155
-133
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: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: dcb98f4097240ade472aea8b33b19dd3ecb4fd51
5+
refs/heads/try: 20fd0c53edd2cc5ef5d413b8698b2c5860aa4926
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/licenseck.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11-
license0 = """// Copyright 2012-2013 The Rust Project Developers. See the
11+
license0 = """\
12+
// Copyright 2012-2013 The Rust Project Developers. See the
1213
// COPYRIGHT file at the top-level directory of this distribution and at
1314
// http://rust-lang.org/COPYRIGHT.
1415
//
@@ -19,7 +20,8 @@
1920
// except according to those terms.
2021
"""
2122

22-
license1 = """// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
23+
license1 = """\
24+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2325
// file at the top-level directory of this distribution and at
2426
// http://rust-lang.org/COPYRIGHT.
2527
//
@@ -30,7 +32,8 @@
3032
// except according to those terms.
3133
"""
3234

33-
license2 = """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
35+
license2 = """\
36+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
3437
// file at the top-level directory of this distribution and at
3538
// http://rust-lang.org/COPYRIGHT.
3639
//
@@ -41,7 +44,8 @@
4144
// except according to those terms.
4245
"""
4346

44-
license3 = """# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
47+
license3 = """\
48+
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
4549
# file at the top-level directory of this distribution and at
4650
# http://rust-lang.org/COPYRIGHT.
4751
#
@@ -52,7 +56,19 @@
5256
# except according to those terms.
5357
"""
5458

55-
licenses = [license0, license1, license2, license3]
59+
license4 = """\
60+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
61+
// file at the top-level directory of this distribution and at
62+
// http://rust-lang.org/COPYRIGHT.
63+
//
64+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
65+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
66+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
67+
// option. This file may not be copied, modified, or distributed
68+
// except according to those terms.
69+
"""
70+
71+
licenses = [license0, license1, license2, license3, license4]
5672

5773
exceptions = [
5874
"rt/rust_android_dummy.cpp", # BSD, chromium

branches/try/src/libcore/hashmap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub mod linear {
159159
pure fn value_for_bucket(&self, idx: uint) -> &self/V {
160160
match self.buckets[idx] {
161161
Some(ref bkt) => &bkt.value,
162-
None => die!(~"LinearMap::find: internal logic error"),
162+
None => fail!(~"LinearMap::find: internal logic error"),
163163
}
164164
}
165165
@@ -373,7 +373,7 @@ pub mod linear {
373373
374374
let hash = k.hash_keyed(self.k0, self.k1) as uint;
375375
let idx = match self.bucket_for_key_with_hash(hash, &k) {
376-
TableFull => die!(~"Internal logic error"),
376+
TableFull => fail!(~"Internal logic error"),
377377
FoundEntry(idx) => idx,
378378
FoundHole(idx) => {
379379
self.buckets[idx] = Some(Bucket{hash: hash, key: k,
@@ -403,7 +403,7 @@ pub mod linear {
403403
404404
let hash = k.hash_keyed(self.k0, self.k1) as uint;
405405
let idx = match self.bucket_for_key_with_hash(hash, &k) {
406-
TableFull => die!(~"Internal logic error"),
406+
TableFull => fail!(~"Internal logic error"),
407407
FoundEntry(idx) => idx,
408408
FoundHole(idx) => {
409409
let v = f(&k);

branches/try/src/libcore/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ pub fn last_os_error() -> ~str {
849849
let err = strerror_r(errno() as c_int, &buf[0],
850850
TMPBUF_SZ as size_t);
851851
if err < 0 {
852-
die!(~"strerror_r failure");
852+
fail!(~"strerror_r failure");
853853
}
854854
855855
str::raw::from_c_str(&buf[0])
@@ -887,7 +887,7 @@ pub fn last_os_error() -> ~str {
887887
&mut buf[0], TMPBUF_SZ as DWORD,
888888
ptr::null());
889889
if res == 0 {
890-
die!(fmt!("[%?] FormatMessage failure", errno()));
890+
fail!(fmt!("[%?] FormatMessage failure", errno()));
891891
}
892892
893893
str::raw::from_c_str(&buf[0])

branches/try/src/libcore/private/exchange_alloc.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use c_malloc = libc::malloc;
1414
use c_free = libc::free;
1515
use managed::raw::{BoxHeaderRepr, BoxRepr};
1616
use cast::transmute;
17-
use ptr::{set_memory, null};
17+
use ptr::null;
1818
use intrinsic::TyDesc;
1919

2020
pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
@@ -25,10 +25,6 @@ pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
2525
let p = c_malloc(total_size as size_t);
2626
assert p.is_not_null();
2727

28-
// FIXME #4761: Would be very nice to not memset all allocations
29-
let p: *mut u8 = transmute(p);
30-
set_memory(p, 0, total_size);
31-
3228
// FIXME #3475: Converting between our two different tydesc types
3329
let td: *TyDesc = transmute(td);
3430

branches/try/src/libcore/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub unsafe fn rt_fail_borrowed() {
6262
}
6363
}
6464

65-
// FIXME #4942: Make these signatures agree with exchange_alloc's signatures
65+
// XXX: Make these signatures agree with exchange_alloc's signatures
6666
#[rt(exchange_malloc)]
6767
#[lang="exchange_malloc"]
6868
pub unsafe fn rt_exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {

branches/try/src/libcore/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ pub fn start_program(prog: &str, args: &[~str]) -> Program {
250250
r: ProgRepr,
251251
drop {
252252
unsafe {
253-
// FIXME #4943: This is bad.
253+
// XXX: This is bad.
254254
destroy_repr(cast::transmute(&self.r));
255255
}
256256
}

branches/try/src/librustc/middle/check_const.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use middle::ty;
1616
use middle::typeck;
1717
use util::ppaux;
1818

19-
use core::dvec::DVec;
2019
use core::option;
2120
use std::oldmap::HashMap;
2221
use syntax::ast::*;
@@ -212,20 +211,20 @@ pub fn check_item_recursion(sess: Session,
212211
ast_map: ast_map::map,
213212
def_map: resolve::DefMap,
214213
it: @item) {
215-
type env = {
214+
struct env {
216215
root_it: @item,
217216
sess: Session,
218217
ast_map: ast_map::map,
219218
def_map: resolve::DefMap,
220-
idstack: @DVec<node_id>,
221-
};
219+
idstack: @mut ~[node_id]
220+
}
222221

223-
let env = {
222+
let env = env {
224223
root_it: it,
225224
sess: sess,
226225
ast_map: ast_map,
227226
def_map: def_map,
228-
idstack: @DVec()
227+
idstack: @mut ~[]
229228
};
230229

231230
let visitor = visit::mk_vt(@visit::Visitor {
@@ -236,12 +235,12 @@ pub fn check_item_recursion(sess: Session,
236235
(visitor.visit_item)(it, env, visitor);
237236

238237
fn visit_item(it: @item, &&env: env, v: visit::vt<env>) {
239-
if (*env.idstack).contains(&(it.id)) {
238+
if env.idstack.contains(&(it.id)) {
240239
env.sess.span_fatal(env.root_it.span, ~"recursive constant");
241240
}
242-
(*env.idstack).push(it.id);
241+
env.idstack.push(it.id);
243242
visit::visit_item(it, env, v);
244-
(*env.idstack).pop();
243+
env.idstack.pop();
245244
}
246245

247246
fn visit_expr(e: @expr, &&env: env, v: visit::vt<env>) {

branches/try/src/libstd/json.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,21 +1284,21 @@ mod tests {
12841284
// Should they be in their own crate?
12851285
pub pure fn check_equal_ptr<T : cmp::Eq> (given : &T, expected: &T) {
12861286
if !((given == expected) && (expected == given )) {
1287-
die!(fmt!("given %?, expected %?",given,expected));
1287+
fail!(fmt!("given %?, expected %?",given,expected));
12881288
}
12891289
}
12901290

12911291
pub pure fn check_equal<T : cmp::Eq> (given : T, expected: T) {
12921292
if !((given == expected) && (expected == given )) {
1293-
die!(fmt!("given %?, expected %?",given,expected));
1293+
fail!(fmt!("given %?, expected %?",given,expected));
12941294
}
12951295
}
12961296

12971297
// testing both auto_encode's calling patterns
12981298
// and json... not sure where to put these tests.
12991299
#[test]
13001300
fn test_write_enum () {
1301-
let bw = @io::BytesWriter {bytes: dvec::DVec(), pos: 0};
1301+
let bw = @io::BytesWriter();
13021302
let bww : @io::Writer = (bw as @io::Writer);
13031303
let encoder = (@Encoder(bww) as @serialize::Encoder);
13041304
do encoder.emit_enum(~"animal") {
@@ -1319,7 +1319,7 @@ mod tests {
13191319
13201320
#[test]
13211321
fn test_write_some () {
1322-
let bw = @io::BytesWriter {bytes: dvec::DVec(), pos: 0};
1322+
let bw = @io::BytesWriter();
13231323
let bww : @io::Writer = (bw as @io::Writer);
13241324
let encoder = (@Encoder(bww) as @serialize::Encoder);
13251325
do encoder.emit_enum(~"Option") {
@@ -1335,7 +1335,7 @@ mod tests {
13351335

13361336
#[test]
13371337
fn test_write_none () {
1338-
let bw = @io::BytesWriter {bytes: dvec::DVec(), pos: 0};
1338+
let bw = @io::BytesWriter();
13391339
let bww : @io::Writer = (bw as @io::Writer);
13401340
let encoder = (@Encoder(bww) as @serialize::Encoder);
13411341
do encoder.emit_enum(~"Option") {

branches/try/src/libstd/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub fn test_main_static(args: &[~str], tests: &[TestDescAndFn]) {
143143
TestDescAndFn { testfn: StaticBenchFn(f), desc: copy t.desc },
144144
145145
_ => {
146-
die! (~"non-static tests passed to test::test_main_static");
146+
fail!(~"non-static tests passed to test::test_main_static");
147147
}
148148
}
149149
};

branches/try/src/libstd/uv_ll.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ pub mod test {
12531253
as *request_wrapper;
12541254
let buf_base = get_base_from_buf(buf);
12551255
let buf_len = get_len_from_buf(buf);
1256-
let bytes = vec::from_buf(buf_base, buf_len as uint);
1256+
let bytes = vec::from_buf(buf_base, nread as uint);
12571257
let read_chan = (*client_data).read_chan.clone();
12581258
let msg_from_server = str::from_bytes(bytes);
12591259
read_chan.send(msg_from_server);
@@ -1445,15 +1445,15 @@ pub mod test {
14451445
buf_base as uint,
14461446
buf_len as uint,
14471447
nread));
1448-
let bytes = vec::from_buf(buf_base, buf_len);
1448+
let bytes = vec::from_buf(buf_base, nread as uint);
14491449
let request_str = str::from_bytes(bytes);
14501450

14511451
let client_data = get_data_for_uv_handle(
14521452
client_stream_ptr as *libc::c_void) as *tcp_server_data;
14531453

14541454
let server_kill_msg = (*client_data).server_kill_msg;
14551455
let write_req = (*client_data).server_write_req;
1456-
if (str::contains(request_str, server_kill_msg)) {
1456+
if str::contains(request_str, server_kill_msg) {
14571457
log(debug, ~"SERVER: client req contains kill_msg!");
14581458
log(debug, ~"SERVER: sending response to client");
14591459
read_stop(client_stream_ptr);

branches/try/src/libstd/workcache.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use serialize::{Encoder, Encodable, Decoder, Decodable};
1616
use sort;
1717

1818
use core::cmp;
19-
use core::dvec;
2019
use core::either::{Either, Left, Right};
2120
use core::io;
2221
use core::option;
@@ -141,13 +140,12 @@ type WorkMap = LinearMap<WorkKey, ~str>;
141140

142141
pub impl<S: Encoder> WorkMap: Encodable<S> {
143142
fn encode(&self, s: &S) {
144-
let d = dvec::DVec();
143+
let mut d = ~[];
145144
for self.each |&(k, v)| {
146145
d.push((copy *k, copy *v))
147146
}
148-
let mut v = d.get();
149-
sort::tim_sort(v);
150-
v.encode(s)
147+
sort::tim_sort(d);
148+
d.encode(s)
151149
}
152150
}
153151

0 commit comments

Comments
 (0)