Skip to content

Commit 4c2353a

Browse files
committed
Make visible types public in rustc
1 parent 51233c5 commit 4c2353a

File tree

20 files changed

+43
-46
lines changed

20 files changed

+43
-46
lines changed

src/librustc/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ This API is completely unstable and subject to change.
3030
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
3131
#[feature(quote)];
3232

33-
#[allow(visible_private_types)];
34-
3533
extern crate extra;
3634
extern crate flate;
3735
extern crate arena;

src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use syntax::ast;
4646
use syntax::codemap;
4747
use syntax::crateid::CrateId;
4848

49-
type Cmd = @crate_metadata;
49+
pub type Cmd = @crate_metadata;
5050

5151
// A function that takes a def_id relative to the crate being searched and
5252
// returns a def_id relative to the compilation environment, i.e. if we hit a

src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use syntax;
5252
use writer = serialize::ebml::writer;
5353

5454
// used by astencode:
55-
type abbrev_map = @RefCell<HashMap<ty::t, tyencode::ty_abbrev>>;
55+
pub type abbrev_map = @RefCell<HashMap<ty::t, tyencode::ty_abbrev>>;
5656

5757
/// A borrowed version of ast::InlinedItem.
5858
pub enum InlinedItemRef<'a> {
@@ -76,7 +76,7 @@ pub struct EncodeParams<'a> {
7676
encode_inlined_item: EncodeInlinedItem<'a>,
7777
}
7878

79-
struct Stats {
79+
pub struct Stats {
8080
inline_bytes: Cell<u64>,
8181
attr_bytes: Cell<u64>,
8282
dep_bytes: Cell<u64>,

src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum DefIdSource {
5454
// Identifies a region parameter (`fn foo<'X>() { ... }`).
5555
RegionParameter,
5656
}
57-
type conv_did<'a> =
57+
pub type conv_did<'a> =
5858
'a |source: DefIdSource, ast::DefId| -> ast::DefId;
5959

6060
pub struct PState<'a> {

src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ impl Repr for LoanPath {
907907

908908
///////////////////////////////////////////////////////////////////////////
909909

910-
struct TcxTyper {
910+
pub struct TcxTyper {
911911
tcx: ty::ctxt,
912912
method_map: typeck::MethodMap,
913913
}

src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax::{ast_util, ast_map};
2020
use syntax::visit::Visitor;
2121
use syntax::visit;
2222

23-
struct CheckCrateVisitor {
23+
pub struct CheckCrateVisitor {
2424
sess: Session,
2525
def_map: resolve::DefMap,
2626
method_map: typeck::MethodMap,

src/librustc/middle/liveness.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ use syntax::{visit, ast_util};
126126
use syntax::visit::{Visitor, FnKind};
127127

128128
#[deriving(Eq)]
129-
struct Variable(uint);
129+
pub struct Variable(uint);
130130
#[deriving(Eq)]
131-
struct LiveNode(uint);
131+
pub struct LiveNode(uint);
132132

133133
impl Variable {
134134
fn get(&self) -> uint { let Variable(v) = *self; v }
@@ -145,7 +145,7 @@ impl Clone for LiveNode {
145145
}
146146

147147
#[deriving(Eq)]
148-
enum LiveNodeKind {
148+
pub enum LiveNodeKind {
149149
FreeVarNode(Span),
150150
ExprNode(Span),
151151
VarDefNode(Span),
@@ -226,32 +226,32 @@ impl LiveNode {
226226

227227
fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
228228

229-
struct CaptureInfo {
229+
pub struct CaptureInfo {
230230
ln: LiveNode,
231231
is_move: bool,
232232
var_nid: NodeId
233233
}
234234

235-
enum LocalKind {
235+
pub enum LocalKind {
236236
FromMatch(BindingMode),
237237
FromLetWithInitializer,
238238
FromLetNoInitializer
239239
}
240240

241-
struct LocalInfo {
241+
pub struct LocalInfo {
242242
id: NodeId,
243243
ident: Ident,
244244
is_mutbl: bool,
245245
kind: LocalKind,
246246
}
247247

248-
enum VarKind {
248+
pub enum VarKind {
249249
Arg(NodeId, Ident),
250250
Local(LocalInfo),
251251
ImplicitRet
252252
}
253253

254-
struct IrMaps {
254+
pub struct IrMaps {
255255
tcx: ty::ctxt,
256256
method_map: typeck::MethodMap,
257257
capture_map: moves::CaptureMap,
@@ -560,7 +560,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: &Expr, this: @IrMaps) {
560560
// the same basic propagation framework in all cases.
561561

562562
#[deriving(Clone)]
563-
struct Users {
563+
pub struct Users {
564564
reader: LiveNode,
565565
writer: LiveNode,
566566
used: bool
@@ -574,7 +574,7 @@ fn invalid_users() -> Users {
574574
}
575575
}
576576

577-
struct Specials {
577+
pub struct Specials {
578578
exit_ln: LiveNode,
579579
fallthrough_ln: LiveNode,
580580
no_ret_var: Variable
@@ -584,7 +584,7 @@ static ACC_READ: uint = 1u;
584584
static ACC_WRITE: uint = 2u;
585585
static ACC_USE: uint = 4u;
586586

587-
type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
587+
pub type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
588588

589589
pub struct Liveness {
590590
tcx: ty::ctxt,
@@ -1554,7 +1554,7 @@ fn check_fn(_v: &Liveness,
15541554
// do not check contents of nested fns
15551555
}
15561556

1557-
enum ReadKind {
1557+
pub enum ReadKind {
15581558
PossiblyUninitializedVariable,
15591559
PossiblyUninitializedField,
15601560
MovedValue,

src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,8 @@ fn arg_kind(cx: &FunctionContext, t: ty::t) -> datum::Rvalue {
13221322
}
13231323

13241324
// work around bizarre resolve errors
1325-
type RvalueDatum = datum::Datum<datum::Rvalue>;
1326-
type LvalueDatum = datum::Datum<datum::Lvalue>;
1325+
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
1326+
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
13271327

13281328
// create_datums_for_fn_args: creates rvalue datums for each of the
13291329
// incoming function arguments. These will later be stored into

src/librustc/middle/trans/cleanup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ pub static EXIT_BREAK: uint = 0;
5151
pub static EXIT_LOOP: uint = 1;
5252
pub static EXIT_MAX: uint = 2;
5353

54-
enum CleanupScopeKind<'a> {
54+
pub enum CleanupScopeKind<'a> {
5555
CustomScopeKind,
5656
AstScopeKind(ast::NodeId),
5757
LoopScopeKind(ast::NodeId, [&'a Block<'a>, ..EXIT_MAX])
5858
}
5959

6060
#[deriving(Eq)]
61-
enum EarlyExitLabel {
61+
pub enum EarlyExitLabel {
6262
UnwindExit,
6363
ReturnExit,
6464
LoopExit(ast::NodeId, uint)
6565
}
6666

67-
struct CachedEarlyExit {
67+
pub struct CachedEarlyExit {
6868
label: EarlyExitLabel,
6969
cleanup_block: BasicBlockRef,
7070
}

src/librustc/middle/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ impl Repr for param_substs {
212212
}
213213

214214
// work around bizarre resolve errors
215-
type RvalueDatum = datum::Datum<datum::Rvalue>;
216-
type LvalueDatum = datum::Datum<datum::Lvalue>;
215+
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
216+
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
217217

218218
// Function context. Every LLVM function we create will have one of
219219
// these.

0 commit comments

Comments
 (0)