Skip to content

Commit d85d4f5

Browse files
committed
Include @ in crate_ctxt and fn_ctxt type definitions
So that code using them doesn't have to spell it out constantly.
1 parent b1d7f25 commit d85d4f5

File tree

10 files changed

+160
-160
lines changed

10 files changed

+160
-160
lines changed

src/comp/back/link.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ fn symbol_hash(tcx: ty::ctxt, sha: sha1, t: ty::t, link_meta: link_meta) ->
501501
ret "_" + hash;
502502
}
503503

504-
fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> str {
504+
fn get_symbol_hash(ccx: crate_ctxt, t: ty::t) -> str {
505505
let hash = "";
506506
alt ccx.type_sha1s.find(t) {
507507
some(h) { hash = h; }
@@ -533,28 +533,28 @@ fn exported_name(path: path, hash: str, _vers: str) -> str {
533533

534534
}
535535

536-
fn mangle_exported_name(ccx: @crate_ctxt, path: path, t: ty::t) -> str {
536+
fn mangle_exported_name(ccx: crate_ctxt, path: path, t: ty::t) -> str {
537537
let hash = get_symbol_hash(ccx, t);
538538
ret exported_name(path, hash, ccx.link_meta.vers);
539539
}
540540

541-
fn mangle_internal_name_by_type_only(ccx: @crate_ctxt, t: ty::t, name: str) ->
541+
fn mangle_internal_name_by_type_only(ccx: crate_ctxt, t: ty::t, name: str) ->
542542
str {
543543
let s = util::ppaux::ty_to_short_str(ccx.tcx, t);
544544
let hash = get_symbol_hash(ccx, t);
545545
ret mangle([path_name(name), path_name(s), path_name(hash)]);
546546
}
547547

548-
fn mangle_internal_name_by_path_and_seq(ccx: @crate_ctxt, path: path,
548+
fn mangle_internal_name_by_path_and_seq(ccx: crate_ctxt, path: path,
549549
flav: str) -> str {
550550
ret mangle(path + [path_name(ccx.names(flav))]);
551551
}
552552

553-
fn mangle_internal_name_by_path(_ccx: @crate_ctxt, path: path) -> str {
553+
fn mangle_internal_name_by_path(_ccx: crate_ctxt, path: path) -> str {
554554
ret mangle(path);
555555
}
556556

557-
fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
557+
fn mangle_internal_name_by_seq(ccx: crate_ctxt, flav: str) -> str {
558558
ret ccx.names(flav);
559559
}
560560

src/comp/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export encoded_ty;
1919

2020
type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>;
2121

22-
type encode_ctxt = {ccx: @crate_ctxt, type_abbrevs: abbrev_map};
22+
type encode_ctxt = {ccx: crate_ctxt, type_abbrevs: abbrev_map};
2323

2424
// Path table encoding
2525
fn encode_name(ebml_w: ebml::writer, name: str) {
@@ -702,7 +702,7 @@ fn encode_hash(ebml_w: ebml::writer, hash: str) {
702702
ebml::end_tag(ebml_w);
703703
}
704704

705-
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> [u8] {
705+
fn encode_metadata(cx: crate_ctxt, crate: @crate) -> [u8] {
706706

707707
let abbrevs = ty::new_ty_hash();
708708
let ecx = @{ccx: cx, type_abbrevs: abbrevs};

src/comp/middle/trans/alt.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn trans_opt(bcx: block, o: opt) -> opt_result {
6363
}
6464
}
6565

66-
fn variant_opt(ccx: @crate_ctxt, pat_id: ast::node_id) -> opt {
66+
fn variant_opt(ccx: crate_ctxt, pat_id: ast::node_id) -> opt {
6767
let vdef = ast_util::variant_def_ids(ccx.tcx.def_map.get(pat_id));
6868
let variants = ty::enum_variants(ccx.tcx, vdef.enm);
6969
for v: ty::variant_info in *variants {
@@ -155,10 +155,10 @@ fn enter_default(m: match, col: uint, val: ValueRef) -> match {
155155
ret enter_match(m, col, val, e);
156156
}
157157

158-
fn enter_opt(ccx: @crate_ctxt, m: match, opt: opt, col: uint, enum_size: uint,
158+
fn enter_opt(ccx: crate_ctxt, m: match, opt: opt, col: uint, enum_size: uint,
159159
val: ValueRef) -> match {
160160
let dummy = @{id: 0, node: ast::pat_wild, span: dummy_sp()};
161-
fn e(ccx: @crate_ctxt, dummy: @ast::pat, opt: opt, size: uint,
161+
fn e(ccx: crate_ctxt, dummy: @ast::pat, opt: opt, size: uint,
162162
p: @ast::pat) -> option<[@ast::pat]> {
163163
alt p.node {
164164
ast::pat_enum(ctor, subpats) {
@@ -235,7 +235,7 @@ fn enter_uniq(m: match, col: uint, val: ValueRef) -> match {
235235
ret enter_match(m, col, val, bind e(dummy, _));
236236
}
237237

238-
fn get_options(ccx: @crate_ctxt, m: match, col: uint) -> [opt] {
238+
fn get_options(ccx: crate_ctxt, m: match, col: uint) -> [opt] {
239239
fn add_to_set(&set: [opt], val: opt) {
240240
for l: opt in set { if opt_eq(l, val) { ret; } }
241241
set += [val];

0 commit comments

Comments
 (0)