Skip to content

Commit 1fa0a8c

Browse files
committed
Hide stuff that are not used outside of _match.rs
1 parent 8d3c62a commit 1fa0a8c

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

src/librustc/middle/trans/_match.rs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,23 @@ use syntax::codemap::{span, dummy_sp};
183183

184184
// An option identifying a literal: either a unit-like struct or an
185185
// expression.
186-
pub enum Lit {
186+
enum Lit {
187187
UnitLikeStructLit(ast::NodeId), // the node ID of the pattern
188188
ExprLit(@ast::expr),
189189
ConstLit(ast::def_id), // the def ID of the constant
190190
}
191191

192192
// An option identifying a branch (either a literal, a enum variant or a
193193
// range)
194-
pub enum Opt {
194+
enum Opt {
195195
lit(Lit),
196196
var(/* disr val */ uint, @adt::Repr),
197197
range(@ast::expr, @ast::expr),
198198
vec_len_eq(uint),
199199
vec_len_ge(uint, /* slice */uint)
200200
}
201201

202-
pub fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool {
202+
fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool {
203203
match (a, b) {
204204
(&lit(a), &lit(b)) => {
205205
match (a, b) {
@@ -258,7 +258,7 @@ pub enum opt_result {
258258
lower_bound(Result),
259259
range_result(Result, Result),
260260
}
261-
pub fn trans_opt(bcx: @mut Block, o: &Opt) -> opt_result {
261+
fn trans_opt(bcx: @mut Block, o: &Opt) -> opt_result {
262262
let _icx = push_ctxt("match::trans_opt");
263263
let ccx = bcx.ccx();
264264
let bcx = bcx;
@@ -292,7 +292,7 @@ pub fn trans_opt(bcx: @mut Block, o: &Opt) -> opt_result {
292292
}
293293
}
294294

295-
pub fn variant_opt(bcx: @mut Block, pat_id: ast::NodeId)
295+
fn variant_opt(bcx: @mut Block, pat_id: ast::NodeId)
296296
-> Opt {
297297
let ccx = bcx.ccx();
298298
match ccx.tcx.def_map.get_copy(&pat_id) {
@@ -317,7 +317,7 @@ pub fn variant_opt(bcx: @mut Block, pat_id: ast::NodeId)
317317
}
318318

319319
#[deriving(Clone)]
320-
pub enum TransBindingMode {
320+
enum TransBindingMode {
321321
TrByValue(/*llbinding:*/ ValueRef),
322322
TrByRef,
323323
}
@@ -331,24 +331,24 @@ pub enum TransBindingMode {
331331
* - `id` is the node id of the binding
332332
* - `ty` is the Rust type of the binding */
333333
#[deriving(Clone)]
334-
pub struct BindingInfo {
334+
struct BindingInfo {
335335
llmatch: ValueRef,
336336
trmode: TransBindingMode,
337337
id: ast::NodeId,
338338
ty: ty::t,
339339
}
340340

341-
pub type BindingsMap = HashMap<ident, BindingInfo>;
341+
type BindingsMap = HashMap<ident, BindingInfo>;
342342

343343
#[deriving(Clone)]
344-
pub struct ArmData<'self> {
344+
struct ArmData<'self> {
345345
bodycx: @mut Block,
346346
arm: &'self ast::arm,
347347
bindings_map: @BindingsMap
348348
}
349349

350350
#[deriving(Clone)]
351-
pub struct Match<'self> {
351+
struct Match<'self> {
352352
pats: ~[@ast::pat],
353353
data: ArmData<'self>
354354
}
@@ -364,7 +364,7 @@ impl<'self> Repr for Match<'self> {
364364
}
365365
}
366366

367-
pub fn has_nested_bindings(m: &[Match], col: uint) -> bool {
367+
fn has_nested_bindings(m: &[Match], col: uint) -> bool {
368368
for br in m.iter() {
369369
match br.pats[col].node {
370370
ast::pat_ident(_, _, Some(_)) => return true,
@@ -374,7 +374,7 @@ pub fn has_nested_bindings(m: &[Match], col: uint) -> bool {
374374
return false;
375375
}
376376

377-
pub fn expand_nested_bindings<'r>(bcx: @mut Block,
377+
fn expand_nested_bindings<'r>(bcx: @mut Block,
378378
m: &[Match<'r>],
379379
col: uint,
380380
val: ValueRef)
@@ -409,7 +409,7 @@ pub fn expand_nested_bindings<'r>(bcx: @mut Block,
409409
}
410410
}
411411

412-
pub fn assert_is_binding_or_wild(bcx: @mut Block, p: @ast::pat) {
412+
fn assert_is_binding_or_wild(bcx: @mut Block, p: @ast::pat) {
413413
if !pat_is_binding_or_wild(bcx.tcx().def_map, p) {
414414
bcx.sess().span_bug(
415415
p.span,
@@ -418,9 +418,9 @@ pub fn assert_is_binding_or_wild(bcx: @mut Block, p: @ast::pat) {
418418
}
419419
}
420420

421-
pub type enter_pat<'self> = &'self fn(@ast::pat) -> Option<~[@ast::pat]>;
421+
type enter_pat<'self> = &'self fn(@ast::pat) -> Option<~[@ast::pat]>;
422422

423-
pub fn enter_match<'r>(bcx: @mut Block,
423+
fn enter_match<'r>(bcx: @mut Block,
424424
dm: DefMap,
425425
m: &[Match<'r>],
426426
col: uint,
@@ -470,7 +470,7 @@ pub fn enter_match<'r>(bcx: @mut Block,
470470
return result;
471471
}
472472

473-
pub fn enter_default<'r>(bcx: @mut Block,
473+
fn enter_default<'r>(bcx: @mut Block,
474474
dm: DefMap,
475475
m: &[Match<'r>],
476476
col: uint,
@@ -516,7 +516,7 @@ pub fn enter_default<'r>(bcx: @mut Block,
516516
// <nmatsakis> so all patterns must either be records (resp. tuples) or
517517
// wildcards
518518

519-
pub fn enter_opt<'r>(bcx: @mut Block,
519+
fn enter_opt<'r>(bcx: @mut Block,
520520
m: &[Match<'r>],
521521
opt: &Opt,
522522
col: uint,
@@ -628,7 +628,7 @@ pub fn enter_opt<'r>(bcx: @mut Block,
628628
}
629629
}
630630

631-
pub fn enter_rec_or_struct<'r>(bcx: @mut Block,
631+
fn enter_rec_or_struct<'r>(bcx: @mut Block,
632632
dm: DefMap,
633633
m: &[Match<'r>],
634634
col: uint,
@@ -663,7 +663,7 @@ pub fn enter_rec_or_struct<'r>(bcx: @mut Block,
663663
}
664664
}
665665

666-
pub fn enter_tup<'r>(bcx: @mut Block,
666+
fn enter_tup<'r>(bcx: @mut Block,
667667
dm: DefMap,
668668
m: &[Match<'r>],
669669
col: uint,
@@ -689,7 +689,7 @@ pub fn enter_tup<'r>(bcx: @mut Block,
689689
}
690690
}
691691

692-
pub fn enter_tuple_struct<'r>(bcx: @mut Block,
692+
fn enter_tuple_struct<'r>(bcx: @mut Block,
693693
dm: DefMap,
694694
m: &[Match<'r>],
695695
col: uint,
@@ -715,7 +715,7 @@ pub fn enter_tuple_struct<'r>(bcx: @mut Block,
715715
}
716716
}
717717

718-
pub fn enter_box<'r>(bcx: @mut Block,
718+
fn enter_box<'r>(bcx: @mut Block,
719719
dm: DefMap,
720720
m: &[Match<'r>],
721721
col: uint,
@@ -742,7 +742,7 @@ pub fn enter_box<'r>(bcx: @mut Block,
742742
}
743743
}
744744

745-
pub fn enter_uniq<'r>(bcx: @mut Block,
745+
fn enter_uniq<'r>(bcx: @mut Block,
746746
dm: DefMap,
747747
m: &[Match<'r>],
748748
col: uint,
@@ -769,7 +769,7 @@ pub fn enter_uniq<'r>(bcx: @mut Block,
769769
}
770770
}
771771

772-
pub fn enter_region<'r>(bcx: @mut Block,
772+
fn enter_region<'r>(bcx: @mut Block,
773773
dm: DefMap,
774774
m: &[Match<'r>],
775775
col: uint,
@@ -799,7 +799,7 @@ pub fn enter_region<'r>(bcx: @mut Block,
799799
// Returns the options in one column of matches. An option is something that
800800
// needs to be conditionally matched at runtime; for example, the discriminant
801801
// on a set of enum variants or a literal.
802-
pub fn get_options(bcx: @mut Block, m: &[Match], col: uint) -> ~[Opt] {
802+
fn get_options(bcx: @mut Block, m: &[Match], col: uint) -> ~[Opt] {
803803
let ccx = bcx.ccx();
804804
fn add_to_set(tcx: ty::ctxt, set: &mut ~[Opt], val: Opt) {
805805
if set.iter().any(|l| opt_eq(tcx, l, &val)) {return;}
@@ -865,12 +865,12 @@ pub fn get_options(bcx: @mut Block, m: &[Match], col: uint) -> ~[Opt] {
865865
return found;
866866
}
867867

868-
pub struct ExtractedBlock {
868+
struct ExtractedBlock {
869869
vals: ~[ValueRef],
870870
bcx: @mut Block
871871
}
872872

873-
pub fn extract_variant_args(bcx: @mut Block,
873+
fn extract_variant_args(bcx: @mut Block,
874874
repr: &adt::Repr,
875875
disr_val: uint,
876876
val: ValueRef)
@@ -893,7 +893,7 @@ fn match_datum(bcx: @mut Block, val: ValueRef, pat_id: ast::NodeId) -> Datum {
893893
}
894894

895895

896-
pub fn extract_vec_elems(bcx: @mut Block,
896+
fn extract_vec_elems(bcx: @mut Block,
897897
pat_span: span,
898898
pat_id: ast::NodeId,
899899
elem_count: uint,
@@ -948,7 +948,7 @@ pub fn extract_vec_elems(bcx: @mut Block,
948948
}
949949

950950
// NB: This function does not collect fields from struct-like enum variants.
951-
pub fn collect_record_or_struct_fields(bcx: @mut Block,
951+
fn collect_record_or_struct_fields(bcx: @mut Block,
952952
m: &[Match],
953953
col: uint)
954954
-> ~[ast::ident] {
@@ -976,7 +976,7 @@ pub fn collect_record_or_struct_fields(bcx: @mut Block,
976976
}
977977
}
978978

979-
pub fn pats_require_rooting(bcx: @mut Block,
979+
fn pats_require_rooting(bcx: @mut Block,
980980
m: &[Match],
981981
col: uint)
982982
-> bool {
@@ -987,7 +987,7 @@ pub fn pats_require_rooting(bcx: @mut Block,
987987
}
988988
}
989989

990-
pub fn root_pats_as_necessary(mut bcx: @mut Block,
990+
fn root_pats_as_necessary(mut bcx: @mut Block,
991991
m: &[Match],
992992
col: uint,
993993
val: ValueRef)
@@ -1018,23 +1018,23 @@ macro_rules! any_pat (
10181018
)
10191019
)
10201020

1021-
pub fn any_box_pat(m: &[Match], col: uint) -> bool {
1021+
fn any_box_pat(m: &[Match], col: uint) -> bool {
10221022
any_pat!(m, ast::pat_box(_))
10231023
}
10241024

1025-
pub fn any_uniq_pat(m: &[Match], col: uint) -> bool {
1025+
fn any_uniq_pat(m: &[Match], col: uint) -> bool {
10261026
any_pat!(m, ast::pat_uniq(_))
10271027
}
10281028

1029-
pub fn any_region_pat(m: &[Match], col: uint) -> bool {
1029+
fn any_region_pat(m: &[Match], col: uint) -> bool {
10301030
any_pat!(m, ast::pat_region(_))
10311031
}
10321032

1033-
pub fn any_tup_pat(m: &[Match], col: uint) -> bool {
1033+
fn any_tup_pat(m: &[Match], col: uint) -> bool {
10341034
any_pat!(m, ast::pat_tup(_))
10351035
}
10361036

1037-
pub fn any_tuple_struct_pat(bcx: @mut Block, m: &[Match], col: uint) -> bool {
1037+
fn any_tuple_struct_pat(bcx: @mut Block, m: &[Match], col: uint) -> bool {
10381038
do m.iter().any |br| {
10391039
let pat = br.pats[col];
10401040
match pat.node {
@@ -1050,9 +1050,9 @@ pub fn any_tuple_struct_pat(bcx: @mut Block, m: &[Match], col: uint) -> bool {
10501050
}
10511051
}
10521052

1053-
pub type mk_fail = @fn() -> BasicBlockRef;
1053+
type mk_fail = @fn() -> BasicBlockRef;
10541054

1055-
pub fn pick_col(m: &[Match]) -> uint {
1055+
fn pick_col(m: &[Match]) -> uint {
10561056
fn score(p: &ast::pat) -> uint {
10571057
match p.node {
10581058
ast::pat_lit(_) | ast::pat_enum(_, _) | ast::pat_range(_, _) => 1u,
@@ -1088,7 +1088,7 @@ pub enum branch_kind { no_branch, single, switch, compare, compare_vec_len, }
10881088
// Compiles a comparison between two things.
10891089
//
10901090
// NB: This must produce an i1, not a Rust bool (i8).
1091-
pub fn compare_values(cx: @mut Block,
1091+
fn compare_values(cx: @mut Block,
10921092
lhs: ValueRef,
10931093
rhs: ValueRef,
10941094
rhs_t: ty::t)
@@ -1204,7 +1204,7 @@ fn insert_lllocals(bcx: @mut Block,
12041204
return bcx;
12051205
}
12061206

1207-
pub fn compile_guard(bcx: @mut Block,
1207+
fn compile_guard(bcx: @mut Block,
12081208
guard_expr: @ast::expr,
12091209
data: &ArmData,
12101210
m: &[Match],
@@ -1261,7 +1261,7 @@ pub fn compile_guard(bcx: @mut Block,
12611261
}
12621262
}
12631263

1264-
pub fn compile_submatch(bcx: @mut Block,
1264+
fn compile_submatch(bcx: @mut Block,
12651265
m: &[Match],
12661266
vals: &[ValueRef],
12671267
chk: Option<mk_fail>) {
@@ -1670,7 +1670,7 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::pat) -> BindingsMap {
16701670
return bindings_map;
16711671
}
16721672

1673-
pub fn trans_match_inner(scope_cx: @mut Block,
1673+
fn trans_match_inner(scope_cx: @mut Block,
16741674
discr_expr: @ast::expr,
16751675
arms: &[ast::arm],
16761676
dest: Dest) -> @mut Block {
@@ -1752,7 +1752,7 @@ pub fn trans_match_inner(scope_cx: @mut Block,
17521752
}
17531753
}
17541754

1755-
pub enum IrrefutablePatternBindingMode {
1755+
enum IrrefutablePatternBindingMode {
17561756
// Stores the association between node ID and LLVM value in `lllocals`.
17571757
BindLocal,
17581758
// Stores the association between node ID and LLVM value in `llargs`.

0 commit comments

Comments
 (0)