Skip to content

Commit 24d1519

Browse files
committed
---
yaml --- r: 92775 b: refs/heads/auto c: d7b1527 h: refs/heads/master i: 92773: 1f94efc 92771: 23e0515 92767: 24978ff v: v3
1 parent 52c3b9c commit 24d1519

File tree

9 files changed

+19
-18
lines changed

9 files changed

+19
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: c56bac7f409f0e555120894b12f3d4448ec07fe5
16+
refs/heads/auto: d7b152701eba5f78bb9295c4fa60ad0a9ec3ff50
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/driver/driver.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub fn phase_2_configure_and_expand(sess: Session,
166166
mut crate: ast::Crate) -> ast::Crate {
167167
let time_passes = sess.time_passes();
168168

169-
*sess.building_library = session::building_library(sess.opts, &crate);
169+
sess.building_library.set(session::building_library(sess.opts, &crate));
170170
*sess.outputs = session::collect_outputs(sess.opts, crate.attrs);
171171

172172
time(time_passes, "gated feature checking", (), |_|
@@ -878,7 +878,7 @@ pub fn build_session_(sopts: @session::options,
878878
entry_type: Cell::new(None),
879879
span_diagnostic: span_diagnostic_handler,
880880
filesearch: filesearch,
881-
building_library: @mut false,
881+
building_library: Cell::new(false),
882882
working_dir: os::getcwd(),
883883
lints: RefCell::new(HashMap::new()),
884884
node_id: Cell::new(1),
@@ -1039,7 +1039,7 @@ pub fn build_output_filenames(input: &input,
10391039
}
10401040
}
10411041

1042-
if *sess.building_library {
1042+
if sess.building_library.get() {
10431043
out_path = dirpath.join(os::dll_filename(stem));
10441044
obj_path = {
10451045
let mut p = dirpath.join(stem);
@@ -1060,7 +1060,7 @@ pub fn build_output_filenames(input: &input,
10601060
out_file.with_extension(obj_suffix)
10611061
};
10621062

1063-
if *sess.building_library {
1063+
if sess.building_library.get() {
10641064
sess.warn("ignoring specified output filename for library.");
10651065
}
10661066

branches/auto/src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub struct Session_ {
210210
entry_type: Cell<Option<EntryFnType>>,
211211
span_diagnostic: @mut diagnostic::span_handler,
212212
filesearch: @filesearch::FileSearch,
213-
building_library: @mut bool,
213+
building_library: Cell<bool>,
214214
working_dir: Path,
215215
lints: RefCell<HashMap<ast::NodeId,
216216
~[(lint::lint, codemap::Span, ~str)]>>,

branches/auto/src/librustc/front/std_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl fold::ast_fold for StandardLibraryInjector {
6969
span: dummy_sp()
7070
}];
7171

72-
if use_uv(&crate) && !*self.sess.building_library {
72+
if use_uv(&crate) && !self.sess.building_library.get() {
7373
vis.push(ast::view_item {
7474
node: ast::view_item_extern_mod(self.sess.ident_of("green"),
7575
None,

branches/auto/src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl fold::ast_fold for TestHarnessGenerator {
127127
// the one we're going to add. Only if compiling an executable.
128128

129129
fn nomain(cx: @TestCtxt, item: @ast::item) -> @ast::item {
130-
if !*cx.sess.building_library {
130+
if !cx.sess.building_library.get() {
131131
@ast::item {
132132
attrs: item.attrs.iter().filter_map(|attr| {
133133
if "main" != attr.name() {

branches/auto/src/librustc/middle/entry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Visitor<()> for EntryContext {
4545
}
4646

4747
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
48-
if *session.building_library {
48+
if session.building_library.get() {
4949
// No need to find a main function
5050
return;
5151
}
@@ -131,7 +131,7 @@ fn configure_main(this: &mut EntryContext) {
131131
this.session.entry_fn.set(this.main_fn);
132132
this.session.entry_type.set(Some(session::EntryMain));
133133
} else {
134-
if !*this.session.building_library {
134+
if !this.session.building_library.get() {
135135
// No main function
136136
this.session.err("main function not found");
137137
if !this.non_main_fns.is_empty() {

branches/auto/src/librustc/middle/reachable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl ReachableContext {
303303
fn propagate_node(&self, node: &ast_map::ast_node,
304304
search_item: ast::NodeId,
305305
visitor: &mut MarkSymbolVisitor) {
306-
if !*self.tcx.sess.building_library {
306+
if !self.tcx.sess.building_library.get() {
307307
// If we are building an executable, then there's no need to flag
308308
// anything as external except for `extern fn` types. These
309309
// functions may still participate in some form of native interface,

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ fn finish_register_fn(ccx: @CrateContext, sp: Span, sym: ~str, node_id: ast::Nod
23442344
}
23452345
}
23462346

2347-
if is_entry_fn(&ccx.sess, node_id) && !*ccx.sess.building_library {
2347+
if is_entry_fn(&ccx.sess, node_id) && !ccx.sess.building_library.get() {
23482348
create_entry_wrapper(ccx, sp, llfn);
23492349
}
23502350
}
@@ -2678,7 +2678,7 @@ pub fn get_item_val(ccx: @CrateContext, id: ast::NodeId) -> ValueRef {
26782678
// library then we've already declared the crate map
26792679
// so use that instead.
26802680
if attr::contains_name(ni.attrs, "crate_map") {
2681-
if *ccx.sess.building_library {
2681+
if ccx.sess.building_library.get() {
26822682
let s = "_rust_crate_map_toplevel";
26832683
let g = unsafe {
26842684
s.with_c_str(|buf| {
@@ -3044,7 +3044,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
30443044
let mut n_subcrates = 1;
30453045
let cstore = sess.cstore;
30463046
while cstore.have_crate_data(n_subcrates) { n_subcrates += 1; }
3047-
let is_top = !*sess.building_library || sess.gen_crate_map();
3047+
let is_top = !sess.building_library.get() || sess.gen_crate_map();
30483048
let sym_name = if is_top {
30493049
~"_rust_crate_map_toplevel"
30503050
} else {
@@ -3154,7 +3154,9 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
31543154
pub fn write_metadata(cx: &CrateContext, crate: &ast::Crate) -> ~[u8] {
31553155
use extra::flate;
31563156

3157-
if !*cx.sess.building_library { return ~[]; }
3157+
if !cx.sess.building_library.get() {
3158+
return ~[]
3159+
}
31583160

31593161
let encode_inlined_item: encoder::encode_inlined_item =
31603162
|ecx, ebml_w, path, ii|
@@ -3227,8 +3229,7 @@ pub fn trans_crate(sess: session::Session,
32273229
// __rust_crate_map_toplevel symbol (extra underscore) which it will
32283230
// subsequently fail to find. So to mitigate that we just introduce
32293231
// an alias from the symbol it expects to the one that actually exists.
3230-
if ccx.sess.targ_cfg.os == OsWin32 &&
3231-
!*ccx.sess.building_library {
3232+
if ccx.sess.targ_cfg.os == OsWin32 && !ccx.sess.building_library.get() {
32323233

32333234
let maptype = val_ty(ccx.crate_map).to_ref();
32343235

branches/auto/src/librustc/middle/typeck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
438438

439439
fn check_for_entry_fn(ccx: &CrateCtxt) {
440440
let tcx = ccx.tcx;
441-
if !*tcx.sess.building_library {
441+
if !tcx.sess.building_library.get() {
442442
match tcx.sess.entry_fn.get() {
443443
Some((id, sp)) => match tcx.sess.entry_type.get() {
444444
Some(session::EntryMain) => check_main_fn_ty(ccx, id, sp),

0 commit comments

Comments
 (0)