Assert that self.has_aux() in rcu before returning aux

This commit is contained in:
Patrick Walton 2012-05-10 15:15:19 -07:00
parent 48034368b5
commit 4938e1733c

View file

@ -56,7 +56,7 @@ impl reader_methods<T:send,A> for handle<T,A> {
}
fn aux<U>(f: fn(A) -> U) -> U unsafe {
// warning: do not use if has_aux() is false!
assert self.has_aux();
f(*self.rd_aux())
}
}
@ -240,4 +240,4 @@ mod test {
assert ferdinand.rd(read_characteristic) == iter1 * iter2;
}
}
}