Make visible types public in rustc
This commit is contained in:
parent
51233c5219
commit
4c2353adee
20 changed files with 43 additions and 46 deletions
|
@ -30,8 +30,6 @@ This API is completely unstable and subject to change.
|
||||||
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
|
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
|
||||||
#[feature(quote)];
|
#[feature(quote)];
|
||||||
|
|
||||||
#[allow(visible_private_types)];
|
|
||||||
|
|
||||||
extern crate extra;
|
extern crate extra;
|
||||||
extern crate flate;
|
extern crate flate;
|
||||||
extern crate arena;
|
extern crate arena;
|
||||||
|
|
|
@ -46,7 +46,7 @@ use syntax::ast;
|
||||||
use syntax::codemap;
|
use syntax::codemap;
|
||||||
use syntax::crateid::CrateId;
|
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
|
// 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
|
// returns a def_id relative to the compilation environment, i.e. if we hit a
|
||||||
|
|
|
@ -52,7 +52,7 @@ use syntax;
|
||||||
use writer = serialize::ebml::writer;
|
use writer = serialize::ebml::writer;
|
||||||
|
|
||||||
// used by astencode:
|
// 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.
|
/// A borrowed version of ast::InlinedItem.
|
||||||
pub enum InlinedItemRef<'a> {
|
pub enum InlinedItemRef<'a> {
|
||||||
|
@ -76,7 +76,7 @@ pub struct EncodeParams<'a> {
|
||||||
encode_inlined_item: EncodeInlinedItem<'a>,
|
encode_inlined_item: EncodeInlinedItem<'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Stats {
|
pub struct Stats {
|
||||||
inline_bytes: Cell<u64>,
|
inline_bytes: Cell<u64>,
|
||||||
attr_bytes: Cell<u64>,
|
attr_bytes: Cell<u64>,
|
||||||
dep_bytes: Cell<u64>,
|
dep_bytes: Cell<u64>,
|
||||||
|
|
|
@ -54,7 +54,7 @@ pub enum DefIdSource {
|
||||||
// Identifies a region parameter (`fn foo<'X>() { ... }`).
|
// Identifies a region parameter (`fn foo<'X>() { ... }`).
|
||||||
RegionParameter,
|
RegionParameter,
|
||||||
}
|
}
|
||||||
type conv_did<'a> =
|
pub type conv_did<'a> =
|
||||||
'a |source: DefIdSource, ast::DefId| -> ast::DefId;
|
'a |source: DefIdSource, ast::DefId| -> ast::DefId;
|
||||||
|
|
||||||
pub struct PState<'a> {
|
pub struct PState<'a> {
|
||||||
|
|
|
@ -907,7 +907,7 @@ impl Repr for LoanPath {
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct TcxTyper {
|
pub struct TcxTyper {
|
||||||
tcx: ty::ctxt,
|
tcx: ty::ctxt,
|
||||||
method_map: typeck::MethodMap,
|
method_map: typeck::MethodMap,
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ use syntax::{ast_util, ast_map};
|
||||||
use syntax::visit::Visitor;
|
use syntax::visit::Visitor;
|
||||||
use syntax::visit;
|
use syntax::visit;
|
||||||
|
|
||||||
struct CheckCrateVisitor {
|
pub struct CheckCrateVisitor {
|
||||||
sess: Session,
|
sess: Session,
|
||||||
def_map: resolve::DefMap,
|
def_map: resolve::DefMap,
|
||||||
method_map: typeck::MethodMap,
|
method_map: typeck::MethodMap,
|
||||||
|
|
|
@ -126,9 +126,9 @@ use syntax::{visit, ast_util};
|
||||||
use syntax::visit::{Visitor, FnKind};
|
use syntax::visit::{Visitor, FnKind};
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
struct Variable(uint);
|
pub struct Variable(uint);
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
struct LiveNode(uint);
|
pub struct LiveNode(uint);
|
||||||
|
|
||||||
impl Variable {
|
impl Variable {
|
||||||
fn get(&self) -> uint { let Variable(v) = *self; v }
|
fn get(&self) -> uint { let Variable(v) = *self; v }
|
||||||
|
@ -145,7 +145,7 @@ impl Clone for LiveNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
enum LiveNodeKind {
|
pub enum LiveNodeKind {
|
||||||
FreeVarNode(Span),
|
FreeVarNode(Span),
|
||||||
ExprNode(Span),
|
ExprNode(Span),
|
||||||
VarDefNode(Span),
|
VarDefNode(Span),
|
||||||
|
@ -226,32 +226,32 @@ impl LiveNode {
|
||||||
|
|
||||||
fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
|
fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
|
||||||
|
|
||||||
struct CaptureInfo {
|
pub struct CaptureInfo {
|
||||||
ln: LiveNode,
|
ln: LiveNode,
|
||||||
is_move: bool,
|
is_move: bool,
|
||||||
var_nid: NodeId
|
var_nid: NodeId
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LocalKind {
|
pub enum LocalKind {
|
||||||
FromMatch(BindingMode),
|
FromMatch(BindingMode),
|
||||||
FromLetWithInitializer,
|
FromLetWithInitializer,
|
||||||
FromLetNoInitializer
|
FromLetNoInitializer
|
||||||
}
|
}
|
||||||
|
|
||||||
struct LocalInfo {
|
pub struct LocalInfo {
|
||||||
id: NodeId,
|
id: NodeId,
|
||||||
ident: Ident,
|
ident: Ident,
|
||||||
is_mutbl: bool,
|
is_mutbl: bool,
|
||||||
kind: LocalKind,
|
kind: LocalKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum VarKind {
|
pub enum VarKind {
|
||||||
Arg(NodeId, Ident),
|
Arg(NodeId, Ident),
|
||||||
Local(LocalInfo),
|
Local(LocalInfo),
|
||||||
ImplicitRet
|
ImplicitRet
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IrMaps {
|
pub struct IrMaps {
|
||||||
tcx: ty::ctxt,
|
tcx: ty::ctxt,
|
||||||
method_map: typeck::MethodMap,
|
method_map: typeck::MethodMap,
|
||||||
capture_map: moves::CaptureMap,
|
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.
|
// the same basic propagation framework in all cases.
|
||||||
|
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
struct Users {
|
pub struct Users {
|
||||||
reader: LiveNode,
|
reader: LiveNode,
|
||||||
writer: LiveNode,
|
writer: LiveNode,
|
||||||
used: bool
|
used: bool
|
||||||
|
@ -574,7 +574,7 @@ fn invalid_users() -> Users {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Specials {
|
pub struct Specials {
|
||||||
exit_ln: LiveNode,
|
exit_ln: LiveNode,
|
||||||
fallthrough_ln: LiveNode,
|
fallthrough_ln: LiveNode,
|
||||||
no_ret_var: Variable
|
no_ret_var: Variable
|
||||||
|
@ -584,7 +584,7 @@ static ACC_READ: uint = 1u;
|
||||||
static ACC_WRITE: uint = 2u;
|
static ACC_WRITE: uint = 2u;
|
||||||
static ACC_USE: uint = 4u;
|
static ACC_USE: uint = 4u;
|
||||||
|
|
||||||
type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
|
pub type LiveNodeMap = @RefCell<HashMap<NodeId, LiveNode>>;
|
||||||
|
|
||||||
pub struct Liveness {
|
pub struct Liveness {
|
||||||
tcx: ty::ctxt,
|
tcx: ty::ctxt,
|
||||||
|
@ -1554,7 +1554,7 @@ fn check_fn(_v: &Liveness,
|
||||||
// do not check contents of nested fns
|
// do not check contents of nested fns
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ReadKind {
|
pub enum ReadKind {
|
||||||
PossiblyUninitializedVariable,
|
PossiblyUninitializedVariable,
|
||||||
PossiblyUninitializedField,
|
PossiblyUninitializedField,
|
||||||
MovedValue,
|
MovedValue,
|
||||||
|
|
|
@ -1322,8 +1322,8 @@ fn arg_kind(cx: &FunctionContext, t: ty::t) -> datum::Rvalue {
|
||||||
}
|
}
|
||||||
|
|
||||||
// work around bizarre resolve errors
|
// work around bizarre resolve errors
|
||||||
type RvalueDatum = datum::Datum<datum::Rvalue>;
|
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
|
||||||
type LvalueDatum = datum::Datum<datum::Lvalue>;
|
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
|
||||||
|
|
||||||
// create_datums_for_fn_args: creates rvalue datums for each of the
|
// create_datums_for_fn_args: creates rvalue datums for each of the
|
||||||
// incoming function arguments. These will later be stored into
|
// incoming function arguments. These will later be stored into
|
||||||
|
|
|
@ -51,20 +51,20 @@ pub static EXIT_BREAK: uint = 0;
|
||||||
pub static EXIT_LOOP: uint = 1;
|
pub static EXIT_LOOP: uint = 1;
|
||||||
pub static EXIT_MAX: uint = 2;
|
pub static EXIT_MAX: uint = 2;
|
||||||
|
|
||||||
enum CleanupScopeKind<'a> {
|
pub enum CleanupScopeKind<'a> {
|
||||||
CustomScopeKind,
|
CustomScopeKind,
|
||||||
AstScopeKind(ast::NodeId),
|
AstScopeKind(ast::NodeId),
|
||||||
LoopScopeKind(ast::NodeId, [&'a Block<'a>, ..EXIT_MAX])
|
LoopScopeKind(ast::NodeId, [&'a Block<'a>, ..EXIT_MAX])
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
enum EarlyExitLabel {
|
pub enum EarlyExitLabel {
|
||||||
UnwindExit,
|
UnwindExit,
|
||||||
ReturnExit,
|
ReturnExit,
|
||||||
LoopExit(ast::NodeId, uint)
|
LoopExit(ast::NodeId, uint)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CachedEarlyExit {
|
pub struct CachedEarlyExit {
|
||||||
label: EarlyExitLabel,
|
label: EarlyExitLabel,
|
||||||
cleanup_block: BasicBlockRef,
|
cleanup_block: BasicBlockRef,
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,8 +212,8 @@ impl Repr for param_substs {
|
||||||
}
|
}
|
||||||
|
|
||||||
// work around bizarre resolve errors
|
// work around bizarre resolve errors
|
||||||
type RvalueDatum = datum::Datum<datum::Rvalue>;
|
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
|
||||||
type LvalueDatum = datum::Datum<datum::Lvalue>;
|
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
|
||||||
|
|
||||||
// Function context. Every LLVM function we create will have one of
|
// Function context. Every LLVM function we create will have one of
|
||||||
// these.
|
// these.
|
||||||
|
|
|
@ -158,9 +158,9 @@ pub struct creader_cache_key {
|
||||||
len: uint
|
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,
|
sty: *sty,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1068,7 +1068,7 @@ pub struct ty_param_substs_and_ty {
|
||||||
ty: ty::t
|
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>>;
|
pub type node_type_table = RefCell<HashMap<uint,t>>;
|
||||||
|
|
||||||
|
|
|
@ -729,4 +729,4 @@ pub fn check_pointer_pat(pcx: &pat_ctxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
enum PointerKind { Send, Borrowed }
|
pub enum PointerKind { Send, Borrowed }
|
||||||
|
|
|
@ -236,7 +236,7 @@ pub struct Candidate {
|
||||||
/// now we must check that the type `T` is correct). Unfortunately,
|
/// now we must check that the type `T` is correct). Unfortunately,
|
||||||
/// because traits are not types, this is a pain to do.
|
/// because traits are not types, this is a pain to do.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
enum RcvrMatchCondition {
|
pub enum RcvrMatchCondition {
|
||||||
RcvrMatchesIfObject(ast::DefId),
|
RcvrMatchesIfObject(ast::DefId),
|
||||||
RcvrMatchesIfSubtype(ty::t)
|
RcvrMatchesIfSubtype(ty::t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
ty_var_bindings_len: uint,
|
||||||
int_var_bindings_len: uint,
|
int_var_bindings_len: uint,
|
||||||
float_var_bindings_len: uint,
|
float_var_bindings_len: uint,
|
||||||
|
|
|
@ -35,7 +35,7 @@ use syntax::opt_vec::OptVec;
|
||||||
mod doc;
|
mod doc;
|
||||||
|
|
||||||
#[deriving(Eq, Hash)]
|
#[deriving(Eq, Hash)]
|
||||||
enum Constraint {
|
pub enum Constraint {
|
||||||
ConstrainVarSubVar(RegionVid, RegionVid),
|
ConstrainVarSubVar(RegionVid, RegionVid),
|
||||||
ConstrainRegSubVar(Region, RegionVid),
|
ConstrainRegSubVar(Region, RegionVid),
|
||||||
ConstrainVarSubReg(RegionVid, Region),
|
ConstrainVarSubReg(RegionVid, Region),
|
||||||
|
@ -43,19 +43,19 @@ enum Constraint {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq, Hash)]
|
#[deriving(Eq, Hash)]
|
||||||
struct TwoRegions {
|
pub struct TwoRegions {
|
||||||
a: Region,
|
a: Region,
|
||||||
b: Region,
|
b: Region,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum UndoLogEntry {
|
pub enum UndoLogEntry {
|
||||||
Snapshot,
|
Snapshot,
|
||||||
AddVar(RegionVid),
|
AddVar(RegionVid),
|
||||||
AddConstraint(Constraint),
|
AddConstraint(Constraint),
|
||||||
AddCombination(CombineMapType, TwoRegions)
|
AddCombination(CombineMapType, TwoRegions)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CombineMapType {
|
pub enum CombineMapType {
|
||||||
Lub, Glb
|
Lub, Glb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ pub enum RegionResolutionError {
|
||||||
SubregionOrigin, Region),
|
SubregionOrigin, Region),
|
||||||
}
|
}
|
||||||
|
|
||||||
type CombineMap = HashMap<TwoRegions, RegionVid>;
|
pub type CombineMap = HashMap<TwoRegions, RegionVid>;
|
||||||
|
|
||||||
pub struct RegionVarBindings {
|
pub struct RegionVarBindings {
|
||||||
tcx: ty::ctxt,
|
tcx: ty::ctxt,
|
||||||
|
@ -764,7 +764,7 @@ impl RegionVarBindings {
|
||||||
#[deriving(Eq, Show)]
|
#[deriving(Eq, Show)]
|
||||||
enum Classification { Expanding, Contracting }
|
enum Classification { Expanding, Contracting }
|
||||||
|
|
||||||
enum VarValue { NoValue, Value(Region), ErrorValue }
|
pub enum VarValue { NoValue, Value(Region), ErrorValue }
|
||||||
|
|
||||||
struct VarData {
|
struct VarData {
|
||||||
classification: Classification,
|
classification: Classification,
|
||||||
|
|
|
@ -660,7 +660,7 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
|
||||||
// from a given thingy and puts them in a mutable
|
// from a given thingy and puts them in a mutable
|
||||||
// array (passed in to the traversal)
|
// array (passed in to the traversal)
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
struct NewNameFinderContext {
|
pub struct NewNameFinderContext {
|
||||||
ident_accumulator: Vec<ast::Ident> ,
|
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,
|
renames: &'a mut RenameList,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ This API is completely unstable and subject to change.
|
||||||
#[feature(quote)];
|
#[feature(quote)];
|
||||||
|
|
||||||
#[deny(non_camel_case_types)];
|
#[deny(non_camel_case_types)];
|
||||||
#[allow(visible_private_types)];
|
|
||||||
|
|
||||||
extern crate serialize;
|
extern crate serialize;
|
||||||
extern crate term;
|
extern crate term;
|
||||||
|
|
|
@ -87,7 +87,7 @@ use std::vec_ng;
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
enum restriction {
|
pub enum restriction {
|
||||||
UNRESTRICTED,
|
UNRESTRICTED,
|
||||||
RESTRICT_STMT_EXPR,
|
RESTRICT_STMT_EXPR,
|
||||||
RESTRICT_NO_BAR_OP,
|
RESTRICT_NO_BAR_OP,
|
||||||
|
|
|
@ -139,12 +139,12 @@ pub fn buf_str(toks: Vec<Token> , szs: Vec<int> , left: uint, right: uint,
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PrintStackBreak {
|
pub enum PrintStackBreak {
|
||||||
Fits,
|
Fits,
|
||||||
Broken(Breaks),
|
Broken(Breaks),
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PrintStackElem {
|
pub struct PrintStackElem {
|
||||||
offset: int,
|
offset: int,
|
||||||
pbreak: PrintStackBreak
|
pbreak: PrintStackBreak
|
||||||
}
|
}
|
||||||
|
|
|
@ -1027,7 +1027,7 @@ pub fn print_block_with_attrs(s: &mut State,
|
||||||
true)
|
true)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum EmbedType {
|
pub enum EmbedType {
|
||||||
BlockBlockFn,
|
BlockBlockFn,
|
||||||
BlockNormal,
|
BlockNormal,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue