1
Fork 0

new borrow checker (mass squash)

This commit is contained in:
Niko Matsakis 2013-03-15 15:24:24 -04:00
parent b5a7e8b353
commit a896440ca1
172 changed files with 6475 additions and 4303 deletions

View file

@ -419,26 +419,26 @@ pub struct RWReadMode<'self, T> {
pub impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
/// Access the pre-downgrade RWARC in write mode.
fn write<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
fn write<U>(&mut self, blk: &fn(x: &mut T) -> U) -> U {
match *self {
RWWriteMode {
data: ref data,
data: &ref mut data,
token: ref token,
poison: _
} => {
do token.write {
blk(&mut **data)
blk(data)
}
}
}
}
/// Access the pre-downgrade RWARC in write mode with a condvar.
fn write_cond<'x, 'c, U>(&self,
fn write_cond<'x, 'c, U>(&mut self,
blk: &fn(x: &'x mut T, c: &'c Condvar) -> U)
-> U {
match *self {
RWWriteMode {
data: ref data,
data: &ref mut data,
token: ref token,
poison: ref poison
} => {
@ -449,7 +449,7 @@ pub impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
failed: &mut *poison.failed,
cond: cond
};
blk(&mut **data, &cvar)
blk(data, &cvar)
}
}
}