Skip to content

Commit 74ff6cc

Browse files
committed
---
yaml --- r: 72703 b: refs/heads/dist-snap c: 502817a h: refs/heads/master i: 72701: 75a6972 72699: 49f2475 72695: 3a1e6b0 72687: 45c9845 72671: 35b4603 72639: d57e2a2 72575: 73a48dd 72447: 0489a0d 72191: 82089ba 71679: 4addab6 v: v3
1 parent 4aff77d commit 74ff6cc

File tree

240 files changed

+5169
-14359
lines changed

Some content is hidden

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

240 files changed

+5169
-14359
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 84f7ecce5c8b727309d0d48e84a965a5a3437fd1
10+
refs/heads/dist-snap: 502817a9c19752cafcc270d9d3e5a5104ce2eac9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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};

branches/dist-snap/src/libcore/os.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ pub fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int {
352352
}
353353
}
354354

355-
pub struct Pipe { in: c_int, out: c_int }
355+
pub struct Pipe { mut in: c_int, mut out: c_int }
356356

357357
#[cfg(unix)]
358358
pub fn pipe() -> Pipe {
359359
unsafe {
360360
let mut fds = Pipe {in: 0 as c_int,
361-
out: 0 as c_int };
361+
out: 0 as c_int };
362362
assert!((libc::pipe(&mut fds.in) == (0 as c_int)));
363363
return Pipe {in: fds.in, out: fds.out};
364364
}
@@ -1025,10 +1025,10 @@ pub fn last_os_error() -> ~str {
10251025
#[cfg(target_os = "macos")]
10261026
#[cfg(target_os = "android")]
10271027
#[cfg(target_os = "freebsd")]
1028-
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int {
1028+
fn strerror_r(errnum: c_int, buf: *c_char, buflen: size_t) -> c_int {
10291029
#[nolink]
10301030
extern {
1031-
unsafe fn strerror_r(errnum: c_int, buf: *mut c_char,
1031+
unsafe fn strerror_r(errnum: c_int, buf: *c_char,
10321032
buflen: size_t) -> c_int;
10331033
}
10341034
unsafe {
@@ -1040,10 +1040,10 @@ pub fn last_os_error() -> ~str {
10401040
// and requires macros to instead use the POSIX compliant variant.
10411041
// So we just use __xpg_strerror_r which is always POSIX compliant
10421042
#[cfg(target_os = "linux")]
1043-
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int {
1043+
fn strerror_r(errnum: c_int, buf: *c_char, buflen: size_t) -> c_int {
10441044
#[nolink]
10451045
extern {
1046-
unsafe fn __xpg_strerror_r(errnum: c_int, buf: *mut c_char,
1046+
unsafe fn __xpg_strerror_r(errnum: c_int, buf: *c_char,
10471047
buflen: size_t) -> c_int;
10481048
}
10491049
unsafe {
@@ -1053,7 +1053,7 @@ pub fn last_os_error() -> ~str {
10531053
10541054
let mut buf = [0 as c_char, ..TMPBUF_SZ];
10551055
unsafe {
1056-
let err = strerror_r(errno() as c_int, &mut buf[0],
1056+
let err = strerror_r(errno() as c_int, &buf[0],
10571057
TMPBUF_SZ as size_t);
10581058
if err < 0 {
10591059
fail!(~"strerror_r failure");

branches/dist-snap/src/libcore/ptr.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,34 +296,34 @@ impl<T> Ord for *const T {
296296
297297
// Equality for region pointers
298298
#[cfg(notest)]
299-
impl<'self,T:Eq> Eq for &'self T {
299+
impl<'self,T:Eq> Eq for &'self const T {
300300
#[inline(always)]
301-
fn eq(&self, other: & &'self T) -> bool {
301+
fn eq(&self, other: & &'self const T) -> bool {
302302
return *(*self) == *(*other);
303303
}
304304
#[inline(always)]
305-
fn ne(&self, other: & &'self T) -> bool {
305+
fn ne(&self, other: & &'self const T) -> bool {
306306
return *(*self) != *(*other);
307307
}
308308
}
309309
310310
// Comparison for region pointers
311311
#[cfg(notest)]
312-
impl<'self,T:Ord> Ord for &'self T {
312+
impl<'self,T:Ord> Ord for &'self const T {
313313
#[inline(always)]
314-
fn lt(&self, other: & &'self T) -> bool {
314+
fn lt(&self, other: & &'self const T) -> bool {
315315
*(*self) < *(*other)
316316
}
317317
#[inline(always)]
318-
fn le(&self, other: & &'self T) -> bool {
318+
fn le(&self, other: & &'self const T) -> bool {
319319
*(*self) <= *(*other)
320320
}
321321
#[inline(always)]
322-
fn ge(&self, other: & &'self T) -> bool {
322+
fn ge(&self, other: & &'self const T) -> bool {
323323
*(*self) >= *(*other)
324324
}
325325
#[inline(always)]
326-
fn gt(&self, other: & &'self T) -> bool {
326+
fn gt(&self, other: & &'self const T) -> bool {
327327
*(*self) > *(*other)
328328
}
329329
}

branches/dist-snap/src/libcore/rt/env.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ pub struct Environment {
3131
argc: c_int,
3232
/// The argv value passed to main
3333
argv: **c_char,
34-
/// Print GC debugging info (true if env var RUST_DEBUG_MEM is set)
35-
debug_mem: bool,
36-
/// Print GC debugging info (true if env var RUST_DEBUG_BORROW is set)
37-
debug_borrow: bool,
34+
/// Print GC debugging info
35+
debug_mem: bool
3836
}
3937

4038
/// Get the global environment settings

branches/dist-snap/src/libcore/rt/sched/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ pub impl Scheduler {
137137
/// Called by a running task to end execution, after which it will
138138
/// be recycled by the scheduler for reuse in a new task.
139139
fn terminate_current_task(~self) {
140+
let mut self = self;
140141
assert!(self.in_task_context());
141142

142143
rtdebug!("ending running task");
@@ -152,6 +153,7 @@ pub impl Scheduler {
152153
}
153154

154155
fn schedule_new_task(~self, task: ~Task) {
156+
let mut self = self;
155157
assert!(self.in_task_context());
156158

157159
do self.switch_running_tasks_and_then(task) |last_task| {
@@ -303,7 +305,7 @@ pub impl Scheduler {
303305
unsafe {
304306
let last_task = transmute::<Option<&Task>, Option<&mut Task>>(last_task);
305307
let last_task_context = match last_task {
306-
Some(t) => Some(&mut t.saved_context), None => None
308+
Some(ref t) => Some(&mut t.saved_context), None => None
307309
};
308310
let next_task_context = match self.current_task {
309311
Some(ref mut t) => Some(&mut t.saved_context), None => None

0 commit comments

Comments
 (0)