Skip to content

Commit ae50912

Browse files
committed
librustc: De-export rustc. rs=deexporting
1 parent cc9999c commit ae50912

21 files changed

+415
-528
lines changed

src/librustc/middle/astencode.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ use syntax::visit;
5050
use syntax;
5151
use writer = std::ebml::writer;
5252

53-
export maps;
54-
export encode_inlined_item;
55-
export decode_inlined_item;
56-
5753
// Auxiliary maps of things to be encoded
58-
type maps = {
54+
pub type maps = {
5955
mutbl_map: middle::borrowck::mutbl_map,
6056
root_map: middle::borrowck::root_map,
6157
last_use_map: middle::liveness::last_use_map,
@@ -91,11 +87,11 @@ trait tr_intern {
9187
// ______________________________________________________________________
9288
// Top-level methods.
9389

94-
fn encode_inlined_item(ecx: @e::encode_ctxt,
95-
ebml_w: writer::Encoder,
96-
path: &[ast_map::path_elt],
97-
ii: ast::inlined_item,
98-
maps: maps) {
90+
pub fn encode_inlined_item(ecx: @e::encode_ctxt,
91+
ebml_w: writer::Encoder,
92+
path: &[ast_map::path_elt],
93+
ii: ast::inlined_item,
94+
maps: maps) {
9995
debug!("> Encoding inlined item: %s::%s (%u)",
10096
ast_map::path_to_str(path, ecx.tcx.sess.parse_sess.interner),
10197
ecx.tcx.sess.str_of(ii.ident()),
@@ -114,11 +110,12 @@ fn encode_inlined_item(ecx: @e::encode_ctxt,
114110
ebml_w.writer.tell());
115111
}
116112

117-
fn decode_inlined_item(cdata: cstore::crate_metadata,
118-
tcx: ty::ctxt,
119-
maps: maps,
120-
+path: ast_map::path,
121-
par_doc: ebml::Doc) -> Option<ast::inlined_item> {
113+
pub fn decode_inlined_item(cdata: cstore::crate_metadata,
114+
tcx: ty::ctxt,
115+
maps: maps,
116+
+path: ast_map::path,
117+
par_doc: ebml::Doc)
118+
-> Option<ast::inlined_item> {
122119
let dcx = @{cdata: cdata, tcx: tcx, maps: maps};
123120
match par_doc.opt_child(c::tag_ast) {
124121
None => None,

src/librustc/middle/capture.rs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,27 @@ use std::map;
2020
use syntax::codemap::span;
2121
use syntax::{ast, ast_util};
2222

23-
export capture_mode;
24-
export capture_var;
25-
export capture_map;
26-
export check_capture_clause;
27-
export compute_capture_vars;
28-
export cap_copy;
29-
export cap_move;
30-
export cap_drop;
31-
export cap_ref;
32-
33-
enum capture_mode {
23+
pub enum capture_mode {
3424
cap_copy, // Copy the value into the closure.
3525
cap_move, // Move the value into the closure.
3626
cap_drop, // Drop value after creating closure.
3727
cap_ref, // Reference directly from parent stack frame (block fn).
3828
}
3929

40-
type capture_var = {
30+
pub type capture_var = {
4131
def: ast::def, // Variable being accessed free
4232
span: span, // Location of access or cap item
4333
cap_item: Option<ast::capture_item>, // Capture item, if any
4434
mode: capture_mode // How variable is being accessed
4535
};
4636

47-
type capture_map = map::HashMap<ast::def_id, capture_var>;
37+
pub type capture_map = map::HashMap<ast::def_id, capture_var>;
4838

4939
// checks the capture clause for a fn_expr() and issues warnings or
5040
// errors for any irregularities which we identify.
51-
fn check_capture_clause(tcx: ty::ctxt,
52-
fn_expr_id: ast::node_id,
53-
cap_clause: ast::capture_clause) {
41+
pub fn check_capture_clause(tcx: ty::ctxt,
42+
fn_expr_id: ast::node_id,
43+
cap_clause: ast::capture_clause) {
5444
let freevars = freevars::get_freevars(tcx, fn_expr_id);
5545
let seen_defs = map::HashMap();
5646

@@ -73,10 +63,11 @@ fn check_capture_clause(tcx: ty::ctxt,
7363
}
7464
}
7565

76-
fn compute_capture_vars(tcx: ty::ctxt,
77-
fn_expr_id: ast::node_id,
78-
fn_proto: ast::Proto,
79-
cap_clause: ast::capture_clause) -> ~[capture_var] {
66+
pub fn compute_capture_vars(tcx: ty::ctxt,
67+
fn_expr_id: ast::node_id,
68+
fn_proto: ast::Proto,
69+
cap_clause: ast::capture_clause)
70+
-> ~[capture_var] {
8071
let freevars = freevars::get_freevars(tcx, fn_expr_id);
8172
let cap_map = map::HashMap();
8273

src/librustc/middle/check_const.rs

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ use std::map::HashMap;
2222
use syntax::ast::*;
2323
use syntax::{visit, ast_util, ast_map};
2424

25-
fn check_crate(sess: Session, crate: @crate, ast_map: ast_map::map,
26-
def_map: resolve::DefMap,
27-
method_map: typeck::method_map, tcx: ty::ctxt) {
25+
pub fn check_crate(sess: Session,
26+
crate: @crate,
27+
ast_map: ast_map::map,
28+
def_map: resolve::DefMap,
29+
method_map: typeck::method_map,
30+
tcx: ty::ctxt) {
2831
visit::visit_crate(*crate, false, visit::mk_vt(@visit::Visitor {
2932
visit_item: |a,b,c| check_item(sess, ast_map, def_map, a, b, c),
3033
visit_pat: check_pat,
@@ -35,9 +38,12 @@ fn check_crate(sess: Session, crate: @crate, ast_map: ast_map::map,
3538
sess.abort_if_errors();
3639
}
3740

38-
fn check_item(sess: Session, ast_map: ast_map::map,
39-
def_map: resolve::DefMap,
40-
it: @item, &&_is_const: bool, v: visit::vt<bool>) {
41+
pub fn check_item(sess: Session,
42+
ast_map: ast_map::map,
43+
def_map: resolve::DefMap,
44+
it: @item,
45+
&&_is_const: bool,
46+
v: visit::vt<bool>) {
4147
match it.node {
4248
item_const(_, ex) => {
4349
(v.visit_expr)(ex, true, v);
@@ -54,7 +60,7 @@ fn check_item(sess: Session, ast_map: ast_map::map,
5460
}
5561
}
5662

57-
fn check_pat(p: @pat, &&_is_const: bool, v: visit::vt<bool>) {
63+
pub fn check_pat(p: @pat, &&_is_const: bool, v: visit::vt<bool>) {
5864
fn is_str(e: @expr) -> bool {
5965
match e.node {
6066
expr_vstore(
@@ -75,9 +81,13 @@ fn check_pat(p: @pat, &&_is_const: bool, v: visit::vt<bool>) {
7581
}
7682
}
7783

78-
fn check_expr(sess: Session, def_map: resolve::DefMap,
79-
method_map: typeck::method_map, tcx: ty::ctxt,
80-
e: @expr, &&is_const: bool, v: visit::vt<bool>) {
84+
pub fn check_expr(sess: Session,
85+
def_map: resolve::DefMap,
86+
method_map: typeck::method_map,
87+
tcx: ty::ctxt,
88+
e: @expr,
89+
&&is_const: bool,
90+
v: visit::vt<bool>) {
8191
if is_const {
8292
match e.node {
8393
expr_unary(box(_), _) | expr_unary(uniq(_), _) |
@@ -194,9 +204,10 @@ fn check_expr(sess: Session, def_map: resolve::DefMap,
194204

195205
// Make sure a const item doesn't recursively refer to itself
196206
// FIXME: Should use the dependency graph when it's available (#1356)
197-
fn check_item_recursion(sess: Session, ast_map: ast_map::map,
198-
def_map: resolve::DefMap, it: @item) {
199-
207+
pub fn check_item_recursion(sess: Session,
208+
ast_map: ast_map::map,
209+
def_map: resolve::DefMap,
210+
it: @item) {
200211
type env = {
201212
root_it: @item,
202213
sess: Session,

src/librustc/middle/check_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use middle::ty;
1414
use syntax::ast::*;
1515
use syntax::visit;
1616

17-
type ctx = {in_loop: bool, can_ret: bool};
17+
pub type ctx = {in_loop: bool, can_ret: bool};
1818

19-
fn check_crate(tcx: ty::ctxt, crate: @crate) {
19+
pub fn check_crate(tcx: ty::ctxt, crate: @crate) {
2020
visit::visit_crate(*crate,
2121
{in_loop: false, can_ret: true},
2222
visit::mk_vt(@visit::Visitor {

0 commit comments

Comments
 (0)