Skip to content

Commit c1cd28f

Browse files
committed
---
yaml --- r: 22451 b: refs/heads/master c: 9b094c0 h: refs/heads/master i: 22449: ce9a0b5 22447: f9bf538 v: v3
1 parent 6891f00 commit c1cd28f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 668285b9c85bebc5d1a4e8d346e99b580420be8e
2+
refs/heads/master: 9b094c0baf4fa758c80fb9db8cc172f03789adbb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/rustc/driver/session.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const trace: uint = 128u;
3737
const no_rt: uint = 256u;
3838
const coherence: uint = 512u;
3939
const borrowck_stats: uint = 1024u;
40+
const borrowck_note_pure: uint = 2048;
4041

4142
fn debugging_opts_map() -> ~[(str, str, uint)] {
4243
~[("ppregions", "prettyprint regions with \
@@ -51,7 +52,9 @@ fn debugging_opts_map() -> ~[(str, str, uint)] {
5152
("trace", "emit trace logs", trace),
5253
("no-rt", "do not link to the runtime", no_rt),
5354
("coherence", "perform coherence checking", coherence),
54-
("borrowck-stats", "gather borrowck statistics", borrowck_stats)
55+
("borrowck-stats", "gather borrowck statistics", borrowck_stats),
56+
("borrowck-note-pure", "note where purity is req'd",
57+
borrowck_note_pure)
5558
]
5659
}
5760

@@ -168,6 +171,7 @@ impl session for session {
168171
fn trace() -> bool { self.debugging_opt(trace) }
169172
fn coherence() -> bool { self.debugging_opt(coherence) }
170173
fn borrowck_stats() -> bool { self.debugging_opt(borrowck_stats) }
174+
fn borrowck_note_pure() -> bool { self.debugging_opt(borrowck_note_pure) }
171175
}
172176

173177
/// Some reasonable defaults

trunk/src/rustc/middle/borrowck/gather_loans.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ impl methods for gather_loan_ctxt {
246246
some(scope_id) {
247247
self.req_maps.pure_map.insert(scope_id, e);
248248
self.bccx.req_pure_paths += 1;
249+
250+
if self.tcx().sess.borrowck_note_pure() {
251+
self.bccx.span_note(
252+
cmt.span,
253+
#fmt["purity required"]);
254+
}
249255
}
250256
none {
251257
// otherwise, fine, I give up.

0 commit comments

Comments
 (0)