librustc: Make methods private if the impl is private

This commit is contained in:
Patrick Walton 2013-02-27 11:20:50 -08:00
parent 107bf96ff0
commit 09a2b4e599
3 changed files with 63 additions and 13 deletions

View file

@ -92,17 +92,6 @@ priv impl<A> DVec<A> {
}
}
#[inline(always)]
fn check_out<B>(f: &fn(v: ~[A]) -> B) -> B {
unsafe {
let mut data = cast::reinterpret_cast(&null::<()>());
data <-> self.data;
let data_ptr: *() = cast::reinterpret_cast(&data);
if data_ptr.is_null() { fail!(~"Recursive use of dvec"); }
return f(data);
}
}
#[inline(always)]
fn give_back(data: ~[A]) {
unsafe {
@ -118,6 +107,18 @@ priv impl<A> DVec<A> {
// almost nothing works without the copy bound due to limitations
// around closures.
pub impl<A> DVec<A> {
// FIXME (#3758): This should not need to be public.
#[inline(always)]
fn check_out<B>(f: &fn(v: ~[A]) -> B) -> B {
unsafe {
let mut data = cast::reinterpret_cast(&null::<()>());
data <-> self.data;
let data_ptr: *() = cast::reinterpret_cast(&data);
if data_ptr.is_null() { fail!(~"Recursive use of dvec"); }
return f(data);
}
}
/// Reserves space for N elements
fn reserve(count: uint) {
vec::reserve(&mut self.data, count)