Skip to content

Commit 82a64ba

Browse files
committed
---
yaml --- r: 147934 b: refs/heads/try2 c: 39f0270 h: refs/heads/master v: v3
1 parent 84ef209 commit 82a64ba

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1dbeb5b2ac3ee6ea0634036e9778b2eb5a2445e4
8+
refs/heads/try2: 39f0270544af19bf51b0088c93fe5cf58a8eccbe
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libsyntax/ast_util.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use parse::token;
1717
use visit::Visitor;
1818
use visit;
1919

20-
use std::cell::RefCell;
20+
use std::cell::{Cell, RefCell};
2121
use std::hashmap::HashMap;
2222
use std::u32;
2323
use std::local_data;
@@ -602,21 +602,23 @@ pub fn visit_ids_for_inlined_item<O: IdVisitingOperation>(item: &inlined_item,
602602
}
603603

604604
struct IdRangeComputingVisitor {
605-
result: @mut id_range,
605+
result: Cell<id_range>,
606606
}
607607

608608
impl IdVisitingOperation for IdRangeComputingVisitor {
609609
fn visit_id(&self, id: NodeId) {
610-
self.result.add(id)
610+
let mut id_range = self.result.get();
611+
id_range.add(id);
612+
self.result.set(id_range)
611613
}
612614
}
613615

614616
pub fn compute_id_range_for_inlined_item(item: &inlined_item) -> id_range {
615-
let result = @mut id_range::max();
616-
visit_ids_for_inlined_item(item, &IdRangeComputingVisitor {
617-
result: result,
618-
});
619-
*result
617+
let visitor = IdRangeComputingVisitor {
618+
result: Cell::new(id_range::max())
619+
};
620+
visit_ids_for_inlined_item(item, &visitor);
621+
visitor.result.get()
620622
}
621623

622624
pub fn is_item_impl(item: @ast::item) -> bool {

0 commit comments

Comments
 (0)