diff options
| author | bors <bors@rust-lang.org> | 2014-06-28 20:11:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-28 20:11:34 +0000 |
| commit | fe8bc178014dc2c5badd8443329c179478a40cc4 (patch) | |
| tree | b5bfc8f15cc996fe751306924595f81bcc558a27 /src/libsync | |
| parent | de337f3ddfbef800a8cf731e0b593e341af1e3e5 (diff) | |
| parent | 0dfc90ab15475aa64bea393671463a8e9784ae3f (diff) | |
| download | rust-fe8bc178014dc2c5badd8443329c179478a40cc4.tar.gz rust-fe8bc178014dc2c5badd8443329c179478a40cc4.zip | |
auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwalton
This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.
Diffstat (limited to 'src/libsync')
| -rw-r--r-- | src/libsync/deque.rs | 11 | ||||
| -rw-r--r-- | src/libsync/mpsc_intrusive.rs | 2 | ||||
| -rw-r--r-- | src/libsync/raw.rs | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/libsync/deque.rs b/src/libsync/deque.rs index 18608a0a370..cdd030ac34a 100644 --- a/src/libsync/deque.rs +++ b/src/libsync/deque.rs @@ -137,7 +137,7 @@ pub struct BufferPool<T> { /// 2. We can certainly avoid bounds checks using *T instead of Vec<T>, although /// LLVM is probably pretty good at doing this already. struct Buffer<T> { - storage: *T, + storage: *const T, log_size: uint, } @@ -354,7 +354,7 @@ impl<T: Send> Buffer<T> { let size = buffer_alloc_size::<T>(log_size); let buffer = allocate(size, min_align_of::<T>()); Buffer { - storage: buffer as *T, + storage: buffer as *const T, log_size: log_size, } } @@ -364,7 +364,9 @@ impl<T: Send> Buffer<T> { // Apparently LLVM cannot optimize (foo % (1 << bar)) into this implicitly fn mask(&self) -> int { (1 << self.log_size) - 1 } - unsafe fn elem(&self, i: int) -> *T { self.storage.offset(i & self.mask()) } + unsafe fn elem(&self, i: int) -> *const T { + self.storage.offset(i & self.mask()) + } // This does not protect against loading duplicate values of the same cell, // nor does this clear out the contents contained within. Hence, this is a @@ -610,7 +612,8 @@ mod tests { let s = s.clone(); let unique_box = box AtomicUint::new(0); let thread_box = unsafe { - *mem::transmute::<&Box<AtomicUint>, **mut AtomicUint>(&unique_box) + *mem::transmute::<&Box<AtomicUint>, + *const *mut AtomicUint>(&unique_box) }; (Thread::start(proc() { unsafe { diff --git a/src/libsync/mpsc_intrusive.rs b/src/libsync/mpsc_intrusive.rs index 6af733ddb4b..2b6886ab7f4 100644 --- a/src/libsync/mpsc_intrusive.rs +++ b/src/libsync/mpsc_intrusive.rs @@ -104,7 +104,7 @@ impl<T: Send> Queue<T> { mem::transmute(&self.stub) }; let mut next = (*tail).next(atomics::Relaxed); - if tail as uint == &self.stub as *DummyNode as uint { + if tail as uint == &self.stub as *const DummyNode as uint { if next.is_null() { return None; } diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs index 35865e65612..26cc0b2c6a2 100644 --- a/src/libsync/raw.rs +++ b/src/libsync/raw.rs @@ -890,7 +890,7 @@ mod tests { let x2 = x.clone(); let mut sharedstate = box 0; { - let ptr: *int = &*sharedstate; + let ptr: *const int = &*sharedstate; task::spawn(proc() { let sharedstate: &mut int = unsafe { mem::transmute(ptr) }; |
