Skip to content

Commit 4461eae

Browse files
committed
---
yaml --- r: 3578 b: refs/heads/master c: 4349eae h: refs/heads/master v: v3
1 parent 54035b5 commit 4461eae

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6fd6fdea93fca19f168526943c177f942212cbc6
2+
refs/heads/master: 4349eaed8417a39eb54ea952ce86c7c585be6e90

trunk/src/comp/driver/rustc.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,8 @@ fn build_session_options(str binary, getopts::match match, str binary_dir) ->
344344
fn build_session(@session::options sopts) -> session::session {
345345
auto target_cfg = build_target_config();
346346
auto crate_cache = syntax::_std::new_int_hash[session::crate_metadata]();
347-
auto target_crate_num = 0;
348-
auto sess =
349-
session::session(target_crate_num, target_cfg, sopts, crate_cache, [],
347+
ret session::session(target_cfg, sopts, crate_cache, [],
350348
[], [], codemap::new_codemap(), 0u);
351-
ret sess;
352349
}
353350

354351
fn parse_pretty(session::session sess, &str name) -> pp_mode {

trunk/src/comp/driver/session.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ type options =
4141

4242
type crate_metadata = rec(str name, vec[u8] data);
4343

44-
obj session(ast::crate_num cnum,
45-
@config targ_cfg,
44+
obj session(@config targ_cfg,
4645
@options opts,
4746
map::hashmap[int, crate_metadata] crates,
4847
mutable vec[str] used_crate_files,
@@ -52,7 +51,6 @@ obj session(ast::crate_num cnum,
5251
mutable uint err_count) {
5352
fn get_targ_cfg() -> @config { ret targ_cfg; }
5453
fn get_opts() -> @options { ret opts; }
55-
fn get_targ_crate_num() -> ast::crate_num { ret cnum; }
5654
fn span_fatal(span sp, str msg) -> ! {
5755
// FIXME: Use constants, but rustboot doesn't know how to export them.
5856
codemap::emit_error(some(sp), msg, cm);

trunk/src/comp/middle/trans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4816,7 +4816,7 @@ fn trans_external_path(&@block_ctxt cx, &ast::def_id did,
48164816
fn lval_generic_fn(&@block_ctxt cx, &ty::ty_param_count_and_ty tpt,
48174817
&ast::def_id fn_id, ast::node_id id) -> lval_result {
48184818
auto lv;
4819-
if (cx.fcx.lcx.ccx.sess.get_targ_crate_num() == fn_id._0) {
4819+
if (fn_id._0 == ast::local_crate) {
48204820
// Internal reference.
48214821
assert (cx.fcx.lcx.ccx.fn_pairs.contains_key(fn_id._1));
48224822
lv = lval_val(cx, cx.fcx.lcx.ccx.fn_pairs.get(fn_id._1));
@@ -4851,7 +4851,7 @@ fn lookup_discriminant(&@local_ctxt lcx, &ast::def_id tid, &ast::def_id vid)
48514851
case (none) {
48524852
// It's an external discriminant that we haven't seen yet.
48534853

4854-
assert (lcx.ccx.sess.get_targ_crate_num() != vid._0);
4854+
assert (vid._0 != ast::local_crate);
48554855
auto sym = decoder::get_symbol(lcx.ccx.sess, vid);
48564856
auto gvar =
48574857
llvm::LLVMAddGlobal(lcx.ccx.llmod, T_int(), str::buf(sym));

trunk/src/comp/middle/ty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,7 @@ fn def_has_ty_params(&ast::def def) -> bool {
28022802
type variant_info = rec(vec[ty::t] args, ty::t ctor_ty, ast::def_id id);
28032803

28042804
fn tag_variants(&ctxt cx, &ast::def_id id) -> vec[variant_info] {
2805-
if (cx.sess.get_targ_crate_num() != id._0) {
2805+
if (ast::local_crate != id._0) {
28062806
ret decoder::get_tag_variants(cx, id);
28072807
}
28082808
auto item = alt (cx.items.find(id._1)) {
@@ -2857,7 +2857,7 @@ fn tag_variant_with_id(&ctxt cx, &ast::def_id tag_id, &ast::def_id variant_id)
28572857
// If the given item is in an external crate, looks up its type and adds it to
28582858
// the type cache. Returns the type parameters and type.
28592859
fn lookup_item_type(ctxt cx, ast::def_id did) -> ty_param_count_and_ty {
2860-
if (did._0 == cx.sess.get_targ_crate_num()) {
2860+
if (did._0 == ast::local_crate) {
28612861
// The item is in this crate. The caller should have added it to the
28622862
// type cache already; we simply return it.
28632863

trunk/src/comp/middle/typeck.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,8 @@ mod collect {
521521
ret tpt;
522522
}
523523
fn getter(@ctxt cx, &ast::def_id id) -> ty::ty_param_count_and_ty {
524-
if (id._0 != cx.tcx.sess.get_targ_crate_num()) {
524+
if (id._0 != ast::local_crate) {
525525
// This is a type we need to load in from the crate reader.
526-
527526
ret decoder::get_type(cx.tcx, id);
528527
}
529528
auto it = cx.tcx.items.find(id._1);

0 commit comments

Comments
 (0)