Skip to content

Commit 89fa141

Browse files
committed
rustc: Switch field privacy as necessary
1 parent 3c76f4a commit 89fa141

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+551
-541
lines changed

src/librustc/back/archive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ use syntax::abi;
2828
pub static METADATA_FILENAME: &'static str = "rust.metadata.bin";
2929

3030
pub struct Archive<'a> {
31-
priv sess: &'a Session,
32-
priv dst: Path,
31+
sess: &'a Session,
32+
dst: Path,
3333
}
3434

3535
pub struct ArchiveRO {
36-
priv ptr: ArchiveRef,
36+
ptr: ArchiveRef,
3737
}
3838

3939
fn run_ar(sess: &Session, args: &str, cwd: Option<&Path>,

src/librustc/back/svh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use syntax::ast;
5454

5555
#[deriving(Clone, Eq)]
5656
pub struct Svh {
57-
priv hash: ~str,
57+
hash: ~str,
5858
}
5959

6060
impl Svh {

src/librustc/back/target_strs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#![allow(non_camel_case_types)]
1212

1313
pub struct t {
14-
module_asm: ~str,
15-
meta_sect_name: ~str,
16-
data_layout: ~str,
17-
target_triple: ~str,
18-
cc_args: Vec<~str> ,
14+
pub module_asm: ~str,
15+
pub meta_sect_name: ~str,
16+
pub data_layout: ~str,
17+
pub target_triple: ~str,
18+
pub cc_args: Vec<~str> ,
1919
}

src/librustc/driver/driver.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,12 @@ pub fn phase_2_configure_and_expand(sess: &Session,
270270
}
271271

272272
pub struct CrateAnalysis {
273-
exp_map2: middle::resolve::ExportMap2,
274-
exported_items: middle::privacy::ExportedItems,
275-
public_items: middle::privacy::PublicItems,
276-
ty_cx: ty::ctxt,
277-
maps: astencode::Maps,
278-
reachable: NodeSet,
273+
pub exp_map2: middle::resolve::ExportMap2,
274+
pub exported_items: middle::privacy::ExportedItems,
275+
pub public_items: middle::privacy::PublicItems,
276+
pub ty_cx: ty::ctxt,
277+
pub maps: astencode::Maps,
278+
pub reachable: NodeSet,
279279
}
280280

281281
/// Run the resolution, typechecking, region checking and other
@@ -409,12 +409,12 @@ pub fn phase_3_run_analysis_passes(sess: Session,
409409
}
410410

411411
pub struct CrateTranslation {
412-
context: ContextRef,
413-
module: ModuleRef,
414-
metadata_module: ModuleRef,
415-
link: LinkMeta,
416-
metadata: Vec<u8> ,
417-
reachable: Vec<~str> ,
412+
pub context: ContextRef,
413+
pub module: ModuleRef,
414+
pub metadata_module: ModuleRef,
415+
pub link: LinkMeta,
416+
pub metadata: Vec<u8>,
417+
pub reachable: Vec<~str>,
418418
}
419419

420420
/// Run the translation phase to LLVM, after which the AST and analysis can
@@ -1124,9 +1124,9 @@ pub fn optgroups() -> Vec<getopts::OptGroup> {
11241124
}
11251125

11261126
pub struct OutputFilenames {
1127-
out_directory: Path,
1128-
out_filestem: ~str,
1129-
single_output_file: Option<Path>,
1127+
pub out_directory: Path,
1128+
pub out_filestem: ~str,
1129+
pub single_output_file: Option<Path>,
11301130
}
11311131

11321132
impl OutputFilenames {

src/librustc/driver/session.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ use std::cell::{Cell, RefCell};
3131
use collections::HashSet;
3232

3333
pub struct Config {
34-
os: abi::Os,
35-
arch: abi::Architecture,
36-
target_strs: target_strs::t,
37-
int_type: IntTy,
38-
uint_type: UintTy,
34+
pub os: abi::Os,
35+
pub arch: abi::Architecture,
36+
pub target_strs: target_strs::t,
37+
pub int_type: IntTy,
38+
pub uint_type: UintTy,
3939
}
4040

4141
macro_rules! debugging_opts(
@@ -124,34 +124,34 @@ pub enum DebugInfoLevel {
124124
pub struct Options {
125125
// The crate config requested for the session, which may be combined
126126
// with additional crate configurations during the compile process
127-
crate_types: Vec<CrateType> ,
127+
pub crate_types: Vec<CrateType> ,
128128

129-
gc: bool,
130-
optimize: OptLevel,
131-
debuginfo: DebugInfoLevel,
132-
lint_opts: Vec<(lint::Lint, lint::level)> ,
133-
output_types: Vec<back::link::OutputType> ,
129+
pub gc: bool,
130+
pub optimize: OptLevel,
131+
pub debuginfo: DebugInfoLevel,
132+
pub lint_opts: Vec<(lint::Lint, lint::level)> ,
133+
pub output_types: Vec<back::link::OutputType> ,
134134
// This was mutable for rustpkg, which updates search paths based on the
135135
// parsed code. It remains mutable in case its replacements wants to use
136136
// this.
137-
addl_lib_search_paths: RefCell<HashSet<Path>>,
138-
maybe_sysroot: Option<Path>,
139-
target_triple: ~str,
137+
pub addl_lib_search_paths: RefCell<HashSet<Path>>,
138+
pub maybe_sysroot: Option<Path>,
139+
pub target_triple: ~str,
140140
// User-specified cfg meta items. The compiler itself will add additional
141141
// items to the crate config, and during parsing the entire crate config
142142
// will be added to the crate AST node. This should not be used for
143143
// anything except building the full crate config prior to parsing.
144-
cfg: ast::CrateConfig,
145-
test: bool,
146-
parse_only: bool,
147-
no_trans: bool,
148-
no_analysis: bool,
149-
debugging_opts: u64,
144+
pub cfg: ast::CrateConfig,
145+
pub test: bool,
146+
pub parse_only: bool,
147+
pub no_trans: bool,
148+
pub no_analysis: bool,
149+
pub debugging_opts: u64,
150150
/// Whether to write dependency files. It's (enabled, optional filename).
151-
write_dependency_info: (bool, Option<Path>),
151+
pub write_dependency_info: (bool, Option<Path>),
152152
/// Crate id-related things to maybe print. It's (crate_id, crate_name, crate_file_name).
153-
print_metas: (bool, bool, bool),
154-
cg: CodegenOptions,
153+
pub print_metas: (bool, bool, bool),
154+
pub cg: CodegenOptions,
155155
}
156156

157157
// The type of entry function, so
@@ -174,28 +174,28 @@ pub enum CrateType {
174174
}
175175

176176
pub struct Session {
177-
targ_cfg: Config,
178-
opts: Options,
179-
cstore: metadata::cstore::CStore,
180-
parse_sess: ParseSess,
177+
pub targ_cfg: Config,
178+
pub opts: Options,
179+
pub cstore: metadata::cstore::CStore,
180+
pub parse_sess: ParseSess,
181181
// For a library crate, this is always none
182-
entry_fn: RefCell<Option<(NodeId, codemap::Span)>>,
183-
entry_type: Cell<Option<EntryFnType>>,
184-
macro_registrar_fn: RefCell<Option<ast::DefId>>,
185-
default_sysroot: Option<Path>,
186-
building_library: Cell<bool>,
182+
pub entry_fn: RefCell<Option<(NodeId, codemap::Span)>>,
183+
pub entry_type: Cell<Option<EntryFnType>>,
184+
pub macro_registrar_fn: RefCell<Option<ast::DefId>>,
185+
pub default_sysroot: Option<Path>,
186+
pub building_library: Cell<bool>,
187187
// The name of the root source file of the crate, in the local file system. The path is always
188188
// expected to be absolute. `None` means that there is no source file.
189-
local_crate_source_file: Option<Path>,
190-
working_dir: Path,
191-
lints: RefCell<NodeMap<Vec<(lint::Lint, codemap::Span, ~str)>>>,
192-
node_id: Cell<ast::NodeId>,
193-
crate_types: RefCell<Vec<CrateType>>,
194-
features: front::feature_gate::Features,
189+
pub local_crate_source_file: Option<Path>,
190+
pub working_dir: Path,
191+
pub lints: RefCell<NodeMap<Vec<(lint::Lint, codemap::Span, ~str)>>>,
192+
pub node_id: Cell<ast::NodeId>,
193+
pub crate_types: RefCell<Vec<CrateType>>,
194+
pub features: front::feature_gate::Features,
195195

196196
/// The maximum recursion limit for potentially infinitely recursive
197197
/// operations such as auto-dereference and monomorphization.
198-
recursion_limit: Cell<uint>,
198+
pub recursion_limit: Cell<uint>,
199199
}
200200

201201
impl Session {
@@ -365,7 +365,7 @@ macro_rules! cgoptions(
365365
($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
366366
(
367367
#[deriving(Clone)]
368-
pub struct CodegenOptions { $($opt: $t),* }
368+
pub struct CodegenOptions { $(pub $opt: $t),* }
369369

370370
pub fn basic_codegen_options() -> CodegenOptions {
371371
CodegenOptions { $($opt: $init),* }

src/librustc/front/feature_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ enum Status {
7474

7575
/// A set of features to be used by later passes.
7676
pub struct Features {
77-
default_type_params: Cell<bool>
77+
pub default_type_params: Cell<bool>
7878
}
7979

8080
impl Features {

src/librustc/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ This API is completely unstable and subject to change.
3131
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
3232
default_type_params, phase)]
3333

34+
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
35+
#![allow(unrecognized_lint)] // NOTE: remove after a stage0 snap
36+
3437
extern crate flate;
3538
extern crate arena;
3639
extern crate syntax;

src/librustc/lib/llvm.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ impl TypeNames {
18781878
/* Memory-managed interface to target data. */
18791879

18801880
pub struct target_data_res {
1881-
td: TargetDataRef,
1881+
pub td: TargetDataRef,
18821882
}
18831883

18841884
impl Drop for target_data_res {
@@ -1896,7 +1896,7 @@ pub fn target_data_res(td: TargetDataRef) -> target_data_res {
18961896
}
18971897

18981898
pub struct TargetData {
1899-
lltd: TargetDataRef,
1899+
pub lltd: TargetDataRef,
19001900
dtor: @target_data_res
19011901
}
19021902

@@ -1914,7 +1914,7 @@ pub fn mk_target_data(string_rep: &str) -> TargetData {
19141914
/* Memory-managed interface to pass managers. */
19151915

19161916
pub struct pass_manager_res {
1917-
pm: PassManagerRef,
1917+
pub pm: PassManagerRef,
19181918
}
19191919

19201920
impl Drop for pass_manager_res {
@@ -1932,7 +1932,7 @@ pub fn pass_manager_res(pm: PassManagerRef) -> pass_manager_res {
19321932
}
19331933

19341934
pub struct PassManager {
1935-
llpm: PassManagerRef,
1935+
pub llpm: PassManagerRef,
19361936
dtor: @pass_manager_res
19371937
}
19381938

@@ -1950,7 +1950,7 @@ pub fn mk_pass_manager() -> PassManager {
19501950
/* Memory-managed interface to object files. */
19511951

19521952
pub struct ObjectFile {
1953-
llof: ObjectFileRef,
1953+
pub llof: ObjectFileRef,
19541954
}
19551955

19561956
impl ObjectFile {
@@ -1981,7 +1981,7 @@ impl Drop for ObjectFile {
19811981
/* Memory-managed interface to section iterators. */
19821982

19831983
pub struct section_iter_res {
1984-
si: SectionIteratorRef,
1984+
pub si: SectionIteratorRef,
19851985
}
19861986

19871987
impl Drop for section_iter_res {
@@ -1999,7 +1999,7 @@ pub fn section_iter_res(si: SectionIteratorRef) -> section_iter_res {
19991999
}
20002000

20012001
pub struct SectionIter {
2002-
llsi: SectionIteratorRef,
2002+
pub llsi: SectionIteratorRef,
20032003
dtor: @section_iter_res
20042004
}
20052005

src/librustc/metadata/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,6 @@ pub static tag_macro_def: uint = 0x65;
210210

211211
#[deriving(Clone, Show)]
212212
pub struct LinkMeta {
213-
crateid: CrateId,
214-
crate_hash: Svh,
213+
pub crateid: CrateId,
214+
pub crate_hash: Svh,
215215
}

src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ fn resolve_crate_deps(e: &mut Env,
371371
}
372372

373373
pub struct Loader<'a> {
374-
priv env: Env<'a>,
374+
env: Env<'a>,
375375
}
376376

377377
impl<'a> Loader<'a> {

src/librustc/metadata/csearch.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ use syntax::diagnostic::expect;
2626
use syntax::parse::token;
2727

2828
pub struct StaticMethodInfo {
29-
ident: ast::Ident,
30-
def_id: ast::DefId,
31-
purity: ast::Purity,
32-
vis: ast::Visibility,
29+
pub ident: ast::Ident,
30+
pub def_id: ast::DefId,
31+
pub purity: ast::Purity,
32+
pub vis: ast::Visibility,
3333
}
3434

3535
pub fn get_symbol(cstore: &cstore::CStore, def: ast::DefId) -> ~str {

src/librustc/metadata/cstore.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ pub enum MetadataBlob {
3737
}
3838

3939
pub struct crate_metadata {
40-
name: ~str,
41-
data: MetadataBlob,
42-
cnum_map: cnum_map,
43-
cnum: ast::CrateNum
40+
pub name: ~str,
41+
pub data: MetadataBlob,
42+
pub cnum_map: cnum_map,
43+
pub cnum: ast::CrateNum,
4444
}
4545

4646
#[deriving(Eq)]
@@ -60,18 +60,18 @@ pub enum NativeLibaryKind {
6060
// must be non-None.
6161
#[deriving(Eq, Clone)]
6262
pub struct CrateSource {
63-
dylib: Option<Path>,
64-
rlib: Option<Path>,
65-
cnum: ast::CrateNum,
63+
pub dylib: Option<Path>,
64+
pub rlib: Option<Path>,
65+
pub cnum: ast::CrateNum,
6666
}
6767

6868
pub struct CStore {
69-
priv metas: RefCell<HashMap<ast::CrateNum, @crate_metadata>>,
70-
priv extern_mod_crate_map: RefCell<extern_mod_crate_map>,
71-
priv used_crate_sources: RefCell<Vec<CrateSource> >,
72-
priv used_libraries: RefCell<Vec<(~str, NativeLibaryKind)> >,
73-
priv used_link_args: RefCell<Vec<~str> >,
74-
intr: Rc<IdentInterner>
69+
metas: RefCell<HashMap<ast::CrateNum, @crate_metadata>>,
70+
extern_mod_crate_map: RefCell<extern_mod_crate_map>,
71+
used_crate_sources: RefCell<Vec<CrateSource>>,
72+
used_libraries: RefCell<Vec<(~str, NativeLibaryKind)>>,
73+
used_link_args: RefCell<Vec<~str>>,
74+
pub intr: Rc<IdentInterner>,
7575
}
7676

7777
// Map from NodeId's of local extern crate statements to crate numbers

src/librustc/metadata/decoder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,9 +1108,9 @@ pub fn get_crate_attributes(data: &[u8]) -> Vec<ast::Attribute> {
11081108

11091109
#[deriving(Clone)]
11101110
pub struct CrateDep {
1111-
cnum: ast::CrateNum,
1112-
crate_id: CrateId,
1113-
hash: Svh,
1111+
pub cnum: ast::CrateNum,
1112+
pub crate_id: CrateId,
1113+
pub hash: Svh,
11141114
}
11151115

11161116
pub fn get_crate_deps(data: &[u8]) -> Vec<CrateDep> {

0 commit comments

Comments
 (0)