Skip to content

Commit de7d143

Browse files
committed
Fix existing privacy/visibility violations
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
1 parent 439e277 commit de7d143

Some content is hidden

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

43 files changed

+168
-111
lines changed

src/libextra/container.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub trait Deque<T> : Mutable {
4040
}
4141

4242
#[cfg(test)]
43-
mod bench {
43+
pub mod bench {
4444
use std::container::MutableMap;
4545
use std::{vec, rand};
4646
use std::rand::Rng;

src/libextra/crypto/cryptoutil.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl <T: FixedBuffer> StandardPadding for T {
346346

347347

348348
#[cfg(test)]
349-
mod test {
349+
pub mod test {
350350
use std::rand::{IsaacRng, Rng};
351351
use std::vec;
352352

src/libextra/stats.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ pub trait Stats {
101101

102102
/// Extracted collection of all the summary statistics of a sample set.
103103
#[deriving(Clone, Eq)]
104-
struct Summary {
104+
#[allow(missing_doc)]
105+
pub struct Summary {
105106
sum: f64,
106107
min: f64,
107108
max: f64,

src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ use syntax::ast_util::id_range;
3131
use syntax::codemap::Span;
3232
use syntax::print::pprust;
3333
use syntax::visit;
34-
use syntax::visit::Visitor;
35-
use syntax::ast::{Expr, fn_kind, fn_decl, Block, NodeId, Stmt, Pat, Local};
34+
use syntax::visit::{Visitor, fn_kind};
35+
use syntax::ast::{Expr, fn_decl, Block, NodeId, Stmt, Pat, Local};
3636

3737
mod lifetime;
3838
mod restrictions;

src/librustc/middle/trans/datum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl Datum {
581581

582582
if !header && !ty::type_contents(bcx.tcx(), content_ty).contains_managed() {
583583
let ptr = self.to_value_llval(bcx);
584-
let ty = type_of(bcx.ccx(), content_ty);
584+
let ty = type_of::type_of(bcx.ccx(), content_ty);
585585
let body = PointerCast(bcx, ptr, ty.ptr_to());
586586
Datum {val: body, ty: content_ty, mode: ByRef(ZeroMem)}
587587
} else { // has a header

src/librustc/middle/trans/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
10261026
// which may not be equal to the enum's type for
10271027
// non-C-like enums.
10281028
let val = base::get_item_val(bcx.ccx(), did.node);
1029-
let pty = type_of(bcx.ccx(), const_ty).ptr_to();
1029+
let pty = type_of::type_of(bcx.ccx(), const_ty).ptr_to();
10301030
PointerCast(bcx, val, pty)
10311031
} else {
10321032
{
@@ -1040,7 +1040,7 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
10401040
}
10411041

10421042
unsafe {
1043-
let llty = type_of(bcx.ccx(), const_ty);
1043+
let llty = type_of::type_of(bcx.ccx(), const_ty);
10441044
let symbol = csearch::get_symbol(
10451045
bcx.ccx().sess.cstore,
10461046
did);
@@ -1396,7 +1396,7 @@ fn trans_unary_datum(bcx: @mut Block,
13961396
heap: heap) -> DatumBlock {
13971397
let _icx = push_ctxt("trans_boxed_expr");
13981398
if heap == heap_exchange {
1399-
let llty = type_of(bcx.ccx(), contents_ty);
1399+
let llty = type_of::type_of(bcx.ccx(), contents_ty);
14001400
let size = llsize_of(bcx.ccx(), llty);
14011401
let Result { bcx: bcx, val: val } = malloc_raw_dyn(bcx, contents_ty,
14021402
heap_exchange, size);

src/librustc/middle/trans/glue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub fn lazily_emit_tydesc_glue(ccx: @mut CrateContext,
203203
field: uint,
204204
ti: @mut tydesc_info) {
205205
let _icx = push_ctxt("lazily_emit_tydesc_glue");
206-
let llfnty = Type::glue_fn(type_of::type_of(ccx, ti.ty).ptr_to());
206+
let llfnty = Type::glue_fn(type_of(ccx, ti.ty).ptr_to());
207207

208208
if lazily_emit_simplified_tydesc_glue(ccx, field, ti) {
209209
return;
@@ -345,7 +345,7 @@ pub fn make_visit_glue(bcx: @mut Block, v: ValueRef, t: ty::t) -> @mut Block {
345345
bcx.tcx().sess.fatal(s);
346346
}
347347
};
348-
let v = PointerCast(bcx, v, type_of::type_of(bcx.ccx(), object_ty).ptr_to());
348+
let v = PointerCast(bcx, v, type_of(bcx.ccx(), object_ty).ptr_to());
349349
bcx = reflect::emit_calls_to_trait_visit_ty(bcx, t, v, visitor_trait.def_id);
350350
// The visitor is a boxed object and needs to be dropped
351351
add_clean(bcx, v, object_ty);

src/librustc/middle/typeck/coherence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ impl CoherenceChecker {
330330

331331
let impl_poly_type = ty::lookup_item_type(tcx, impl_id);
332332

333-
let provided = ty::provided_trait_methods(tcx, trait_ref.def_id);
334-
for trait_method in provided.iter() {
333+
let prov = ty::provided_trait_methods(tcx, trait_ref.def_id);
334+
for trait_method in prov.iter() {
335335
// Synthesize an ID.
336336
let new_id = tcx.sess.next_node_id();
337337
let new_did = local_def(new_id);

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ enum Implementor {
126126
/// to be a fairly large and expensive structure to clone. Instead this adheres
127127
/// to both `Send` and `Freeze` so it may be stored in a `RWArc` instance and
128128
/// shared among the various rendering tasks.
129-
struct Cache {
129+
pub struct Cache {
130130
/// Mapping of typaram ids to the name of the type parameter. This is used
131131
/// when pretty-printing a type (so pretty printing doesn't have to
132132
/// painfully maintain a context like this)

src/librusti/program.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use utils::*;
2424
/// This structure keeps track of the state of the world for the code being
2525
/// executed in rusti.
2626
#[deriving(Clone)]
27-
struct Program {
27+
pub struct Program {
2828
/// All known local variables
2929
local_vars: HashMap<~str, LocalVariable>,
3030
/// New variables which will be present (learned from typechecking)

0 commit comments

Comments
 (0)