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

-2
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+12-12
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

+2-2
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

+3-3
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

+2-2
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.

src/librustc/middle/ty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ pub struct creader_cache_key {
158158
len: uint
159159
}
160160

161-
type creader_cache = RefCell<HashMap<creader_cache_key, t>>;
161+
pub type creader_cache = RefCell<HashMap<creader_cache_key, t>>;
162162

163-
struct intern_key {
163+
pub struct intern_key {
164164
sty: *sty,
165165
}
166166

@@ -1068,7 +1068,7 @@ pub struct ty_param_substs_and_ty {
10681068
ty: ty::t
10691069
}
10701070

1071-
type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
1071+
pub type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
10721072

10731073
pub type node_type_table = RefCell<HashMap<uint,t>>;
10741074

src/librustc/middle/typeck/check/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -729,4 +729,4 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
729729
}
730730

731731
#[deriving(Eq)]
732-
enum PointerKind { Send, Borrowed }
732+
pub enum PointerKind { Send, Borrowed }

src/librustc/middle/typeck/check/method.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub struct Candidate {
236236
/// now we must check that the type `T` is correct). Unfortunately,
237237
/// because traits are not types, this is a pain to do.
238238
#[deriving(Clone)]
239-
enum RcvrMatchCondition {
239+
pub enum RcvrMatchCondition {
240240
RcvrMatchesIfObject(ast::DefId),
241241
RcvrMatchesIfSubtype(ty::t)
242242
}

src/librustc/middle/typeck/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ fn rollback_to<V:Clone + Vid,T:Clone>(vb: &mut ValsAndBindings<V, T>,
500500
}
501501
}
502502

503-
struct Snapshot {
503+
pub struct Snapshot {
504504
ty_var_bindings_len: uint,
505505
int_var_bindings_len: uint,
506506
float_var_bindings_len: uint,

src/librustc/middle/typeck/infer/region_inference/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,27 @@ use syntax::opt_vec::OptVec;
3535
mod doc;
3636

3737
#[deriving(Eq, Hash)]
38-
enum Constraint {
38+
pub enum Constraint {
3939
ConstrainVarSubVar(RegionVid, RegionVid),
4040
ConstrainRegSubVar(Region, RegionVid),
4141
ConstrainVarSubReg(RegionVid, Region),
4242
ConstrainRegSubReg(Region, Region),
4343
}
4444

4545
#[deriving(Eq, Hash)]
46-
struct TwoRegions {
46+
pub struct TwoRegions {
4747
a: Region,
4848
b: Region,
4949
}
5050

51-
enum UndoLogEntry {
51+
pub enum UndoLogEntry {
5252
Snapshot,
5353
AddVar(RegionVid),
5454
AddConstraint(Constraint),
5555
AddCombination(CombineMapType, TwoRegions)
5656
}
5757

58-
enum CombineMapType {
58+
pub enum CombineMapType {
5959
Lub, Glb
6060
}
6161

@@ -84,7 +84,7 @@ pub enum RegionResolutionError {
8484
SubregionOrigin, Region),
8585
}
8686

87-
type CombineMap = HashMap<TwoRegions, RegionVid>;
87+
pub type CombineMap = HashMap<TwoRegions, RegionVid>;
8888

8989
pub struct RegionVarBindings {
9090
tcx: ty::ctxt,
@@ -764,7 +764,7 @@ impl RegionVarBindings {
764764
#[deriving(Eq, Show)]
765765
enum Classification { Expanding, Contracting }
766766

767-
enum VarValue { NoValue, Value(Region), ErrorValue }
767+
pub enum VarValue { NoValue, Value(Region), ErrorValue }
768768

769769
struct VarData {
770770
classification: Classification,

src/libsyntax/ext/expand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
660660
// from a given thingy and puts them in a mutable
661661
// array (passed in to the traversal)
662662
#[deriving(Clone)]
663-
struct NewNameFinderContext {
663+
pub struct NewNameFinderContext {
664664
ident_accumulator: Vec<ast::Ident> ,
665665
}
666666

@@ -748,7 +748,7 @@ pub fn expand_block_elts(b: &Block, fld: &mut MacroExpander) -> P<Block> {
748748
})
749749
}
750750

751-
struct IdentRenamer<'a> {
751+
pub struct IdentRenamer<'a> {
752752
renames: &'a mut RenameList,
753753
}
754754

src/libsyntax/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ This API is completely unstable and subject to change.
3131
#[feature(quote)];
3232

3333
#[deny(non_camel_case_types)];
34-
#[allow(visible_private_types)];
3534

3635
extern crate serialize;
3736
extern crate term;

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ use std::vec_ng;
8787

8888
#[allow(non_camel_case_types)]
8989
#[deriving(Eq)]
90-
enum restriction {
90+
pub enum restriction {
9191
UNRESTRICTED,
9292
RESTRICT_STMT_EXPR,
9393
RESTRICT_NO_BAR_OP,

src/libsyntax/print/pp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ pub fn buf_str(toks: Vec<Token> , szs: Vec<int> , left: uint, right: uint,
139139
return s;
140140
}
141141

142-
enum PrintStackBreak {
142+
pub enum PrintStackBreak {
143143
Fits,
144144
Broken(Breaks),
145145
}
146146

147-
struct PrintStackElem {
147+
pub struct PrintStackElem {
148148
offset: int,
149149
pbreak: PrintStackBreak
150150
}

src/libsyntax/print/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ pub fn print_block_with_attrs(s: &mut State,
10271027
true)
10281028
}
10291029

1030-
enum EmbedType {
1030+
pub enum EmbedType {
10311031
BlockBlockFn,
10321032
BlockNormal,
10331033
}

0 commit comments

Comments
 (0)