Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make visible types public in rustc #12662

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ This API is completely unstable and subject to change.
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
#[feature(quote)];

#[allow(visible_private_types)];

extern crate extra;
extern crate flate;
extern crate arena;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use syntax::ast;
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
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use syntax;
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> {
Expand All @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/tydecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ impl Repr for LoanPath {

///////////////////////////////////////////////////////////////////////////

struct TcxTyper {
pub struct TcxTyper {
tcx: ty::ctxt,
method_map: typeck::MethodMap,
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use syntax::{ast_util, ast_map};
use syntax::visit::Visitor;
use syntax::visit;

struct CheckCrateVisitor {
pub struct CheckCrateVisitor {
sess: Session,
def_map: resolve::DefMap,
method_map: typeck::MethodMap,
Expand Down
24 changes: 12 additions & 12 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ use syntax::{visit, ast_util};
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 }
Expand All @@ -145,7 +145,7 @@ impl Clone for LiveNode {
}

#[deriving(Eq)]
enum LiveNodeKind {
pub enum LiveNodeKind {
FreeVarNode(Span),
ExprNode(Span),
VarDefNode(Span),
Expand Down Expand Up @@ -226,32 +226,32 @@ impl LiveNode {

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,
Expand Down Expand Up @@ -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
Expand All @@ -574,7 +574,7 @@ fn invalid_users() -> Users {
}
}

struct Specials {
pub struct Specials {
exit_ln: LiveNode,
fallthrough_ln: LiveNode,
no_ret_var: Variable
Expand All @@ -584,7 +584,7 @@ static ACC_READ: uint = 1u;
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,
Expand Down Expand Up @@ -1554,7 +1554,7 @@ fn check_fn(_v: &Liveness,
// do not check contents of nested fns
}

enum ReadKind {
pub enum ReadKind {
PossiblyUninitializedVariable,
PossiblyUninitializedField,
MovedValue,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/trans/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ pub static EXIT_BREAK: uint = 0;
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,
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ impl Repr for param_substs {
}

// 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.
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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>>;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,4 +729,4 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
}

#[deriving(Eq)]
enum PointerKind { Send, Borrowed }
pub enum PointerKind { Send, Borrowed }
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/check/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/middle/typeck/infer/region_inference/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ use syntax::opt_vec::OptVec;
mod doc;

#[deriving(Eq, Hash)]
enum Constraint {
pub enum Constraint {
ConstrainVarSubVar(RegionVid, RegionVid),
ConstrainRegSubVar(Region, RegionVid),
ConstrainVarSubReg(RegionVid, Region),
ConstrainRegSubReg(Region, Region),
}

#[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
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -764,7 +764,7 @@ impl RegionVarBindings {
#[deriving(Eq, Show)]
enum Classification { Expanding, Contracting }

enum VarValue { NoValue, Value(Region), ErrorValue }
pub enum VarValue { NoValue, Value(Region), ErrorValue }

struct VarData {
classification: Classification,
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/ext/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> ,
}

Expand Down Expand Up @@ -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,
}

Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ This API is completely unstable and subject to change.
#[feature(quote)];

#[deny(non_camel_case_types)];
#[allow(visible_private_types)];

extern crate serialize;
extern crate term;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ use std::vec_ng;

#[allow(non_camel_case_types)]
#[deriving(Eq)]
enum restriction {
pub enum restriction {
UNRESTRICTED,
RESTRICT_STMT_EXPR,
RESTRICT_NO_BAR_OP,
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/print/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ pub fn print_block_with_attrs(s: &mut State,
true)
}

enum EmbedType {
pub enum EmbedType {
BlockBlockFn,
BlockNormal,
}
Expand Down