Skip to content

Commit 0ecc62b

Browse files
committed
---
yaml --- r: 60626 b: refs/heads/auto c: 08e561a h: refs/heads/master v: v3
1 parent 0364257 commit 0ecc62b

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: ca9bb2d9ace2bf085dc276e241f6707e0402093f
17+
refs/heads/auto: 08e561ae70bc42b755b3831b3ce880745228892c
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/Makefile.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ endif
122122
ifdef TRACE
123123
CFG_RUSTC_FLAGS += -Z trace
124124
endif
125+
ifndef DEBUG_BORROWS
126+
RUSTFLAGS_STAGE1 += -Z no-debug-borrows
127+
RUSTFLAGS_STAGE2 += -Z no-debug-borrows
128+
endif
125129

126130
# platform-specific auto-configuration
127131
include $(CFG_SRC_DIR)mk/platform.mk

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub static debug_info: uint = 1 << 20;
6666
pub static extra_debug_info: uint = 1 << 21;
6767
pub static statik: uint = 1 << 22;
6868
pub static print_link_args: uint = 1 << 23;
69+
pub static no_debug_borrows: uint = 1 << 24;
6970

7071
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
7172
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
@@ -100,7 +101,10 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
100101
extra_debug_info),
101102
(~"debug-info", ~"Produce debug info (experimental)", debug_info),
102103
(~"static", ~"Use or produce static libraries or binaries " +
103-
"(experimental)", statik)
104+
"(experimental)", statik),
105+
(~"no-debug-borrows",
106+
~"do not show where borrow checks fail",
107+
no_debug_borrows),
104108
]
105109
}
106110

@@ -141,7 +145,7 @@ pub struct options {
141145
parse_only: bool,
142146
no_trans: bool,
143147
debugging_opts: uint,
144-
android_cross_path: Option<~str>
148+
android_cross_path: Option<~str>,
145149
}
146150

147151
pub struct crate_metadata {
@@ -271,6 +275,9 @@ pub impl Session_ {
271275
fn no_monomorphic_collapse(@self) -> bool {
272276
self.debugging_opt(no_monomorphic_collapse)
273277
}
278+
fn debug_borrows(@self) -> bool {
279+
self.opts.optimize == No && !self.debugging_opt(no_debug_borrows)
280+
}
274281

275282
fn str_of(@self, id: ast::ident) -> @~str {
276283
self.parse_sess.interner.get(id)
@@ -308,7 +315,7 @@ pub fn basic_options() -> @options {
308315
parse_only: false,
309316
no_trans: false,
310317
debugging_opts: 0u,
311-
android_cross_path: None
318+
android_cross_path: None,
312319
}
313320
}
314321

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn return_to_mut(mut bcx: block,
7474
let bits_val =
7575
Load(bcx, bits_val_ref);
7676

77-
if bcx.tcx().sess.opts.optimize == session::No {
77+
if bcx.tcx().sess.debug_borrows() {
7878
bcx = callee::trans_lang_call(
7979
bcx,
8080
bcx.tcx().lang_items.unrecord_borrow_fn(),
@@ -160,7 +160,7 @@ fn root(datum: &Datum,
160160
],
161161
expr::SaveIn(scratch_bits.val));
162162

163-
if bcx.tcx().sess.opts.optimize == session::No {
163+
if bcx.tcx().sess.debug_borrows() {
164164
bcx = callee::trans_lang_call(
165165
bcx,
166166
bcx.tcx().lang_items.record_borrow_fn(),

0 commit comments

Comments
 (0)