diff --git a/src/librustc/back/archive.rs b/src/librustc/back/archive.rs index 786be3798a1..d6173176c16 100644 --- a/src/librustc/back/archive.rs +++ b/src/librustc/back/archive.rs @@ -28,12 +28,12 @@ use syntax::abi; pub static METADATA_FILENAME: &'static str = "rust.metadata.bin"; pub struct Archive<'a> { - priv sess: &'a Session, - priv dst: Path, + sess: &'a Session, + dst: Path, } pub struct ArchiveRO { - priv ptr: ArchiveRef, + ptr: ArchiveRef, } fn run_ar(sess: &Session, args: &str, cwd: Option<&Path>, diff --git a/src/librustc/back/svh.rs b/src/librustc/back/svh.rs index a34323d6ddc..a2c579d13f4 100644 --- a/src/librustc/back/svh.rs +++ b/src/librustc/back/svh.rs @@ -54,7 +54,7 @@ use syntax::ast; #[deriving(Clone, Eq)] pub struct Svh { - priv hash: ~str, + hash: ~str, } impl Svh { diff --git a/src/librustc/back/target_strs.rs b/src/librustc/back/target_strs.rs index f046069bc0b..e8cdbbdad48 100644 --- a/src/librustc/back/target_strs.rs +++ b/src/librustc/back/target_strs.rs @@ -11,9 +11,9 @@ #![allow(non_camel_case_types)] pub struct t { - module_asm: ~str, - meta_sect_name: ~str, - data_layout: ~str, - target_triple: ~str, - cc_args: Vec<~str> , + pub module_asm: ~str, + pub meta_sect_name: ~str, + pub data_layout: ~str, + pub target_triple: ~str, + pub cc_args: Vec<~str> , } diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index 28720871c8e..d5dba02ed28 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -270,12 +270,12 @@ pub fn phase_2_configure_and_expand(sess: &Session, } pub struct CrateAnalysis { - exp_map2: middle::resolve::ExportMap2, - exported_items: middle::privacy::ExportedItems, - public_items: middle::privacy::PublicItems, - ty_cx: ty::ctxt, - maps: astencode::Maps, - reachable: NodeSet, + pub exp_map2: middle::resolve::ExportMap2, + pub exported_items: middle::privacy::ExportedItems, + pub public_items: middle::privacy::PublicItems, + pub ty_cx: ty::ctxt, + pub maps: astencode::Maps, + pub reachable: NodeSet, } /// Run the resolution, typechecking, region checking and other @@ -409,12 +409,12 @@ pub fn phase_3_run_analysis_passes(sess: Session, } pub struct CrateTranslation { - context: ContextRef, - module: ModuleRef, - metadata_module: ModuleRef, - link: LinkMeta, - metadata: Vec , - reachable: Vec<~str> , + pub context: ContextRef, + pub module: ModuleRef, + pub metadata_module: ModuleRef, + pub link: LinkMeta, + pub metadata: Vec, + pub reachable: Vec<~str>, } /// Run the translation phase to LLVM, after which the AST and analysis can @@ -1124,9 +1124,9 @@ pub fn optgroups() -> Vec { } pub struct OutputFilenames { - out_directory: Path, - out_filestem: ~str, - single_output_file: Option, + pub out_directory: Path, + pub out_filestem: ~str, + pub single_output_file: Option, } impl OutputFilenames { diff --git a/src/librustc/driver/session.rs b/src/librustc/driver/session.rs index 29bf5b9c93f..c2fec3871ab 100644 --- a/src/librustc/driver/session.rs +++ b/src/librustc/driver/session.rs @@ -31,11 +31,11 @@ use std::cell::{Cell, RefCell}; use collections::HashSet; pub struct Config { - os: abi::Os, - arch: abi::Architecture, - target_strs: target_strs::t, - int_type: IntTy, - uint_type: UintTy, + pub os: abi::Os, + pub arch: abi::Architecture, + pub target_strs: target_strs::t, + pub int_type: IntTy, + pub uint_type: UintTy, } macro_rules! debugging_opts( @@ -124,34 +124,34 @@ pub enum DebugInfoLevel { pub struct Options { // The crate config requested for the session, which may be combined // with additional crate configurations during the compile process - crate_types: Vec , + pub crate_types: Vec , - gc: bool, - optimize: OptLevel, - debuginfo: DebugInfoLevel, - lint_opts: Vec<(lint::Lint, lint::level)> , - output_types: Vec , + pub gc: bool, + pub optimize: OptLevel, + pub debuginfo: DebugInfoLevel, + pub lint_opts: Vec<(lint::Lint, lint::level)> , + pub output_types: Vec , // This was mutable for rustpkg, which updates search paths based on the // parsed code. It remains mutable in case its replacements wants to use // this. - addl_lib_search_paths: RefCell>, - maybe_sysroot: Option, - target_triple: ~str, + pub addl_lib_search_paths: RefCell>, + pub maybe_sysroot: Option, + pub target_triple: ~str, // User-specified cfg meta items. The compiler itself will add additional // items to the crate config, and during parsing the entire crate config // will be added to the crate AST node. This should not be used for // anything except building the full crate config prior to parsing. - cfg: ast::CrateConfig, - test: bool, - parse_only: bool, - no_trans: bool, - no_analysis: bool, - debugging_opts: u64, + pub cfg: ast::CrateConfig, + pub test: bool, + pub parse_only: bool, + pub no_trans: bool, + pub no_analysis: bool, + pub debugging_opts: u64, /// Whether to write dependency files. It's (enabled, optional filename). - write_dependency_info: (bool, Option), + pub write_dependency_info: (bool, Option), /// Crate id-related things to maybe print. It's (crate_id, crate_name, crate_file_name). - print_metas: (bool, bool, bool), - cg: CodegenOptions, + pub print_metas: (bool, bool, bool), + pub cg: CodegenOptions, } // The type of entry function, so @@ -174,28 +174,28 @@ pub enum CrateType { } pub struct Session { - targ_cfg: Config, - opts: Options, - cstore: metadata::cstore::CStore, - parse_sess: ParseSess, + pub targ_cfg: Config, + pub opts: Options, + pub cstore: metadata::cstore::CStore, + pub parse_sess: ParseSess, // For a library crate, this is always none - entry_fn: RefCell>, - entry_type: Cell>, - macro_registrar_fn: RefCell>, - default_sysroot: Option, - building_library: Cell, + pub entry_fn: RefCell>, + pub entry_type: Cell>, + pub macro_registrar_fn: RefCell>, + pub default_sysroot: Option, + pub building_library: Cell, // The name of the root source file of the crate, in the local file system. The path is always // expected to be absolute. `None` means that there is no source file. - local_crate_source_file: Option, - working_dir: Path, - lints: RefCell>>, - node_id: Cell, - crate_types: RefCell>, - features: front::feature_gate::Features, + pub local_crate_source_file: Option, + pub working_dir: Path, + pub lints: RefCell>>, + pub node_id: Cell, + pub crate_types: RefCell>, + pub features: front::feature_gate::Features, /// The maximum recursion limit for potentially infinitely recursive /// operations such as auto-dereference and monomorphization. - recursion_limit: Cell, + pub recursion_limit: Cell, } impl Session { @@ -365,7 +365,7 @@ macro_rules! cgoptions( ($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) => ( #[deriving(Clone)] - pub struct CodegenOptions { $($opt: $t),* } + pub struct CodegenOptions { $(pub $opt: $t),* } pub fn basic_codegen_options() -> CodegenOptions { CodegenOptions { $($opt: $init),* } diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs index c3743db8adc..22de214cc12 100644 --- a/src/librustc/front/feature_gate.rs +++ b/src/librustc/front/feature_gate.rs @@ -74,7 +74,7 @@ enum Status { /// A set of features to be used by later passes. pub struct Features { - default_type_params: Cell + pub default_type_params: Cell } impl Features { diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 59b08d90ca0..3aac4f6b72e 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -31,6 +31,9 @@ This API is completely unstable and subject to change. #![feature(macro_rules, globs, struct_variant, managed_boxes, quote, default_type_params, phase)] +#![allow(visible_private_types)] // NOTE: remove after a stage0 snap +#![allow(unrecognized_lint)] // NOTE: remove after a stage0 snap + extern crate flate; extern crate arena; extern crate syntax; diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index 6f20e46a6ef..d9e1b779e96 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -1878,7 +1878,7 @@ impl TypeNames { /* Memory-managed interface to target data. */ pub struct target_data_res { - td: TargetDataRef, + pub td: TargetDataRef, } impl Drop for target_data_res { @@ -1896,7 +1896,7 @@ pub fn target_data_res(td: TargetDataRef) -> target_data_res { } pub struct TargetData { - lltd: TargetDataRef, + pub lltd: TargetDataRef, dtor: @target_data_res } @@ -1914,7 +1914,7 @@ pub fn mk_target_data(string_rep: &str) -> TargetData { /* Memory-managed interface to pass managers. */ pub struct pass_manager_res { - pm: PassManagerRef, + pub pm: PassManagerRef, } impl Drop for pass_manager_res { @@ -1932,7 +1932,7 @@ pub fn pass_manager_res(pm: PassManagerRef) -> pass_manager_res { } pub struct PassManager { - llpm: PassManagerRef, + pub llpm: PassManagerRef, dtor: @pass_manager_res } @@ -1950,7 +1950,7 @@ pub fn mk_pass_manager() -> PassManager { /* Memory-managed interface to object files. */ pub struct ObjectFile { - llof: ObjectFileRef, + pub llof: ObjectFileRef, } impl ObjectFile { @@ -1981,7 +1981,7 @@ impl Drop for ObjectFile { /* Memory-managed interface to section iterators. */ pub struct section_iter_res { - si: SectionIteratorRef, + pub si: SectionIteratorRef, } impl Drop for section_iter_res { @@ -1999,7 +1999,7 @@ pub fn section_iter_res(si: SectionIteratorRef) -> section_iter_res { } pub struct SectionIter { - llsi: SectionIteratorRef, + pub llsi: SectionIteratorRef, dtor: @section_iter_res } diff --git a/src/librustc/metadata/common.rs b/src/librustc/metadata/common.rs index 5a36a610e27..09d3b36321f 100644 --- a/src/librustc/metadata/common.rs +++ b/src/librustc/metadata/common.rs @@ -210,6 +210,6 @@ pub static tag_macro_def: uint = 0x65; #[deriving(Clone, Show)] pub struct LinkMeta { - crateid: CrateId, - crate_hash: Svh, + pub crateid: CrateId, + pub crate_hash: Svh, } diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 138c163d612..36febfc1a09 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -371,7 +371,7 @@ fn resolve_crate_deps(e: &mut Env, } pub struct Loader<'a> { - priv env: Env<'a>, + env: Env<'a>, } impl<'a> Loader<'a> { diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index 52c9964750f..d840ca32938 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -26,10 +26,10 @@ use syntax::diagnostic::expect; use syntax::parse::token; pub struct StaticMethodInfo { - ident: ast::Ident, - def_id: ast::DefId, - purity: ast::Purity, - vis: ast::Visibility, + pub ident: ast::Ident, + pub def_id: ast::DefId, + pub purity: ast::Purity, + pub vis: ast::Visibility, } pub fn get_symbol(cstore: &cstore::CStore, def: ast::DefId) -> ~str { diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index f57b2610d43..62fcc4c617e 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -37,10 +37,10 @@ pub enum MetadataBlob { } pub struct crate_metadata { - name: ~str, - data: MetadataBlob, - cnum_map: cnum_map, - cnum: ast::CrateNum + pub name: ~str, + pub data: MetadataBlob, + pub cnum_map: cnum_map, + pub cnum: ast::CrateNum, } #[deriving(Eq)] @@ -60,18 +60,18 @@ pub enum NativeLibaryKind { // must be non-None. #[deriving(Eq, Clone)] pub struct CrateSource { - dylib: Option, - rlib: Option, - cnum: ast::CrateNum, + pub dylib: Option, + pub rlib: Option, + pub cnum: ast::CrateNum, } pub struct CStore { - priv metas: RefCell>, - priv extern_mod_crate_map: RefCell, - priv used_crate_sources: RefCell >, - priv used_libraries: RefCell >, - priv used_link_args: RefCell >, - intr: Rc + metas: RefCell>, + extern_mod_crate_map: RefCell, + used_crate_sources: RefCell>, + used_libraries: RefCell>, + used_link_args: RefCell>, + pub intr: Rc, } // Map from NodeId's of local extern crate statements to crate numbers diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index 6cc16b0bfc9..94941913a8b 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -1108,9 +1108,9 @@ pub fn get_crate_attributes(data: &[u8]) -> Vec { #[deriving(Clone)] pub struct CrateDep { - cnum: ast::CrateNum, - crate_id: CrateId, - hash: Svh, + pub cnum: ast::CrateNum, + pub crate_id: CrateId, + pub hash: Svh, } pub fn get_crate_deps(data: &[u8]) -> Vec { diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index e30a5247f7f..1da698beb38 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -69,14 +69,14 @@ pub type EncodeInlinedItem<'a> = 'a |ecx: &EncodeContext, ii: InlinedItemRef|; pub struct EncodeParams<'a> { - diag: &'a SpanHandler, - tcx: &'a ty::ctxt, - reexports2: middle::resolve::ExportMap2, - item_symbols: &'a RefCell>, - non_inlineable_statics: &'a RefCell, - link_meta: &'a LinkMeta, - cstore: &'a cstore::CStore, - encode_inlined_item: EncodeInlinedItem<'a>, + pub diag: &'a SpanHandler, + pub tcx: &'a ty::ctxt, + pub reexports2: middle::resolve::ExportMap2, + pub item_symbols: &'a RefCell>, + pub non_inlineable_statics: &'a RefCell, + pub link_meta: &'a LinkMeta, + pub cstore: &'a cstore::CStore, + pub encode_inlined_item: EncodeInlinedItem<'a>, } pub struct Stats { @@ -96,16 +96,16 @@ pub struct Stats { } pub struct EncodeContext<'a> { - diag: &'a SpanHandler, - tcx: &'a ty::ctxt, - stats: @Stats, - reexports2: middle::resolve::ExportMap2, - item_symbols: &'a RefCell>, - non_inlineable_statics: &'a RefCell, - link_meta: &'a LinkMeta, - cstore: &'a cstore::CStore, - encode_inlined_item: EncodeInlinedItem<'a>, - type_abbrevs: abbrev_map, + pub diag: &'a SpanHandler, + pub tcx: &'a ty::ctxt, + pub stats: @Stats, + pub reexports2: middle::resolve::ExportMap2, + pub item_symbols: &'a RefCell>, + pub non_inlineable_statics: &'a RefCell, + pub link_meta: &'a LinkMeta, + pub cstore: &'a cstore::CStore, + pub encode_inlined_item: EncodeInlinedItem<'a>, + pub type_abbrevs: abbrev_map, } fn encode_name(ebml_w: &mut Encoder, name: Name) { diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 5313473739f..468eac4d269 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -26,9 +26,9 @@ pub enum FileMatch { FileMatches, FileDoesntMatch } pub type pick<'a> = 'a |path: &Path| -> FileMatch; pub struct FileSearch<'a> { - sysroot: &'a Path, - addl_lib_search_paths: &'a RefCell>, - target_triple: &'a str + pub sysroot: &'a Path, + pub addl_lib_search_paths: &'a RefCell>, + pub target_triple: &'a str } impl<'a> FileSearch<'a> { diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 6de1bf69f6d..8a3d6567c77 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -46,27 +46,27 @@ pub enum Os { } pub struct Context<'a> { - sess: &'a Session, - span: Span, - ident: &'a str, - crate_id: &'a CrateId, - id_hash: &'a str, - hash: Option<&'a Svh>, - os: Os, - intr: Rc, - rejected_via_hash: bool, + pub sess: &'a Session, + pub span: Span, + pub ident: &'a str, + pub crate_id: &'a CrateId, + pub id_hash: &'a str, + pub hash: Option<&'a Svh>, + pub os: Os, + pub intr: Rc, + pub rejected_via_hash: bool, } pub struct Library { - dylib: Option, - rlib: Option, - metadata: MetadataBlob, + pub dylib: Option, + pub rlib: Option, + pub metadata: MetadataBlob, } pub struct ArchiveMetadata { - priv archive: ArchiveRO, + archive: ArchiveRO, // See comments in ArchiveMetadata::new for why this is static - priv data: &'static [u8], + data: &'static [u8], } // FIXME(#11857) this should be a "real" realpath diff --git a/src/librustc/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs index 446e42224dd..7e8480e4311 100644 --- a/src/librustc/metadata/tyencode.rs +++ b/src/librustc/metadata/tyencode.rs @@ -34,12 +34,12 @@ macro_rules! mywrite( ($wr:expr, $($arg:tt)*) => ( ) ) pub struct ctxt<'a> { - diag: &'a SpanHandler, + pub diag: &'a SpanHandler, // Def -> str Callback: - ds: fn(DefId) -> ~str, + pub ds: fn(DefId) -> ~str, // The type context. - tcx: &'a ty::ctxt, - abbrevs: abbrev_ctxt + pub tcx: &'a ty::ctxt, + pub abbrevs: abbrev_ctxt } // Compact string representation for ty.t values. API ty_str & parse_from_str. diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index bd9d206c5b3..383739a1b03 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -53,10 +53,10 @@ use writer = serialize::ebml::writer; // Auxiliary maps of things to be encoded pub struct Maps { - root_map: middle::borrowck::root_map, - method_map: middle::typeck::MethodMap, - vtable_map: middle::typeck::vtable_map, - capture_map: RefCell, + pub root_map: middle::borrowck::root_map, + pub method_map: middle::typeck::MethodMap, + pub vtable_map: middle::typeck::vtable_map, + pub capture_map: RefCell, } struct DecodeContext<'a> { diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 30b965082ca..b8b05128e4c 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -207,8 +207,8 @@ pub struct BorrowStats { // is T, which is not a box. #[deriving(Eq, TotalEq, Hash)] pub struct root_map_key { - id: ast::NodeId, - derefs: uint + pub id: ast::NodeId, + pub derefs: uint } pub type BckResult = Result; @@ -378,7 +378,7 @@ impl Repr for RestrictionSet { // uncovered after a certain number of auto-derefs. pub struct RootInfo { - scope: ast::NodeId, + pub scope: ast::NodeId, } pub type root_map = @RefCell>; diff --git a/src/librustc/middle/borrowck/move_data.rs b/src/librustc/middle/borrowck/move_data.rs index 22bacca5485..0e18946a3a1 100644 --- a/src/librustc/middle/borrowck/move_data.rs +++ b/src/librustc/middle/borrowck/move_data.rs @@ -30,37 +30,37 @@ use util::ppaux::Repr; pub struct MoveData { /// Move paths. See section "Move paths" in `doc.rs`. - paths: RefCell>, + pub paths: RefCell>, /// Cache of loan path to move path index, for easy lookup. - path_map: RefCell>, + pub path_map: RefCell>, /// Each move or uninitialized variable gets an entry here. - moves: RefCell>, + pub moves: RefCell>, /// Assignments to a variable, like `x = foo`. These are assigned /// bits for dataflow, since we must track them to ensure that /// immutable variables are assigned at most once along each path. - var_assignments: RefCell>, + pub var_assignments: RefCell>, /// Assignments to a path, like `x.f = foo`. These are not /// assigned dataflow bits, but we track them because they still /// kill move bits. - path_assignments: RefCell>, + pub path_assignments: RefCell>, /// Assignments to a variable or path, like `x = foo`, but not `x += foo`. - assignee_ids: RefCell>, + pub assignee_ids: RefCell>, } pub struct FlowedMoveData<'a> { - move_data: MoveData, + pub move_data: MoveData, - dfcx_moves: MoveDataFlow<'a>, + pub dfcx_moves: MoveDataFlow<'a>, // We could (and maybe should, for efficiency) combine both move // and assign data flow into one, but this way it's easier to // distinguish the bits that correspond to moves and assignments. - dfcx_assign: AssignDataFlow<'a> + pub dfcx_assign: AssignDataFlow<'a> } /// Index into `MoveData.paths`, used like a pointer @@ -97,21 +97,21 @@ static InvalidMoveIndex: MoveIndex = pub struct MovePath { /// Loan path corresponding to this move path - loan_path: @LoanPath, + pub loan_path: @LoanPath, /// Parent pointer, `InvalidMovePathIndex` if root - parent: MovePathIndex, + pub parent: MovePathIndex, /// Head of linked list of moves to this path, /// `InvalidMoveIndex` if not moved - first_move: MoveIndex, + pub first_move: MoveIndex, /// First node in linked list of children, `InvalidMovePathIndex` if leaf - first_child: MovePathIndex, + pub first_child: MovePathIndex, /// Next node in linked list of parent's children (siblings), /// `InvalidMovePathIndex` if none. - next_sibling: MovePathIndex, + pub next_sibling: MovePathIndex, } pub enum MoveKind { @@ -123,27 +123,27 @@ pub enum MoveKind { pub struct Move { /// Path being moved. - path: MovePathIndex, + pub path: MovePathIndex, /// id of node that is doing the move. - id: ast::NodeId, + pub id: ast::NodeId, /// Kind of move, for error messages. - kind: MoveKind, + pub kind: MoveKind, /// Next node in linked list of moves from `path`, or `InvalidMoveIndex` - next_move: MoveIndex + pub next_move: MoveIndex } pub struct Assignment { /// Path being assigned. - path: MovePathIndex, + pub path: MovePathIndex, /// id where assignment occurs - id: ast::NodeId, + pub id: ast::NodeId, /// span of node where assignment occurs - span: Span, + pub span: Span, } pub struct MoveDataFlowOperator; diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index 178688917e8..2adc3e82576 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -31,21 +31,21 @@ use util::nodemap::NodeMap; #[deriving(Clone)] pub struct DataFlowContext<'a, O> { - priv tcx: &'a ty::ctxt, - priv method_map: typeck::MethodMap, + tcx: &'a ty::ctxt, + method_map: typeck::MethodMap, /// the data flow operator - priv oper: O, + oper: O, /// number of bits to propagate per id - priv bits_per_id: uint, + bits_per_id: uint, /// number of words we will use to store bits_per_id. /// equal to bits_per_id/uint::BITS rounded up. - priv words_per_id: uint, + words_per_id: uint, // mapping from node to bitset index. - priv nodeid_to_bitset: NodeMap, + nodeid_to_bitset: NodeMap, // Bit sets per id. The following three fields (`gens`, `kills`, // and `on_entry`) all have the same structure. For each id in @@ -54,14 +54,15 @@ pub struct DataFlowContext<'a, O> { // the full vector (see the method `compute_id_range()`). /// bits generated as we exit the scope `id`. Updated by `add_gen()`. - priv gens: Vec , + gens: Vec, /// bits killed as we exit the scope `id`. Updated by `add_kill()`. - priv kills: Vec , + kills: Vec, /// bits that are valid on entry to the scope `id`. Updated by /// `propagate()`. - priv on_entry: Vec } + on_entry: Vec, +} /// Parameterization for the precise form of data flow that is used. pub trait DataFlowOperator { diff --git a/src/librustc/middle/freevars.rs b/src/librustc/middle/freevars.rs index c2ea2f45964..d8851fa46f8 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -26,8 +26,8 @@ use syntax::visit::Visitor; // (The def_upvar will already have been stripped). #[deriving(Encodable, Decodable)] pub struct freevar_entry { - def: ast::Def, //< The variable being accessed free. - span: Span //< First span where it is accessed (there can be multiple) + pub def: ast::Def, //< The variable being accessed free. + pub span: Span //< First span where it is accessed (there can be multiple) } pub type freevar_info = @Vec<@freevar_entry> ; pub type freevar_map = NodeMap; diff --git a/src/librustc/middle/graph.rs b/src/librustc/middle/graph.rs index 66539c63d53..fd27cabaf7f 100644 --- a/src/librustc/middle/graph.rs +++ b/src/librustc/middle/graph.rs @@ -37,20 +37,20 @@ be indexed by the direction (see the type `Direction`). use std::uint; pub struct Graph { - priv nodes: Vec> , - priv edges: Vec> , + nodes: Vec> , + edges: Vec> , } pub struct Node { - priv first_edge: [EdgeIndex, ..2], // see module comment - data: N, + first_edge: [EdgeIndex, ..2], // see module comment + pub data: N, } pub struct Edge { - priv next_edge: [EdgeIndex, ..2], // see module comment - priv source: NodeIndex, - priv target: NodeIndex, - data: E, + next_edge: [EdgeIndex, ..2], // see module comment + source: NodeIndex, + target: NodeIndex, + pub data: E, } #[deriving(Eq)] @@ -62,7 +62,7 @@ pub struct EdgeIndex(uint); pub static InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX); // Use a private field here to guarantee no more instances are created: -pub struct Direction { priv repr: uint } +pub struct Direction { repr: uint } pub static Outgoing: Direction = Direction { repr: 0 }; pub static Incoming: Direction = Direction { repr: 1 }; diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index f93d90d2735..86db6b6a463 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -47,7 +47,7 @@ pub enum LangItem { } pub struct LanguageItems { - items: Vec> , + pub items: Vec> , } impl LanguageItems { diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 85717837336..97f5cca1cab 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -135,9 +135,9 @@ pub enum level { #[deriving(Clone, Eq, Ord, TotalEq, TotalOrd)] pub struct LintSpec { - default: level, - lint: Lint, - desc: &'static str, + pub default: level, + pub lint: Lint, + pub desc: &'static str, } pub type LintDict = HashMap<&'static str, LintSpec>; diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index acccbe164c3..3604499add6 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -90,8 +90,8 @@ pub enum categorization { #[deriving(Eq)] pub struct CopiedUpvar { - upvar_id: ast::NodeId, - onceness: ast::Onceness, + pub upvar_id: ast::NodeId, + pub onceness: ast::Onceness, } // different kinds of pointers: @@ -147,11 +147,11 @@ pub enum MutabilityCategory { // fashion. For more details, see the method `cat_pattern` #[deriving(Eq)] pub struct cmt_ { - id: ast::NodeId, // id of expr/pat producing this value - span: Span, // span of same expr/pat - cat: categorization, // categorization of expr - mutbl: MutabilityCategory, // mutability of expr as lvalue - ty: ty::t // type of the expr (*see WARNING above*) + pub id: ast::NodeId, // id of expr/pat producing this value + pub span: Span, // span of same expr/pat + pub cat: categorization, // categorization of expr + pub mutbl: MutabilityCategory, // mutability of expr as lvalue + pub ty: ty::t // type of the expr (*see WARNING above*) } pub type cmt = @cmt_; @@ -242,7 +242,7 @@ impl ast_node for ast::Pat { } pub struct MemCategorizationContext { - typer: TYPER + pub typer: TYPER } pub type McResult = Result; diff --git a/src/librustc/middle/moves.rs b/src/librustc/middle/moves.rs index b6cfff5c86f..f3ecfdefa75 100644 --- a/src/librustc/middle/moves.rs +++ b/src/librustc/middle/moves.rs @@ -153,9 +153,9 @@ pub enum CaptureMode { #[deriving(Encodable, Decodable)] pub struct CaptureVar { - def: Def, // Variable being accessed free - span: Span, // Location of an access to this variable - mode: CaptureMode // How variable is being accessed + pub def: Def, // Variable being accessed free + pub span: Span, // Location of an access to this variable + pub mode: CaptureMode // How variable is being accessed } pub type CaptureMap = NodeMap>>; @@ -163,15 +163,15 @@ pub type CaptureMap = NodeMap>>; /** See the section Output on the module comment for explanation. */ #[deriving(Clone)] pub struct MoveMaps { - moves_map: NodeSet, + pub moves_map: NodeSet, /** * Set of variable node-ids that are moved. * - * Note: The `moves_map` stores expression ids that are moves, + * pub Note: The `moves_map` stores expression ids that are moves, * whereas this set stores the ids of the variables that are * moved at some point */ - moved_variables_set: NodeSet, - capture_map: CaptureMap + pub moved_variables_set: NodeSet, + pub capture_map: CaptureMap } #[deriving(Clone)] diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 16c513f16f3..24720953912 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -75,11 +75,11 @@ The region maps encode information about region relationships. for dynamic checks and/or arbitrary amounts of stack space. */ pub struct RegionMaps { - priv scope_map: RefCell>, - priv var_map: RefCell>, - priv free_region_map: RefCell >>, - priv rvalue_scopes: RefCell>, - priv terminating_scopes: RefCell>, + scope_map: RefCell>, + var_map: RefCell>, + free_region_map: RefCell >>, + rvalue_scopes: RefCell>, + terminating_scopes: RefCell>, } #[deriving(Clone)] diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 5eb90f770dd..3e1c1828b6c 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -55,8 +55,8 @@ pub type TraitMap = NodeMap >; pub type ExportMap2 = @RefCell >>; pub struct Export2 { - name: ~str, // The name of the target. - def_id: DefId, // The definition of the target. + pub name: ~str, // The name of the target. + pub def_id: DefId, // The definition of the target. } // This set contains all exported definitions from external crates. The set does @@ -73,10 +73,10 @@ pub enum LastPrivate { // and whether the import is in fact used for each. // If the Option fields are None, it means there is no defintion // in that namespace. - LastImport{value_priv: Option, - value_used: ImportUse, - type_priv: Option, - type_used: ImportUse}, + LastImport{pub value_priv: Option, + pub value_used: ImportUse, + pub type_priv: Option, + pub type_used: ImportUse}, } pub enum PrivateDep { @@ -5408,11 +5408,11 @@ impl<'a> Resolver<'a> { } pub struct CrateMap { - def_map: DefMap, - exp_map2: ExportMap2, - trait_map: TraitMap, - external_exports: ExternalExports, - last_private_map: LastPrivateMap, + pub def_map: DefMap, + pub exp_map2: ExportMap2, + pub trait_map: TraitMap, + pub external_exports: ExternalExports, + pub last_private_map: LastPrivateMap, } /// Entry point to crate resolution. diff --git a/src/librustc/middle/trans/adt.rs b/src/librustc/middle/trans/adt.rs index 192453ca583..c727744b4c7 100644 --- a/src/librustc/middle/trans/adt.rs +++ b/src/librustc/middle/trans/adt.rs @@ -82,7 +82,7 @@ pub enum Repr { * General-case enums: for each case there is a struct, and they * all start with a field for the discriminant. */ - General(IntType, Vec ), + General(IntType, Vec), /** * Two cases distinguished by a nullable pointer: the case with discriminant * `nndiscr` is represented by the struct `nonnull`, where the `ptrfield`th @@ -94,16 +94,21 @@ pub enum Repr { * is represented such that `None` is a null pointer and `Some` is the * identity function. */ - NullablePointer{ nonnull: Struct, nndiscr: Disr, ptrfield: uint, - nullfields: Vec } + NullablePointer { + pub nonnull: Struct, + pub nndiscr: Disr, + pub ptrfield: uint, + pub nullfields: Vec, + } } /// For structs, and struct-like parts of anything fancier. pub struct Struct { - size: u64, - align: u64, - packed: bool, - fields: Vec } + pub size: u64, + pub align: u64, + pub packed: bool, + pub fields: Vec, +} /** * Convenience for `represent_type`. There should probably be more or diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index f1aa40fac59..8ac7bd1b66b 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -413,9 +413,9 @@ pub fn malloc_raw<'a>(bcx: &'a Block<'a>, t: ty::t, heap: heap) } pub struct MallocResult<'a> { - bcx: &'a Block<'a>, - smart_ptr: ValueRef, - body: ValueRef + pub bcx: &'a Block<'a>, + pub smart_ptr: ValueRef, + pub body: ValueRef } // malloc_general_dyn: usefully wraps malloc_raw_dyn; allocates a smart @@ -1647,7 +1647,7 @@ pub fn trans_enum_def(ccx: &CrateContext, enum_definition: &ast::EnumDef, } pub struct TransItemVisitor<'a> { - ccx: &'a CrateContext, + pub ccx: &'a CrateContext, } impl<'a> Visitor<()> for TransItemVisitor<'a> { diff --git a/src/librustc/middle/trans/builder.rs b/src/librustc/middle/trans/builder.rs index ff74fac95ff..2703ddddc8b 100644 --- a/src/librustc/middle/trans/builder.rs +++ b/src/librustc/middle/trans/builder.rs @@ -23,8 +23,8 @@ use std::libc::{c_uint, c_ulonglong, c_char}; use syntax::codemap::Span; pub struct Builder<'a> { - llbuilder: BuilderRef, - ccx: &'a CrateContext, + pub llbuilder: BuilderRef, + pub ccx: &'a CrateContext, } // This is a really awful way to get a zero-length c-string, but better (and a diff --git a/src/librustc/middle/trans/cabi.rs b/src/librustc/middle/trans/cabi.rs index ddd9f11034d..9ce277a7de9 100644 --- a/src/librustc/middle/trans/cabi.rs +++ b/src/librustc/middle/trans/cabi.rs @@ -35,15 +35,15 @@ pub enum ArgKind { /// This is borrowed from clang's ABIInfo.h #[deriving(Clone)] pub struct ArgType { - kind: ArgKind, + pub kind: ArgKind, /// Original LLVM type - ty: Type, + pub ty: Type, /// Coerced LLVM Type - cast: option::Option, + pub cast: option::Option, /// Dummy argument, which is emitted before the real argument - pad: option::Option, + pub pad: option::Option, /// LLVM attribute of argument - attr: option::Option + pub attr: option::Option } impl ArgType { @@ -99,10 +99,10 @@ impl ArgType { /// comments are reverse-engineered and may be inaccurate. -NDM pub struct FnType { /// The LLVM types of each argument. - arg_tys: Vec , + pub arg_tys: Vec , /// LLVM return type. - ret_ty: ArgType, + pub ret_ty: ArgType, } pub fn compute_abi_info(ccx: &CrateContext, diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index 8055d63dfff..dae48512ac2 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -54,8 +54,8 @@ use syntax::abi::AbiSet; use syntax::ast_map; pub struct MethodData { - llfn: ValueRef, - llself: ValueRef, + pub llfn: ValueRef, + pub llself: ValueRef, } pub enum CalleeData { @@ -70,8 +70,8 @@ pub enum CalleeData { } pub struct Callee<'a> { - bcx: &'a Block<'a>, - data: CalleeData + pub bcx: &'a Block<'a>, + pub data: CalleeData } fn trans<'a>(bcx: &'a Block<'a>, expr: &ast::Expr) -> Callee<'a> { diff --git a/src/librustc/middle/trans/cleanup.rs b/src/librustc/middle/trans/cleanup.rs index a977ea99ef1..06869d50fc4 100644 --- a/src/librustc/middle/trans/cleanup.rs +++ b/src/librustc/middle/trans/cleanup.rs @@ -42,7 +42,7 @@ pub struct CleanupScope<'a> { } pub struct CustomScopeIndex { - priv index: uint + index: uint } pub static EXIT_BREAK: uint = 0; diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 81a6b401d7a..dce4750969d 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -111,12 +111,12 @@ pub fn gensym_name(name: &str) -> PathElem { } pub struct tydesc_info { - ty: ty::t, - tydesc: ValueRef, - size: ValueRef, - align: ValueRef, - name: ValueRef, - visit_glue: Cell>, + pub ty: ty::t, + pub tydesc: ValueRef, + pub size: ValueRef, + pub align: ValueRef, + pub name: ValueRef, + pub visit_glue: Cell>, } /* @@ -146,8 +146,8 @@ pub struct tydesc_info { */ pub struct NodeInfo { - id: ast::NodeId, - span: Span, + pub id: ast::NodeId, + pub span: Span, } pub fn expr_info(expr: &ast::Expr) -> NodeInfo { @@ -155,22 +155,22 @@ pub fn expr_info(expr: &ast::Expr) -> NodeInfo { } pub struct Stats { - n_static_tydescs: Cell, - n_glues_created: Cell, - n_null_glues: Cell, - n_real_glues: Cell, - n_fns: Cell, - n_monos: Cell, - n_inlines: Cell, - n_closures: Cell, - n_llvm_insns: Cell, - llvm_insns: RefCell>, + pub n_static_tydescs: Cell, + pub n_glues_created: Cell, + pub n_null_glues: Cell, + pub n_real_glues: Cell, + pub n_fns: Cell, + pub n_monos: Cell, + pub n_inlines: Cell, + pub n_closures: Cell, + pub n_llvm_insns: Cell, + pub llvm_insns: RefCell>, // (ident, time-in-ms, llvm-instructions) - fn_stats: RefCell >, + pub fn_stats: RefCell >, } pub struct BuilderRef_res { - b: BuilderRef, + pub b: BuilderRef, } impl Drop for BuilderRef_res { @@ -192,10 +192,10 @@ pub type ExternMap = HashMap<~str, ValueRef>; // Here `self_ty` is the real type of the self parameter to this method. It // will only be set in the case of default methods. pub struct param_substs { - tys: Vec , - self_ty: Option, - vtables: Option, - self_vtables: Option + pub tys: Vec , + pub self_ty: Option, + pub vtables: Option, + pub self_vtables: Option } impl param_substs { @@ -228,69 +228,69 @@ pub struct FunctionContext<'a> { // address of the first instruction in the sequence of // instructions for this function that will go in the .text // section of the executable we're generating. - llfn: ValueRef, + pub llfn: ValueRef, // The environment argument in a closure. - llenv: Option, + pub llenv: Option, // The place to store the return value. If the return type is immediate, // this is an alloca in the function. Otherwise, it's the hidden first // parameter to the function. After function construction, this should // always be Some. - llretptr: Cell>, + pub llretptr: Cell>, - entry_bcx: RefCell>>, + pub entry_bcx: RefCell>>, - // These elements: "hoisted basic blocks" containing + // These pub elements: "hoisted basic blocks" containing // administrative activities that have to happen in only one place in // the function, due to LLVM's quirks. // A marker for the place where we want to insert the function's static // allocas, so that LLVM will coalesce them into a single alloca call. - alloca_insert_pt: Cell>, - llreturn: Cell>, + pub alloca_insert_pt: Cell>, + pub llreturn: Cell>, // The a value alloca'd for calls to upcalls.rust_personality. Used when // outputting the resume instruction. - personality: Cell>, + pub personality: Cell>, // True if the caller expects this fn to use the out pointer to // return. Either way, your code should write into llretptr, but if // this value is false, llretptr will be a local alloca. - caller_expects_out_pointer: bool, + pub caller_expects_out_pointer: bool, // Maps arguments to allocas created for them in llallocas. - llargs: RefCell>, + pub llargs: RefCell>, // Maps the def_ids for local variables to the allocas created for // them in llallocas. - lllocals: RefCell>, + pub lllocals: RefCell>, // Same as above, but for closure upvars - llupvars: RefCell>, + pub llupvars: RefCell>, // The NodeId of the function, or -1 if it doesn't correspond to // a user-defined function. - id: ast::NodeId, + pub id: ast::NodeId, // If this function is being monomorphized, this contains the type // substitutions used. - param_substs: Option<@param_substs>, + pub param_substs: Option<@param_substs>, // The source span and nesting context where this function comes from, for // error reporting and symbol generation. - span: Option, + pub span: Option, // The arena that blocks are allocated from. - block_arena: &'a TypedArena>, + pub block_arena: &'a TypedArena>, // This function's enclosing crate context. - ccx: &'a CrateContext, + pub ccx: &'a CrateContext, // Used and maintained by the debuginfo module. - debug_context: debuginfo::FunctionDebugContext, + pub debug_context: debuginfo::FunctionDebugContext, // Cleanup scopes. - scopes: RefCell> >, + pub scopes: RefCell> >, } impl<'a> FunctionContext<'a> { @@ -405,20 +405,20 @@ pub struct Block<'a> { // block to the function pointed to by llfn. We insert // instructions into that block by way of this block context. // The block pointing to this one in the function's digraph. - llbb: BasicBlockRef, - terminated: Cell, - unreachable: Cell, + pub llbb: BasicBlockRef, + pub terminated: Cell, + pub unreachable: Cell, // Is this block part of a landing pad? - is_lpad: bool, + pub is_lpad: bool, // AST node-id associated with this block, if any. Used for // debugging purposes only. - opt_node_id: Option, + pub opt_node_id: Option, // The function context for the function to which this block is // attached. - fcx: &'a FunctionContext<'a>, + pub fcx: &'a FunctionContext<'a>, } impl<'a> Block<'a> { @@ -493,8 +493,8 @@ impl<'a> Block<'a> { } pub struct Result<'a> { - bcx: &'a Block<'a>, - val: ValueRef + pub bcx: &'a Block<'a>, + pub val: ValueRef } pub fn rslt<'a>(bcx: &'a Block<'a>, val: ValueRef) -> Result<'a> { @@ -744,8 +744,8 @@ pub fn mono_data_classify(t: ty::t) -> MonoDataClass { #[deriving(Eq, TotalEq, Hash)] pub struct mono_id_ { - def: ast::DefId, - params: Vec } + pub def: ast::DefId, + pub params: Vec } pub type mono_id = @mono_id_; diff --git a/src/librustc/middle/trans/context.rs b/src/librustc/middle/trans/context.rs index a8ff0760eaa..a7fed4fa60d 100644 --- a/src/librustc/middle/trans/context.rs +++ b/src/librustc/middle/trans/context.rs @@ -37,39 +37,39 @@ use syntax::ast; use syntax::parse::token::InternedString; pub struct CrateContext { - llmod: ModuleRef, - llcx: ContextRef, - metadata_llmod: ModuleRef, - td: TargetData, - tn: TypeNames, - externs: RefCell, - intrinsics: HashMap<&'static str, ValueRef>, - item_vals: RefCell>, - exp_map2: resolve::ExportMap2, - reachable: NodeSet, - item_symbols: RefCell>, - link_meta: LinkMeta, - drop_glues: RefCell>, - tydescs: RefCell>, + pub llmod: ModuleRef, + pub llcx: ContextRef, + pub metadata_llmod: ModuleRef, + pub td: TargetData, + pub tn: TypeNames, + pub externs: RefCell, + pub intrinsics: HashMap<&'static str, ValueRef>, + pub item_vals: RefCell>, + pub exp_map2: resolve::ExportMap2, + pub reachable: NodeSet, + pub item_symbols: RefCell>, + pub link_meta: LinkMeta, + pub drop_glues: RefCell>, + pub tydescs: RefCell>, // Set when running emit_tydescs to enforce that no more tydescs are // created. - finished_tydescs: Cell, + pub finished_tydescs: Cell, // Track mapping of external ids to local items imported for inlining - external: RefCell>>, + pub external: RefCell>>, // Backwards version of the `external` map (inlined items to where they // came from) - external_srcs: RefCell>, + pub external_srcs: RefCell>, // A set of static items which cannot be inlined into other crates. This // will pevent in IIItem() structures from being encoded into the metadata // that is generated - non_inlineable_statics: RefCell, + pub non_inlineable_statics: RefCell, // Cache instances of monomorphized functions - monomorphized: RefCell>, - monomorphizing: RefCell>, + pub monomorphized: RefCell>, + pub monomorphizing: RefCell>, // Cache generated vtables - vtables: RefCell>, + pub vtables: RefCell>, // Cache of constant strings, - const_cstr_cache: RefCell>, + pub const_cstr_cache: RefCell>, // Reverse-direction for const ptrs cast from globals. // Key is an int, cast from a ValueRef holding a *T, @@ -79,36 +79,36 @@ pub struct CrateContext { // when we ptrcast, and we have to ptrcast during translation // of a [T] const because we form a slice, a [*T,int] pair, not // a pointer to an LLVM array type. - const_globals: RefCell>, + pub const_globals: RefCell>, // Cache of emitted const values - const_values: RefCell>, + pub const_values: RefCell>, // Cache of external const values - extern_const_values: RefCell>, + pub extern_const_values: RefCell>, - impl_method_cache: RefCell>, + pub impl_method_cache: RefCell>, // Cache of closure wrappers for bare fn's. - closure_bare_wrapper_cache: RefCell>, + pub closure_bare_wrapper_cache: RefCell>, - lltypes: RefCell>, - llsizingtypes: RefCell>, - adt_reprs: RefCell>, - symbol_hasher: RefCell, - type_hashcodes: RefCell>, - all_llvm_symbols: RefCell>, - tcx: ty::ctxt, - maps: astencode::Maps, - stats: @Stats, - int_type: Type, - opaque_vec_type: Type, - builder: BuilderRef_res, + pub lltypes: RefCell>, + pub llsizingtypes: RefCell>, + pub adt_reprs: RefCell>, + pub symbol_hasher: RefCell, + pub type_hashcodes: RefCell>, + pub all_llvm_symbols: RefCell>, + pub tcx: ty::ctxt, + pub maps: astencode::Maps, + pub stats: @Stats, + pub int_type: Type, + pub opaque_vec_type: Type, + pub builder: BuilderRef_res, // Set when at least one function uses GC. Needed so that // decl_gc_metadata knows whether to link to the module metadata, which // is not emitted by LLVM's GC pass when no functions use GC. - uses_gc: bool, - dbg_cx: Option, + pub uses_gc: bool, + pub dbg_cx: Option, } impl CrateContext { diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index 4ca2b5a47b0..9f48e4714d6 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -41,18 +41,18 @@ use syntax::codemap::Span; pub struct Datum { /// The llvm value. This is either a pointer to the Rust value or /// the value itself, depending on `kind` below. - val: ValueRef, + pub val: ValueRef, /// The rust type of the value. - ty: ty::t, + pub ty: ty::t, /// Indicates whether this is by-ref or by-value. - kind: K, + pub kind: K, } pub struct DatumBlock<'a, K> { - bcx: &'a Block<'a>, - datum: Datum, + pub bcx: &'a Block<'a>, + pub datum: Datum, } pub enum Expr { @@ -70,7 +70,7 @@ pub enum Expr { pub struct Lvalue; pub struct Rvalue { - mode: RvalueMode + pub mode: RvalueMode } pub fn Rvalue(m: RvalueMode) -> Rvalue { diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index a35dcaf868b..8236d6efb29 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -173,15 +173,15 @@ static DW_ATE_unsigned_char: c_uint = 0x08; /// A context object for maintaining all state needed by the debuginfo module. pub struct CrateDebugContext { - priv llcontext: ContextRef, - priv builder: DIBuilderRef, - priv current_debug_location: Cell, - priv created_files: RefCell>, - priv created_types: RefCell>, - priv namespace_map: RefCell , @NamespaceTreeNode>>, + llcontext: ContextRef, + builder: DIBuilderRef, + current_debug_location: Cell, + created_files: RefCell>, + created_types: RefCell>, + namespace_map: RefCell , @NamespaceTreeNode>>, // This collection is used to assert that composite types (structs, enums, ...) have their // members only set once: - priv composite_types_completed: RefCell>, + composite_types_completed: RefCell>, } impl CrateDebugContext { diff --git a/src/librustc/middle/trans/tvec.rs b/src/librustc/middle/trans/tvec.rs index c30dde3a1e2..4aac50c5355 100644 --- a/src/librustc/middle/trans/tvec.rs +++ b/src/librustc/middle/trans/tvec.rs @@ -143,11 +143,11 @@ pub fn make_drop_glue_unboxed<'a>( } pub struct VecTypes { - vec_ty: ty::t, - unit_ty: ty::t, - llunit_ty: Type, - llunit_size: ValueRef, - llunit_alloc_size: u64 + pub vec_ty: ty::t, + pub unit_ty: ty::t, + pub llunit_ty: Type, + pub llunit_size: ValueRef, + pub llunit_alloc_size: u64 } impl VecTypes { diff --git a/src/librustc/middle/trans/type_.rs b/src/librustc/middle/trans/type_.rs index ca6c0afc8b5..ca01c0532fc 100644 --- a/src/librustc/middle/trans/type_.rs +++ b/src/librustc/middle/trans/type_.rs @@ -26,7 +26,7 @@ use std::libc::{c_uint}; #[deriving(Clone, Eq, Show)] pub struct Type { - priv rf: TypeRef + rf: TypeRef } macro_rules! ty ( diff --git a/src/librustc/middle/trans/value.rs b/src/librustc/middle/trans/value.rs index 1930b4fa8b9..f66a393a50f 100644 --- a/src/librustc/middle/trans/value.rs +++ b/src/librustc/middle/trans/value.rs @@ -152,7 +152,7 @@ impl Use { /// Iterator for the users of a value pub struct Users { - priv next: Option + next: Option } impl Iterator for Users { diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index d179dc62df0..8a616496f06 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -63,8 +63,8 @@ pub static INITIAL_DISCRIMINANT_VALUE: Disr = 0; #[deriving(Eq, TotalEq, Hash)] pub struct field { - ident: ast::Ident, - mt: mt + pub ident: ast::Ident, + pub mt: mt } #[deriving(Clone)] @@ -75,16 +75,16 @@ pub enum MethodContainer { #[deriving(Clone)] pub struct Method { - ident: ast::Ident, - generics: ty::Generics, - fty: BareFnTy, - explicit_self: ast::ExplicitSelf_, - vis: ast::Visibility, - def_id: ast::DefId, - container: MethodContainer, + pub ident: ast::Ident, + pub generics: ty::Generics, + pub fty: BareFnTy, + pub explicit_self: ast::ExplicitSelf_, + pub vis: ast::Visibility, + pub def_id: ast::DefId, + pub container: MethodContainer, // If this method is provided, we need to know where it came from - provided_source: Option + pub provided_source: Option } impl Method { @@ -118,14 +118,15 @@ impl Method { } pub struct Impl { - did: DefId, - ident: Ident, - methods: Vec<@Method> } + pub did: DefId, + pub ident: Ident, + pub methods: Vec<@Method>, +} #[deriving(Clone, Eq, TotalEq, Hash)] pub struct mt { - ty: t, - mutbl: ast::Mutability, + pub ty: t, + pub mutbl: ast::Mutability, } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash, Show)] @@ -142,18 +143,18 @@ pub enum TraitStore { } pub struct field_ty { - name: Name, - id: DefId, - vis: ast::Visibility, + pub name: Name, + pub id: DefId, + pub vis: ast::Visibility, } // Contains information needed to resolve types and (in the future) look up // the types of AST nodes. #[deriving(Eq, TotalEq, Hash)] pub struct creader_cache_key { - cnum: CrateNum, - pos: uint, - len: uint + pub cnum: CrateNum, + pub pos: uint, + pub len: uint } pub type creader_cache = RefCell>; @@ -191,9 +192,9 @@ pub enum ast_ty_to_ty_cache_entry { #[deriving(Clone, Eq, Decodable, Encodable)] pub struct ItemVariances { - self_param: Option, - type_params: OwnedSlice, - region_params: OwnedSlice + pub self_param: Option, + pub type_params: OwnedSlice, + pub region_params: OwnedSlice } #[deriving(Clone, Eq, Decodable, Encodable, Show)] @@ -216,8 +217,8 @@ pub enum AutoAdjustment { #[deriving(Decodable, Encodable)] pub struct AutoDerefRef { - autoderefs: uint, - autoref: Option + pub autoderefs: uint, + pub autoref: Option } #[deriving(Decodable, Encodable, Eq, Show)] @@ -247,112 +248,112 @@ pub enum AutoRef { pub struct ctxt { // Specifically use a speedy hash algorithm for this hash map, it's used // quite often. - interner: RefCell>, - next_id: Cell, - sess: Session, - def_map: resolve::DefMap, + pub interner: RefCell>, + pub next_id: Cell, + pub sess: Session, + pub def_map: resolve::DefMap, - named_region_map: resolve_lifetime::NamedRegionMap, + pub named_region_map: resolve_lifetime::NamedRegionMap, - region_maps: middle::region::RegionMaps, + pub region_maps: middle::region::RegionMaps, // Stores the types for various nodes in the AST. Note that this table // is not guaranteed to be populated until after typeck. See // typeck::check::fn_ctxt for details. - node_types: node_type_table, + pub node_types: node_type_table, // Stores the type parameters which were substituted to obtain the type // of this node. This only applies to nodes that refer to entities // parameterized by type parameters, such as generic fns, types, or // other items. - node_type_substs: RefCell>>, + pub node_type_substs: RefCell>>, // Maps from a method to the method "descriptor" - methods: RefCell>, + pub methods: RefCell>, // Maps from a trait def-id to a list of the def-ids of its methods - trait_method_def_ids: RefCell >>, + pub trait_method_def_ids: RefCell >>, // A cache for the trait_methods() routine - trait_methods_cache: RefCell >>, + pub trait_methods_cache: RefCell >>, - impl_trait_cache: RefCell>>, + pub impl_trait_cache: RefCell>>, - trait_refs: RefCell>, - trait_defs: RefCell>, + pub trait_refs: RefCell>, + pub trait_defs: RefCell>, - map: ast_map::Map, - intrinsic_defs: RefCell>, - freevars: RefCell, - tcache: type_cache, - rcache: creader_cache, - short_names_cache: RefCell>, - needs_unwind_cleanup_cache: RefCell>, - tc_cache: RefCell>, - ast_ty_to_ty_cache: RefCell>, - enum_var_cache: RefCell >>, - ty_param_defs: RefCell>, - adjustments: RefCell>, - normalized_cache: RefCell>, - lang_items: @middle::lang_items::LanguageItems, + pub map: ast_map::Map, + pub intrinsic_defs: RefCell>, + pub freevars: RefCell, + pub tcache: type_cache, + pub rcache: creader_cache, + pub short_names_cache: RefCell>, + pub needs_unwind_cleanup_cache: RefCell>, + pub tc_cache: RefCell>, + pub ast_ty_to_ty_cache: RefCell>, + pub enum_var_cache: RefCell >>, + pub ty_param_defs: RefCell>, + pub adjustments: RefCell>, + pub normalized_cache: RefCell>, + pub lang_items: @middle::lang_items::LanguageItems, // A mapping of fake provided method def_ids to the default implementation - provided_method_sources: RefCell>, - supertraits: RefCell >>, + pub provided_method_sources: RefCell>, + pub supertraits: RefCell >>, // Maps from def-id of a type or region parameter to its // (inferred) variance. - item_variance_map: RefCell>, + pub item_variance_map: RefCell>, // A mapping from the def ID of an enum or struct type to the def ID // of the method that implements its destructor. If the type is not // present in this map, it does not have a destructor. This map is // populated during the coherence phase of typechecking. - destructor_for_type: RefCell>, + pub destructor_for_type: RefCell>, // A method will be in this list if and only if it is a destructor. - destructors: RefCell, + pub destructors: RefCell, // Maps a trait onto a list of impls of that trait. - trait_impls: RefCell >>>, + pub trait_impls: RefCell >>>, // Maps a def_id of a type to a list of its inherent impls. // Contains implementations of methods that are inherent to a type. // Methods in these implementations don't need to be exported. - inherent_impls: RefCell >>>, + pub inherent_impls: RefCell >>>, // Maps a def_id of an impl to an Impl structure. // Note that this contains all of the impls that we know about, // including ones in other crates. It's not clear that this is the best // way to do it. - impls: RefCell>, + pub impls: RefCell>, // Set of used unsafe nodes (functions or blocks). Unsafe nodes not // present in this set can be warned about. - used_unsafe: RefCell, + pub used_unsafe: RefCell, // Set of nodes which mark locals as mutable which end up getting used at // some point. Local variable definitions not in this set can be warned // about. - used_mut_nodes: RefCell, + pub used_mut_nodes: RefCell, // vtable resolution information for impl declarations - impl_vtables: typeck::impl_vtable_map, + pub impl_vtables: typeck::impl_vtable_map, // The set of external nominal types whose implementations have been read. // This is used for lazy resolution of methods. - populated_external_types: RefCell, + pub populated_external_types: RefCell, // The set of external traits whose implementations have been read. This // is used for lazy resolution of traits. - populated_external_traits: RefCell, + pub populated_external_traits: RefCell, // Borrows - upvar_borrow_map: RefCell, + pub upvar_borrow_map: RefCell, // These two caches are used by const_eval when decoding external statics // and variants that are found. - extern_const_statics: RefCell>>, - extern_const_variants: RefCell>>, + pub extern_const_statics: RefCell>>, + pub extern_const_variants: RefCell>>, } pub enum tbox_flag { @@ -363,7 +364,7 @@ pub enum tbox_flag { has_ty_err = 16, has_ty_bot = 32, - // a meta-flag: subst may be required if the type has parameters, a self + // a meta-pub flag: subst may be required if the type has parameters, a self // type, or references bound regions needs_subst = 1 | 2 | 8 } @@ -371,9 +372,9 @@ pub enum tbox_flag { pub type t_box = &'static t_box_; pub struct t_box_ { - sty: sty, - id: uint, - flags: uint, + pub sty: sty, + pub id: uint, + pub flags: uint, } // To reduce refcounting cost, we're representing types as unsafe pointers @@ -385,7 +386,7 @@ enum t_opaque {} #[allow(raw_pointer_deriving)] #[deriving(Clone, Eq, TotalEq, Hash)] -pub struct t { priv inner: *t_opaque } +pub struct t { inner: *t_opaque } impl fmt::Show for t { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -417,19 +418,19 @@ pub fn type_id(t: t) -> uint { get(t).id } #[deriving(Clone, Eq, TotalEq, Hash)] pub struct BareFnTy { - purity: ast::Purity, - abis: AbiSet, - sig: FnSig + pub purity: ast::Purity, + pub abis: AbiSet, + pub sig: FnSig } #[deriving(Clone, Eq, TotalEq, Hash)] pub struct ClosureTy { - purity: ast::Purity, - sigil: ast::Sigil, - onceness: ast::Onceness, - region: Region, - bounds: BuiltinBounds, - sig: FnSig, + pub purity: ast::Purity, + pub sigil: ast::Sigil, + pub onceness: ast::Onceness, + pub region: Region, + pub bounds: BuiltinBounds, + pub sig: FnSig, } /** @@ -446,16 +447,16 @@ pub struct ClosureTy { */ #[deriving(Clone, Eq, TotalEq, Hash)] pub struct FnSig { - binder_id: ast::NodeId, - inputs: Vec, - output: t, - variadic: bool + pub binder_id: ast::NodeId, + pub inputs: Vec, + pub output: t, + pub variadic: bool } #[deriving(Clone, Eq, TotalEq, Hash)] pub struct param_ty { - idx: uint, - def_id: DefId + pub idx: uint, + pub def_id: DefId } /// Representation of regions: @@ -502,8 +503,8 @@ pub enum Region { */ #[deriving(Clone, Eq, TotalEq, Hash)] pub struct UpvarId { - var_id: ast::NodeId, - closure_expr_id: ast::NodeId, + pub var_id: ast::NodeId, + pub closure_expr_id: ast::NodeId, } #[deriving(Clone, Eq, TotalEq, Hash)] @@ -603,8 +604,8 @@ pub enum BorrowKind { */ #[deriving(Eq, Clone)] pub struct UpvarBorrow { - kind: BorrowKind, - region: ty::Region, + pub kind: BorrowKind, + pub region: ty::Region, } pub type UpvarBorrowMap = HashMap; @@ -621,8 +622,8 @@ impl Region { #[deriving(Clone, Eq, Ord, TotalEq, TotalOrd, Hash, Encodable, Decodable, Show)] pub struct FreeRegion { - scope_id: NodeId, - bound_region: BoundRegion + pub scope_id: NodeId, + pub bound_region: BoundRegion } #[deriving(Clone, Eq, Ord, TotalEq, TotalOrd, Hash, Encodable, Decodable, Show)] @@ -669,9 +670,9 @@ pub enum RegionSubsts { * always substituted away to the implementing type for a trait. */ #[deriving(Clone, Eq, TotalEq, Hash)] pub struct substs { - self_ty: Option, - tps: Vec, - regions: RegionSubsts, + pub self_ty: Option, + pub tps: Vec, + pub regions: RegionSubsts, } mod primitives { @@ -759,17 +760,17 @@ pub enum sty { #[deriving(Clone, Eq, TotalEq, Hash)] pub struct TyTrait { - def_id: DefId, - substs: substs, - store: TraitStore, - mutability: ast::Mutability, - bounds: BuiltinBounds + pub def_id: DefId, + pub substs: substs, + pub store: TraitStore, + pub mutability: ast::Mutability, + pub bounds: BuiltinBounds } #[deriving(Eq, TotalEq, Hash)] pub struct TraitRef { - def_id: DefId, - substs: substs + pub def_id: DefId, + pub substs: substs } #[deriving(Clone, Eq)] @@ -788,8 +789,8 @@ pub enum terr_vstore_kind { #[deriving(Clone, Show)] pub struct expected_found { - expected: T, - found: T + pub expected: T, + pub found: T } // Data structures used in type unification @@ -830,8 +831,8 @@ pub enum type_err { #[deriving(Eq, TotalEq, Hash)] pub struct ParamBounds { - builtin_bounds: BuiltinBounds, - trait_bounds: Vec<@TraitRef> } + pub builtin_bounds: BuiltinBounds, + pub trait_bounds: Vec<@TraitRef> } pub type BuiltinBounds = EnumSet; @@ -878,7 +879,7 @@ pub struct FloatVid(uint); #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct RegionVid { - id: uint + pub id: uint } #[deriving(Clone, Eq, TotalEq, Hash)] @@ -983,16 +984,16 @@ impl fmt::Show for IntVarValue { #[deriving(Clone)] pub struct TypeParameterDef { - ident: ast::Ident, - def_id: ast::DefId, - bounds: @ParamBounds, - default: Option + pub ident: ast::Ident, + pub def_id: ast::DefId, + pub bounds: @ParamBounds, + pub default: Option } #[deriving(Encodable, Decodable, Clone)] pub struct RegionParameterDef { - name: ast::Name, - def_id: ast::DefId, + pub name: ast::Name, + pub def_id: ast::DefId, } /// Information about the type/lifetime parameters associated with an item. @@ -1000,11 +1001,11 @@ pub struct RegionParameterDef { #[deriving(Clone)] pub struct Generics { /// List of type parameters declared on the item. - type_param_defs: Rc >, + pub type_param_defs: Rc>, /// List of region parameters declared on the item. /// For a fn or method, only includes *early-bound* lifetimes. - region_param_defs: Rc >, + pub region_param_defs: Rc>, } impl Generics { @@ -1037,13 +1038,13 @@ pub struct ParameterEnvironment { /// In general, this means converting from bound parameters to /// free parameters. Since we currently represent bound/free type /// parameters in the same way, this only has an affect on regions. - free_substs: ty::substs, + pub free_substs: ty::substs, /// Bound on the Self parameter - self_param_bound: Option<@TraitRef>, + pub self_param_bound: Option<@TraitRef>, /// Bounds on each numbered type parameter - type_param_bounds: Vec , + pub type_param_bounds: Vec , } /// A polytype. @@ -1058,20 +1059,20 @@ pub struct ParameterEnvironment { /// region `&self` or to (unsubstituted) ty_param types #[deriving(Clone)] pub struct ty_param_bounds_and_ty { - generics: Generics, - ty: t + pub generics: Generics, + pub ty: t } /// As `ty_param_bounds_and_ty` but for a trait ref. pub struct TraitDef { - generics: Generics, - bounds: BuiltinBounds, - trait_ref: @ty::TraitRef, + pub generics: Generics, + pub bounds: BuiltinBounds, + pub trait_ref: @ty::TraitRef, } pub struct ty_param_substs_and_ty { - substs: ty::substs, - ty: ty::t + pub substs: ty::substs, + pub ty: ty::t } pub type type_cache = RefCell>; @@ -1841,7 +1842,7 @@ fn type_needs_unwind_cleanup_(cx: &ctxt, ty: t, * a type than to think about what is *not* contained within a type. */ pub struct TypeContents { - bits: u64 + pub bits: u64 } macro_rules! def_type_content_sets( @@ -3175,8 +3176,8 @@ impl AutoRef { } pub struct ParamsTy { - params: Vec, - ty: t + pub params: Vec, + pub ty: t } pub fn expr_ty_params_and_ty(cx: &ctxt, @@ -3850,13 +3851,13 @@ pub fn ty_to_def_id(ty: t) -> Option { // Enum information #[deriving(Clone)] pub struct VariantInfo { - args: Vec, - arg_names: Option >, - ctor_ty: t, - name: ast::Ident, - id: ast::DefId, - disr_val: Disr, - vis: Visibility + pub args: Vec, + pub arg_names: Option >, + pub ctor_ty: t, + pub name: ast::Ident, + pub id: ast::DefId, + pub disr_val: Disr, + pub vis: Visibility } impl VariantInfo { diff --git a/src/librustc/middle/ty_fold.rs b/src/librustc/middle/ty_fold.rs index 88262e8ee73..7eae2ce3d33 100644 --- a/src/librustc/middle/ty_fold.rs +++ b/src/librustc/middle/ty_fold.rs @@ -219,8 +219,8 @@ pub fn super_fold_trait_store(this: &mut T, // Some sample folders pub struct BottomUpFolder<'a> { - tcx: &'a ty::ctxt, - fldop: 'a |ty::t| -> ty::t, + pub tcx: &'a ty::ctxt, + pub fldop: 'a |ty::t| -> ty::t, } impl<'a> TypeFolder for BottomUpFolder<'a> { diff --git a/src/librustc/middle/typeck/check/_match.rs b/src/librustc/middle/typeck/check/_match.rs index 38cb48a6c7c..b6f81d94418 100644 --- a/src/librustc/middle/typeck/check/_match.rs +++ b/src/librustc/middle/typeck/check/_match.rs @@ -103,8 +103,8 @@ pub fn check_match(fcx: &FnCtxt, } pub struct pat_ctxt<'a> { - fcx: &'a FnCtxt<'a>, - map: PatIdMap, + pub fcx: &'a FnCtxt<'a>, + pub map: PatIdMap, } pub fn check_pat_variant(pcx: &pat_ctxt, pat: &ast::Pat, path: &ast::Path, diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 6a6ed9a7545..9aa98ee5f8e 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -178,9 +178,9 @@ pub enum FnKind { #[deriving(Clone)] pub struct PurityState { - def: ast::NodeId, - purity: ast::Purity, - priv from_fn: bool + pub def: ast::NodeId, + pub purity: ast::Purity, + from_fn: bool } impl PurityState { diff --git a/src/librustc/middle/typeck/check/vtable.rs b/src/librustc/middle/typeck/check/vtable.rs index 15de3bf2b5f..67cf14050ed 100644 --- a/src/librustc/middle/typeck/check/vtable.rs +++ b/src/librustc/middle/typeck/check/vtable.rs @@ -65,8 +65,8 @@ use syntax::visit::Visitor; /// A vtable context includes an inference context, a crate context, and a /// callback function to call in case of type error. pub struct VtableContext<'a> { - infcx: &'a infer::InferCtxt<'a>, - param_env: &'a ty::ParameterEnvironment, + pub infcx: &'a infer::InferCtxt<'a>, + pub param_env: &'a ty::ParameterEnvironment, } impl<'a> VtableContext<'a> { diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index 1516a7bec34..af84e915f70 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -331,9 +331,9 @@ pub trait Combine { } pub struct CombineFields<'a> { - infcx: &'a InferCtxt<'a>, - a_is_expected: bool, - trace: TypeTrace, + pub infcx: &'a InferCtxt<'a>, + pub a_is_expected: bool, + pub trace: TypeTrace, } pub fn expected_found( diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs index 7daf03d8526..41edc26e803 100644 --- a/src/librustc/middle/typeck/infer/mod.rs +++ b/src/librustc/middle/typeck/infer/mod.rs @@ -75,26 +75,26 @@ pub type fres = Result; // "fixup result" pub type CoerceResult = cres>; pub struct InferCtxt<'a> { - tcx: &'a ty::ctxt, + pub tcx: &'a ty::ctxt, // We instantiate ValsAndBindings with bounds because the // types that might instantiate a general type variable have an // order, represented by its upper and lower bounds. - ty_var_bindings: RefCell>>, - ty_var_counter: Cell, + pub ty_var_bindings: RefCell>>, + pub ty_var_counter: Cell, // Map from integral variable to the kind of integer it represents - int_var_bindings: RefCell>>, - int_var_counter: Cell, + pub int_var_counter: Cell, // Map from floating variable to the kind of float it represents - float_var_bindings: RefCell>>, - float_var_counter: Cell, + pub float_var_counter: Cell, // For region variables. - region_vars: RegionVarBindings<'a>, + pub region_vars: RegionVarBindings<'a>, } /// Why did we require that the two types be related? diff --git a/src/librustc/middle/typeck/infer/region_inference/mod.rs b/src/librustc/middle/typeck/infer/region_inference/mod.rs index 4d6d2da18bf..03b2ebcc245 100644 --- a/src/librustc/middle/typeck/infer/region_inference/mod.rs +++ b/src/librustc/middle/typeck/infer/region_inference/mod.rs @@ -104,8 +104,8 @@ pub enum RegionResolutionError { /// 'a and 'b together inside a SameRegions struct #[deriving(Clone)] pub struct SameRegions { - scope_id: ast::NodeId, - regions: Vec + pub scope_id: ast::NodeId, + pub regions: Vec } impl SameRegions { diff --git a/src/librustc/middle/typeck/infer/unify.rs b/src/librustc/middle/typeck/infer/unify.rs index 20d268bca6c..2ee4f8fedd2 100644 --- a/src/librustc/middle/typeck/infer/unify.rs +++ b/src/librustc/middle/typeck/infer/unify.rs @@ -26,14 +26,14 @@ pub enum VarValue { } pub struct ValsAndBindings { - vals: SmallIntMap>, - bindings: Vec<(V, VarValue)> , + pub vals: SmallIntMap>, + pub bindings: Vec<(V, VarValue)> , } pub struct Node { - root: V, - possible_types: T, - rank: uint, + pub root: V, + pub possible_types: T, + pub rank: uint, } pub trait UnifyVid { diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs index 72cc936f23e..efb556ecea6 100644 --- a/src/librustc/middle/typeck/mod.rs +++ b/src/librustc/middle/typeck/mod.rs @@ -108,49 +108,49 @@ pub enum MethodOrigin { #[deriving(Clone, Encodable, Decodable)] pub struct MethodParam { // the trait containing the method to be invoked - trait_id: ast::DefId, + pub trait_id: ast::DefId, // index of the method to be invoked amongst the trait's methods - method_num: uint, + pub method_num: uint, // index of the type parameter (from those that are in scope) that is // the type of the receiver - param_num: param_index, + pub param_num: param_index, // index of the bound for this type parameter which specifies the trait - bound_num: uint, + pub bound_num: uint, } // details for a method invoked with a receiver whose type is an object #[deriving(Clone, Encodable, Decodable)] pub struct MethodObject { // the (super)trait containing the method to be invoked - trait_id: ast::DefId, + pub trait_id: ast::DefId, // the actual base trait id of the object - object_trait_id: ast::DefId, + pub object_trait_id: ast::DefId, // index of the method to be invoked amongst the trait's methods - method_num: uint, + pub method_num: uint, // index into the actual runtime vtable. // the vtable is formed by concatenating together the method lists of // the base object trait and all supertraits; this is the index into // that vtable - real_index: uint, + pub real_index: uint, } #[deriving(Clone)] pub struct MethodCallee { - origin: MethodOrigin, - ty: ty::t, - substs: ty::substs + pub origin: MethodOrigin, + pub ty: ty::t, + pub substs: ty::substs } #[deriving(Clone, Eq, TotalEq, Hash, Show)] pub struct MethodCall { - expr_id: ast::NodeId, - autoderef: u32 + pub expr_id: ast::NodeId, + pub autoderef: u32 } impl MethodCall { @@ -224,9 +224,9 @@ pub type vtable_map = @RefCell>; #[deriving(Clone)] pub struct impl_res { // resolutions for any bounded params on the trait definition - trait_vtables: vtable_res, + pub trait_vtables: vtable_res, // resolutions for the trait /itself/ (and for supertraits) - self_vtables: vtable_param_res + pub self_vtables: vtable_param_res } impl Repr for impl_res { diff --git a/src/librustc/util/sha2.rs b/src/librustc/util/sha2.rs index 75d6f1f5cd1..944b1e237f9 100644 --- a/src/librustc/util/sha2.rs +++ b/src/librustc/util/sha2.rs @@ -473,7 +473,7 @@ impl Engine256 { /// The SHA-256 hash algorithm pub struct Sha256 { - priv engine: Engine256 + engine: Engine256 } impl Sha256 {