Skip to content

Commit a94ed9e

Browse files
committed
---
yaml --- r: 59359 b: refs/heads/snap-stage3 c: a5891be h: refs/heads/master i: 59357: 2110ea5 59355: deb80c7 59351: 9e90866 59343: dbd6f4a 59327: 0fce788 v: v3
1 parent f3c729d commit a94ed9e

File tree

253 files changed

+5558
-14726
lines changed

Some content is hidden

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

253 files changed

+5558
-14726
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0ef4e860da1fb755b9fff5d1b30bee3974514ea2
4+
refs/heads/snap-stage3: a5891bebc132d4c373a5a5ffc93ba1bea2e8beb5
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ endif
110110
ifdef SAVE_TEMPS
111111
CFG_RUSTC_FLAGS += --save-temps
112112
endif
113-
ifdef ASM_COMMENTS
114-
CFG_RUSTC_FLAGS += -z asm-comments
115-
endif
116113
ifdef TIME_PASSES
117114
CFG_RUSTC_FLAGS += -Z time-passes
118115
endif

branches/snap-stage3/src/libcore/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn empty_cell<T>() -> Cell<T> {
4242
pub impl<T> Cell<T> {
4343
/// Yields the value, failing if the cell is empty.
4444
fn take(&self) -> T {
45-
let self = unsafe { transmute_mut(self) };
45+
let mut self = unsafe { transmute_mut(self) };
4646
if self.is_empty() {
4747
fail!(~"attempt to take an empty cell");
4848
}
@@ -54,7 +54,7 @@ pub impl<T> Cell<T> {
5454
5555
/// Returns the value, failing if the cell is full.
5656
fn put_back(&self, value: T) {
57-
let self = unsafe { transmute_mut(self) };
57+
let mut self = unsafe { transmute_mut(self) };
5858
if !self.is_empty() {
5959
fail!(~"attempt to put a value back into a full cell");
6060
}

branches/snap-stage3/src/libcore/cleanup.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use ptr::mut_null;
1515
use repr::BoxRepr;
1616
use sys::TypeDesc;
1717
use cast::transmute;
18-
#[cfg(notest)] use unstable::lang::clear_task_borrow_list;
1918

2019
#[cfg(notest)] use ptr::to_unsafe_ptr;
2120

@@ -167,8 +166,7 @@ fn debug_mem() -> bool {
167166
#[cfg(notest)]
168167
#[lang="annihilate"]
169168
pub unsafe fn annihilate() {
170-
use unstable::lang::{local_free};
171-
use unstable::lang;
169+
use unstable::lang::local_free;
172170
use io::WriterUtil;
173171
use io;
174172
use libc;
@@ -181,21 +179,15 @@ pub unsafe fn annihilate() {
181179
n_bytes_freed: 0
182180
};
183181

184-
// Quick hack: we need to free this list upon task exit, and this
185-
// is a convenient place to do it.
186-
clear_task_borrow_list();
187-
188182
// Pass 1: Make all boxes immortal.
189183
//
190184
// In this pass, nothing gets freed, so it does not matter whether
191185
// we read the next field before or after the callback.
192186
for each_live_alloc(true) |box, uniq| {
193187
stats.n_total_boxes += 1;
194188
if uniq {
195-
lang::debug_mem("Managed-uniq: ", &*box);
196189
stats.n_unique_boxes += 1;
197190
} else {
198-
lang::debug_mem("Immortalizing: ", &*box);
199191
(*box).header.ref_count = managed::raw::RC_IMMORTAL;
200192
}
201193
}
@@ -207,13 +199,9 @@ pub unsafe fn annihilate() {
207199
// callback, as the original value may have been freed.
208200
for each_live_alloc(false) |box, uniq| {
209201
if !uniq {
210-
lang::debug_mem("Invoking tydesc/glue on: ", &*box);
211202
let tydesc: *TypeDesc = transmute(copy (*box).header.type_desc);
212203
let drop_glue: DropGlue = transmute(((*tydesc).drop_glue, 0));
213-
lang::debug_mem("Box data: ", &(*box).data);
214-
lang::debug_mem("Type descriptor: ", tydesc);
215204
drop_glue(to_unsafe_ptr(&tydesc), transmute(&(*box).data));
216-
lang::debug_mem("Dropped ", &*box);
217205
}
218206
}
219207

@@ -225,7 +213,6 @@ pub unsafe fn annihilate() {
225213
// not be valid after.
226214
for each_live_alloc(true) |box, uniq| {
227215
if !uniq {
228-
lang::debug_mem("About to free: ", &*box);
229216
stats.n_bytes_freed +=
230217
(*((*box).header.type_desc)).size
231218
+ sys::size_of::<BoxRepr>();

branches/snap-stage3/src/libcore/cmp.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ totaleq_impl!(uint)
6666

6767
totaleq_impl!(char)
6868

69+
/// Trait for testing approximate equality
70+
pub trait ApproxEq<Eps> {
71+
fn approx_epsilon() -> Eps;
72+
fn approx_eq(&self, other: &Self) -> bool;
73+
fn approx_eq_eps(&self, other: &Self, approx_epsilon: &Eps) -> bool;
74+
}
75+
6976
#[deriving(Clone, Eq)]
7077
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
7178

branches/snap-stage3/src/libcore/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ impl<T: Owned> Selectable for Port<T> {
205205
fn header(&self) -> *PacketHeader {
206206
unsafe {
207207
match self.endp {
208-
Some(ref endp) => endp.header(),
209-
None => fail!(~"peeking empty stream")
208+
Some(ref endp) => endp.header(),
209+
None => fail!(~"peeking empty stream")
210210
}
211211
}
212212
}

branches/snap-stage3/src/libcore/flate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ pub mod rustrt {
2828
pub extern {
2929
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
3030
src_buf_len: size_t,
31-
pout_len: *mut size_t,
31+
pout_len: *size_t,
3232
flags: c_int)
3333
-> *c_void;
3434

3535
unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
3636
src_buf_len: size_t,
37-
pout_len: *mut size_t,
37+
pout_len: *size_t,
3838
flags: c_int)
3939
-> *c_void;
4040
}
@@ -52,11 +52,11 @@ pub fn deflate_bytes(bytes: &const [u8]) -> ~[u8] {
5252
let res =
5353
rustrt::tdefl_compress_mem_to_heap(b as *c_void,
5454
len as size_t,
55-
&mut outsz,
55+
&outsz,
5656
lz_norm);
5757
assert!(res as int != 0);
5858
let out = vec::raw::from_buf_raw(res as *u8,
59-
outsz as uint);
59+
outsz as uint);
6060
libc::free(res);
6161
out
6262
}
@@ -66,11 +66,11 @@ pub fn deflate_bytes(bytes: &const [u8]) -> ~[u8] {
6666
pub fn inflate_bytes(bytes: &const [u8]) -> ~[u8] {
6767
do vec::as_const_buf(bytes) |b, len| {
6868
unsafe {
69-
let mut outsz : size_t = 0;
69+
let outsz : size_t = 0;
7070
let res =
7171
rustrt::tinfl_decompress_mem_to_heap(b as *c_void,
7272
len as size_t,
73-
&mut outsz,
73+
&outsz,
7474
0);
7575
assert!(res as int != 0);
7676
let out = vec::raw::from_buf_raw(res as *u8,

branches/snap-stage3/src/libcore/hashmap.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use rand;
2525
use uint;
2626
use vec;
2727
use util::unreachable;
28-
use kinds::Copy;
2928

3029
static INITIAL_CAPACITY: uint = 32u; // 2^5
3130

@@ -530,18 +529,6 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
530529
}
531530
}
532531

533-
pub impl<K: Hash + Eq, V: Copy> HashMap<K, V> {
534-
/// Like `find`, but returns a copy of the value.
535-
fn find_copy(&self, k: &K) -> Option<V> {
536-
self.find(k).map_consume(|v| copy *v)
537-
}
538-
539-
/// Like `get`, but returns a copy of the value.
540-
fn get_copy(&self, k: &K) -> V {
541-
copy *self.get(k)
542-
}
543-
}
544-
545532
impl<K:Hash + Eq,V:Eq> Eq for HashMap<K, V> {
546533
fn eq(&self, other: &HashMap<K, V>) -> bool {
547534
if self.len() != other.len() { return false; }

branches/snap-stage3/src/libcore/io.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ pub enum WriterType { Screen, File }
10221022
pub trait Writer {
10231023
10241024
/// Write all of the given bytes.
1025-
fn write(&self, v: &[u8]);
1025+
fn write(&self, v: &const [u8]);
10261026
10271027
/// Move the current position within the stream. The second parameter
10281028
/// determines the position that the first parameter is relative to.
@@ -1039,23 +1039,23 @@ pub trait Writer {
10391039
}
10401040
10411041
impl Writer for @Writer {
1042-
fn write(&self, v: &[u8]) { self.write(v) }
1042+
fn write(&self, v: &const [u8]) { self.write(v) }
10431043
fn seek(&self, a: int, b: SeekStyle) { self.seek(a, b) }
10441044
fn tell(&self) -> uint { self.tell() }
10451045
fn flush(&self) -> int { self.flush() }
10461046
fn get_type(&self) -> WriterType { self.get_type() }
10471047
}
10481048
10491049
impl<W:Writer,C> Writer for Wrapper<W, C> {
1050-
fn write(&self, bs: &[u8]) { self.base.write(bs); }
1050+
fn write(&self, bs: &const [u8]) { self.base.write(bs); }
10511051
fn seek(&self, off: int, style: SeekStyle) { self.base.seek(off, style); }
10521052
fn tell(&self) -> uint { self.base.tell() }
10531053
fn flush(&self) -> int { self.base.flush() }
10541054
fn get_type(&self) -> WriterType { File }
10551055
}
10561056
10571057
impl Writer for *libc::FILE {
1058-
fn write(&self, v: &[u8]) {
1058+
fn write(&self, v: &const [u8]) {
10591059
unsafe {
10601060
do vec::as_const_buf(v) |vbuf, len| {
10611061
let nout = libc::fwrite(vbuf as *c_void,
@@ -1105,7 +1105,7 @@ pub fn FILE_writer(f: *libc::FILE, cleanup: bool) -> @Writer {
11051105
}
11061106

11071107
impl Writer for fd_t {
1108-
fn write(&self, v: &[u8]) {
1108+
fn write(&self, v: &const [u8]) {
11091109
unsafe {
11101110
let mut count = 0u;
11111111
do vec::as_const_buf(v) |vbuf, len| {
@@ -1262,7 +1262,7 @@ pub fn u64_to_be_bytes<T>(n: u64, size: uint,
12621262
}
12631263
}
12641264

1265-
pub fn u64_from_be_bytes(data: &[u8],
1265+
pub fn u64_from_be_bytes(data: &const [u8],
12661266
start: uint,
12671267
size: uint)
12681268
-> u64 {
@@ -1497,7 +1497,7 @@ pub struct BytesWriter {
14971497
}
14981498
14991499
impl Writer for BytesWriter {
1500-
fn write(&self, v: &[u8]) {
1500+
fn write(&self, v: &const [u8]) {
15011501
let v_len = v.len();
15021502
let bytes_len = vec::uniq_len(&const self.bytes);
15031503

branches/snap-stage3/src/libcore/libc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ pub mod types {
268268
pub type ssize_t = i32;
269269
}
270270
pub mod posix01 {
271-
use libc::types::os::arch::c95::{c_short, c_long, time_t};
271+
use libc::types::os::arch::c95::{c_int, c_short, c_long,
272+
time_t};
272273
use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
273274
use libc::types::os::arch::posix88::{mode_t, off_t};
274275
use libc::types::os::arch::posix88::{uid_t};

0 commit comments

Comments
 (0)