Skip to content

Commit 9c10228

Browse files
committed
---
yaml --- r: 97109 b: refs/heads/dist-snap c: 5c63b1f h: refs/heads/master i: 97107: 774fcde v: v3
1 parent a46b056 commit 9c10228

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 522743c9dbf561ed026e917d9911d94fad5d19a5
9+
refs/heads/dist-snap: 5c63b1febc2e618f79d07ce46c1305cfa28b6596
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use middle;
2626
use util::common::time;
2727
use util::ppaux;
2828

29-
use std::cell::RefCell;
29+
use std::cell::{Cell, RefCell};
3030
use std::hashmap::{HashMap,HashSet};
3131
use std::io;
3232
use std::io::fs;
@@ -874,8 +874,8 @@ pub fn build_session_(sopts: @session::options,
874874
parse_sess: p_s,
875875
codemap: cm,
876876
// For a library crate, this is always none
877-
entry_fn: @mut None,
878-
entry_type: @mut None,
877+
entry_fn: RefCell::new(None),
878+
entry_type: Cell::new(None),
879879
span_diagnostic: span_diagnostic_handler,
880880
filesearch: filesearch,
881881
building_library: @mut false,

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use syntax::abi;
2828
use syntax::parse::token;
2929
use syntax;
3030

31-
use std::cell::RefCell;
31+
use std::cell::{Cell, RefCell};
3232
use std::hashmap::{HashMap,HashSet};
3333

3434
pub struct config {
@@ -206,8 +206,8 @@ pub struct Session_ {
206206
parse_sess: @mut ParseSess,
207207
codemap: @codemap::CodeMap,
208208
// For a library crate, this is always none
209-
entry_fn: @mut Option<(NodeId, codemap::Span)>,
210-
entry_type: @mut Option<EntryFnType>,
209+
entry_fn: RefCell<Option<(NodeId, codemap::Span)>>,
210+
entry_type: Cell<Option<EntryFnType>>,
211211
span_diagnostic: @mut diagnostic::span_handler,
212212
filesearch: @filesearch::FileSearch,
213213
building_library: @mut bool,

branches/dist-snap/src/librustc/middle/dead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ fn create_and_seed_worklist(tcx: ty::ctxt,
212212
}
213213

214214
// Seed entry point
215-
match *tcx.sess.entry_fn {
215+
match tcx.sess.entry_fn.get() {
216216
Some((id, _)) => worklist.push(id),
217217
None => ()
218218
}

branches/dist-snap/src/librustc/middle/entry.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map)
5252

5353
// If the user wants no main function at all, then stop here.
5454
if attr::contains_name(crate.attrs, "no_main") {
55-
*session.entry_type = Some(session::EntryNone);
55+
session.entry_type.set(Some(session::EntryNone));
5656
return
5757
}
5858

@@ -122,14 +122,14 @@ fn find_item(item: @item, ctxt: &mut EntryContext) {
122122

123123
fn configure_main(this: &mut EntryContext) {
124124
if this.start_fn.is_some() {
125-
*this.session.entry_fn = this.start_fn;
126-
*this.session.entry_type = Some(session::EntryStart);
125+
this.session.entry_fn.set(this.start_fn);
126+
this.session.entry_type.set(Some(session::EntryStart));
127127
} else if this.attr_main_fn.is_some() {
128-
*this.session.entry_fn = this.attr_main_fn;
129-
*this.session.entry_type = Some(session::EntryMain);
128+
this.session.entry_fn.set(this.attr_main_fn);
129+
this.session.entry_type.set(Some(session::EntryMain));
130130
} else if this.main_fn.is_some() {
131-
*this.session.entry_fn = this.main_fn;
132-
*this.session.entry_type = Some(session::EntryMain);
131+
this.session.entry_fn.set(this.main_fn);
132+
this.session.entry_type.set(Some(session::EntryMain));
133133
} else {
134134
if !*this.session.building_library {
135135
// No main function

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ pub fn register_fn_llvmty(ccx: @CrateContext,
23822382
}
23832383

23842384
pub fn is_entry_fn(sess: &Session, node_id: ast::NodeId) -> bool {
2385-
match *sess.entry_fn {
2385+
match sess.entry_fn.get() {
23862386
Some((entry_id, _)) => node_id == entry_id,
23872387
None => false
23882388
}
@@ -2393,7 +2393,7 @@ pub fn is_entry_fn(sess: &Session, node_id: ast::NodeId) -> bool {
23932393
pub fn create_entry_wrapper(ccx: @CrateContext,
23942394
_sp: Span,
23952395
main_llfn: ValueRef) {
2396-
let et = ccx.sess.entry_type.unwrap();
2396+
let et = ccx.sess.entry_type.get().unwrap();
23972397
match et {
23982398
session::EntryMain => {
23992399
create_entry_fn(ccx, main_llfn, true);

branches/dist-snap/src/librustc/middle/typeck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
439439
fn check_for_entry_fn(ccx: &CrateCtxt) {
440440
let tcx = ccx.tcx;
441441
if !*tcx.sess.building_library {
442-
match *tcx.sess.entry_fn {
443-
Some((id, sp)) => match *tcx.sess.entry_type {
442+
match tcx.sess.entry_fn.get() {
443+
Some((id, sp)) => match tcx.sess.entry_type.get() {
444444
Some(session::EntryMain) => check_main_fn_ty(ccx, id, sp),
445445
Some(session::EntryStart) => check_start_fn_ty(ccx, id, sp),
446446
Some(session::EntryNone) => {}

0 commit comments

Comments
 (0)