]> git.lizzy.rs Git - rust.git/commitdiff
Make visible types public in rustc
authorSteven Fackler <sfackler@gmail.com>
Sun, 2 Mar 2014 23:26:39 +0000 (15:26 -0800)
committerSteven Fackler <sfackler@gmail.com>
Sun, 2 Mar 2014 23:26:39 +0000 (15:26 -0800)
20 files changed:
src/librustc/lib.rs
src/librustc/metadata/decoder.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/tydecode.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/check_const.rs
src/librustc/middle/liveness.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/cleanup.rs
src/librustc/middle/trans/common.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/middle/typeck/infer/region_inference/mod.rs
src/libsyntax/ext/expand.rs
src/libsyntax/lib.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pp.rs
src/libsyntax/print/pprust.rs

index 235e1c72455c2693552bfde44000b858821d4108..4018e70b4f58b1f843b5fb92f9cdbdd69dc484e7 100644 (file)
@@ -30,8 +30,6 @@
 #[feature(macro_rules, globs, struct_variant, managed_boxes)];
 #[feature(quote)];
 
-#[allow(visible_private_types)];
-
 extern crate extra;
 extern crate flate;
 extern crate arena;
index 1e90748158fd84342f32b625f21bbaa8d88ed5b4..2bf54e0373d2b99a27ea62660082f582f4c67ca2 100644 (file)
@@ -46,7 +46,7 @@
 use syntax::codemap;
 use syntax::crateid::CrateId;
 
-type Cmd = @crate_metadata;
+pub type Cmd = @crate_metadata;
 
 // A function that takes a def_id relative to the crate being searched and
 // returns a def_id relative to the compilation environment, i.e. if we hit a
index 3a490845c60989bc32170262d7bdf3aa6f963cc7..80bb5d23aa446bfd644557c239e6aaf01b75520d 100644 (file)
@@ -52,7 +52,7 @@
 use writer = serialize::ebml::writer;
 
 // used by astencode:
-type abbrev_map = @RefCell<HashMap<ty::t, tyencode::ty_abbrev>>;
+pub type abbrev_map = @RefCell<HashMap<ty::t, tyencode::ty_abbrev>>;
 
 /// A borrowed version of ast::InlinedItem.
 pub enum InlinedItemRef<'a> {
@@ -76,7 +76,7 @@ pub struct EncodeParams<'a> {
     encode_inlined_item: EncodeInlinedItem<'a>,
 }
 
-struct Stats {
+pub struct Stats {
     inline_bytes: Cell<u64>,
     attr_bytes: Cell<u64>,
     dep_bytes: Cell<u64>,
index 21fe0e7539438c9e7050264a52cc3d4e346c1d77..f566571d0eb3c91c1f5e68fdfe00e0c0c7319c04 100644 (file)
@@ -54,7 +54,7 @@ pub enum DefIdSource {
     // Identifies a region parameter (`fn foo<'X>() { ... }`).
     RegionParameter,
 }
-type conv_did<'a> =
+pub type conv_did<'a> =
     'a |source: DefIdSource, ast::DefId| -> ast::DefId;
 
 pub struct PState<'a> {
index 94c3867b31845f377a7d5e0d2c9b09ea79161bf8..e9a96b0c47e5cbc333202c7094ea8dcbeba4a967 100644 (file)
@@ -907,7 +907,7 @@ fn repr(&self, tcx: ty::ctxt) -> ~str {
 
 ///////////////////////////////////////////////////////////////////////////
 
-struct TcxTyper {
+pub struct TcxTyper {
     tcx: ty::ctxt,
     method_map: typeck::MethodMap,
 }
index 864b4473336027fd5733081e513a789ff59d06ab..3b8e7086762353c8d8d8c99b8ee31482fdc397e0 100644 (file)
@@ -20,7 +20,7 @@
 use syntax::visit::Visitor;
 use syntax::visit;
 
-struct CheckCrateVisitor {
+pub struct CheckCrateVisitor {
     sess: Session,
     def_map: resolve::DefMap,
     method_map: typeck::MethodMap,
index ab4de1ed71d7977721d1ed7bb18f04e089621a46..cf909bbd1af1bd9d7744b54fa32de480c9926e47 100644 (file)
 use syntax::visit::{Visitor, FnKind};
 
 #[deriving(Eq)]
-struct Variable(uint);
+pub struct Variable(uint);
 #[deriving(Eq)]
-struct LiveNode(uint);
+pub struct LiveNode(uint);
 
 impl Variable {
     fn get(&self) -> uint { let Variable(v) = *self; v }
@@ -145,7 +145,7 @@ fn clone(&self) -> LiveNode {
 }
 
 #[deriving(Eq)]
-enum LiveNodeKind {
+pub enum LiveNodeKind {
     FreeVarNode(Span),
     ExprNode(Span),
     VarDefNode(Span),
@@ -226,32 +226,32 @@ pub fn is_valid(&self) -> bool {
 
 fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
 
-struct CaptureInfo {
+pub struct CaptureInfo {
     ln: LiveNode,
     is_move: bool,
     var_nid: NodeId
 }
 
-enum LocalKind {
+pub enum LocalKind {
     FromMatch(BindingMode),
     FromLetWithInitializer,
     FromLetNoInitializer
 }
 
-struct LocalInfo {
+pub struct LocalInfo {
     id: NodeId,
     ident: Ident,
     is_mutbl: bool,
     kind: LocalKind,
 }
 
-enum VarKind {
+pub enum VarKind {
     Arg(NodeId, Ident),
     Local(LocalInfo),
     ImplicitRet
 }
 
-struct IrMaps {
+pub struct IrMaps {
     tcx: ty::ctxt,
     method_map: typeck::MethodMap,
     capture_map: moves::CaptureMap,
@@ -560,7 +560,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: &Expr, this: @IrMaps) {
 // the same basic propagation framework in all cases.
 
 #[deriving(Clone)]
-struct Users {
+pub struct Users {
     reader: LiveNode,
     writer: LiveNode,
     used: bool
@@ -574,7 +574,7 @@ fn invalid_users() -> Users {
     }
 }
 
-struct Specials {
+pub struct Specials {
     exit_ln: LiveNode,
     fallthrough_ln: LiveNode,
     no_ret_var: Variable
@@ -584,7 +584,7 @@ struct Specials {
 static ACC_WRITE: uint = 2u;
 static ACC_USE: uint = 4u;
 
-type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
+pub type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
 
 pub struct Liveness {
     tcx: ty::ctxt,
@@ -1554,7 +1554,7 @@ fn check_fn(_v: &Liveness,
     // do not check contents of nested fns
 }
 
-enum ReadKind {
+pub enum ReadKind {
     PossiblyUninitializedVariable,
     PossiblyUninitializedField,
     MovedValue,
index b8301cbc33abfeb5453206686d1dbf4bbae61cdb..a9682eada93f9a7a9aef82dd451ed249a754b515 100644 (file)
@@ -1322,8 +1322,8 @@ fn arg_kind(cx: &FunctionContext, t: ty::t) -> datum::Rvalue {
 }
 
 // work around bizarre resolve errors
-type RvalueDatum = datum::Datum<datum::Rvalue>;
-type LvalueDatum = datum::Datum<datum::Lvalue>;
+pub type RvalueDatum = datum::Datum<datum::Rvalue>;
+pub type LvalueDatum = datum::Datum<datum::Lvalue>;
 
 // create_datums_for_fn_args: creates rvalue datums for each of the
 // incoming function arguments. These will later be stored into
index dfff05966cb99505188240199545d651871867f3..2cf24ff123a3ce8f82e4ea43b23b5b376212750a 100644 (file)
@@ -51,20 +51,20 @@ pub struct CustomScopeIndex {
 pub static EXIT_LOOP: uint = 1;
 pub static EXIT_MAX: uint = 2;
 
-enum CleanupScopeKind<'a> {
+pub enum CleanupScopeKind<'a> {
     CustomScopeKind,
     AstScopeKind(ast::NodeId),
     LoopScopeKind(ast::NodeId, [&'a Block<'a>, ..EXIT_MAX])
 }
 
 #[deriving(Eq)]
-enum EarlyExitLabel {
+pub enum EarlyExitLabel {
     UnwindExit,
     ReturnExit,
     LoopExit(ast::NodeId, uint)
 }
 
-struct CachedEarlyExit {
+pub struct CachedEarlyExit {
     label: EarlyExitLabel,
     cleanup_block: BasicBlockRef,
 }
index 037ea3e14f336b1c1ce7d3c811c8bcfcafc29c72..e7e69917ebba0ddf7bd5db33cf50eb2483108aee 100644 (file)
@@ -212,8 +212,8 @@ fn repr(&self, tcx: ty::ctxt) -> ~str {
 }
 
 // work around bizarre resolve errors
-type RvalueDatum = datum::Datum<datum::Rvalue>;
-type LvalueDatum = datum::Datum<datum::Lvalue>;
+pub type RvalueDatum = datum::Datum<datum::Rvalue>;
+pub type LvalueDatum = datum::Datum<datum::Lvalue>;
 
 // Function context.  Every LLVM function we create will have one of
 // these.
index 210adc1d0a5ec60c9f67773a7ba06b19baa3da09..e043bc8683f4856393fca1b69f7e4f0d60ba6d55 100644 (file)
@@ -158,9 +158,9 @@ pub struct creader_cache_key {
     len: uint
 }
 
-type creader_cache = RefCell<HashMap<creader_cache_key, t>>;
+pub type creader_cache = RefCell<HashMap<creader_cache_key, t>>;
 
-struct intern_key {
+pub struct intern_key {
     sty: *sty,
 }
 
@@ -1068,7 +1068,7 @@ pub struct ty_param_substs_and_ty {
     ty: ty::t
 }
 
-type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
+pub type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
 
 pub type node_type_table = RefCell<HashMap<uint,t>>;
 
index def80e39821ee7bcfb41c425764ee429e74a2306..bef3de532011a9d1a76dbeac08717821688f8576 100644 (file)
@@ -729,4 +729,4 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
 }
 
 #[deriving(Eq)]
-enum PointerKind { Send, Borrowed }
+pub enum PointerKind { Send, Borrowed }
index aff41ce1979c067ef44c20b3ed99ceaa785beed6..d7f85bd01234e550b30967b6a290aa36faaa845f 100644 (file)
@@ -236,7 +236,7 @@ pub struct Candidate {
 /// now we must check that the type `T` is correct).  Unfortunately,
 /// because traits are not types, this is a pain to do.
 #[deriving(Clone)]
-enum RcvrMatchCondition {
+pub enum RcvrMatchCondition {
     RcvrMatchesIfObject(ast::DefId),
     RcvrMatchesIfSubtype(ty::t)
 }
index dceef9e38d50e87443615ac565fade1c5a2d1188..28a3e822a1ae99571e584d4bfdfe9ee1ad2bc3e2 100644 (file)
@@ -500,7 +500,7 @@ fn rollback_to<V:Clone + Vid,T:Clone>(vb: &mut ValsAndBindings<V, T>,
     }
 }
 
-struct Snapshot {
+pub struct Snapshot {
     ty_var_bindings_len: uint,
     int_var_bindings_len: uint,
     float_var_bindings_len: uint,
index 55d33f9691855ed2827d873aef826db7d4c9d0d6..98fe0bedb3be8d8807aaf9f644ece7f9828e8821 100644 (file)
@@ -35,7 +35,7 @@
 mod doc;
 
 #[deriving(Eq, Hash)]
-enum Constraint {
+pub enum Constraint {
     ConstrainVarSubVar(RegionVid, RegionVid),
     ConstrainRegSubVar(Region, RegionVid),
     ConstrainVarSubReg(RegionVid, Region),
@@ -43,19 +43,19 @@ enum Constraint {
 }
 
 #[deriving(Eq, Hash)]
-struct TwoRegions {
+pub struct TwoRegions {
     a: Region,
     b: Region,
 }
 
-enum UndoLogEntry {
+pub enum UndoLogEntry {
     Snapshot,
     AddVar(RegionVid),
     AddConstraint(Constraint),
     AddCombination(CombineMapType, TwoRegions)
 }
 
-enum CombineMapType {
+pub enum CombineMapType {
     Lub, Glb
 }
 
@@ -84,7 +84,7 @@ pub enum RegionResolutionError {
                    SubregionOrigin, Region),
 }
 
-type CombineMap = HashMap<TwoRegions, RegionVid>;
+pub type CombineMap = HashMap<TwoRegions, RegionVid>;
 
 pub struct RegionVarBindings {
     tcx: ty::ctxt,
@@ -764,7 +764,7 @@ fn intersect_scopes(&self,
 #[deriving(Eq, Show)]
 enum Classification { Expanding, Contracting }
 
-enum VarValue { NoValue, Value(Region), ErrorValue }
+pub enum VarValue { NoValue, Value(Region), ErrorValue }
 
 struct VarData {
     classification: Classification,
index b162e17f53de1d55223129a031208b7cd2b43469..d8b4334c8678aeae20c07f97e7dd4620478e7837 100644 (file)
@@ -660,7 +660,7 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
 // from a given thingy and puts them in a mutable
 // array (passed in to the traversal)
 #[deriving(Clone)]
-struct NewNameFinderContext {
+pub struct NewNameFinderContext {
     ident_accumulator: Vec<ast::Ident> ,
 }
 
@@ -748,7 +748,7 @@ pub fn expand_block_elts(b: &Block, fld: &mut MacroExpander) -> P<Block> {
     })
 }
 
-struct IdentRenamer<'a> {
+pub struct IdentRenamer<'a> {
     renames: &'a mut RenameList,
 }
 
index 260375b5f81d619c77da339e3108acc99d2f8fca..42c9ab461aa009be8ee037a1059e9c34165a3e89 100644 (file)
@@ -31,7 +31,6 @@
 #[feature(quote)];
 
 #[deny(non_camel_case_types)];
-#[allow(visible_private_types)];
 
 extern crate serialize;
 extern crate term;
index 9b209aadf19e50b91b61f6d8817980f461e3db5c..2557af5e436a26dc026fcf700923a93b30745cc7 100644 (file)
@@ -87,7 +87,7 @@
 
 #[allow(non_camel_case_types)]
 #[deriving(Eq)]
-enum restriction {
+pub enum restriction {
     UNRESTRICTED,
     RESTRICT_STMT_EXPR,
     RESTRICT_NO_BAR_OP,
index e9e0e4835933bd8785749573299bd6f778929b1b..b3e7ac667d839d1b03de4295f69cdececf7f934d 100644 (file)
@@ -139,12 +139,12 @@ pub fn buf_str(toks: Vec<Token> , szs: Vec<int> , left: uint, right: uint,
     return s;
 }
 
-enum PrintStackBreak {
+pub enum PrintStackBreak {
     Fits,
     Broken(Breaks),
 }
 
-struct PrintStackElem {
+pub struct PrintStackElem {
     offset: int,
     pbreak: PrintStackBreak
 }
index d027efc1d42f6247735b78b611590d6bf2d327c6..ec8c474d194028fb267f2d40bc46d830149a16bc 100644 (file)
@@ -1027,7 +1027,7 @@ pub fn print_block_with_attrs(s: &mut State,
                                   true)
 }
 
-enum EmbedType {
+pub enum EmbedType {
     BlockBlockFn,
     BlockNormal,
 }