Skip to content

Commit 6b00b61

Browse files
committed
---
yaml --- r: 92663 b: refs/heads/auto c: 4173785 h: refs/heads/master i: 92661: b365c02 92659: dbaf81d 92655: af2da82 v: v3
1 parent 2799db5 commit 6b00b61

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
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: 43aee50798d78a2e33410fcac462ded792c4c7b7
16+
refs/heads/auto: 417378554c076d2c3b42156fc046fd390587af41
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use middle;
2626
use util::common::time;
2727
use util::ppaux;
2828

29+
use std::cell::RefCell;
2930
use std::hashmap::{HashMap,HashSet};
3031
use std::io;
3132
use std::io::fs;
@@ -872,7 +873,7 @@ pub fn build_session_(sopts: @session::options,
872873
filesearch: filesearch,
873874
building_library: @mut false,
874875
working_dir: os::getcwd(),
875-
lints: @mut HashMap::new(),
876+
lints: RefCell::new(HashMap::new()),
876877
node_id: @mut 1,
877878
outputs: @mut ~[],
878879
}

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

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

31+
use std::cell::RefCell;
3132
use std::hashmap::{HashMap,HashSet};
3233

3334
pub struct config {
@@ -211,7 +212,8 @@ pub struct Session_ {
211212
filesearch: @filesearch::FileSearch,
212213
building_library: @mut bool,
213214
working_dir: Path,
214-
lints: @mut HashMap<ast::NodeId, ~[(lint::lint, codemap::Span, ~str)]>,
215+
lints: RefCell<HashMap<ast::NodeId,
216+
~[(lint::lint, codemap::Span, ~str)]>>,
215217
node_id: @mut ast::NodeId,
216218
outputs: @mut ~[OutputStyle],
217219
}
@@ -269,11 +271,12 @@ impl Session_ {
269271
id: ast::NodeId,
270272
sp: Span,
271273
msg: ~str) {
272-
match self.lints.find_mut(&id) {
274+
let mut lints = self.lints.borrow_mut();
275+
match lints.get().find_mut(&id) {
273276
Some(arr) => { arr.push((lint, sp, msg)); return; }
274277
None => {}
275278
}
276-
self.lints.insert(id, ~[(lint, sp, msg)]);
279+
lints.get().insert(id, ~[(lint, sp, msg)]);
277280
}
278281
pub fn next_node_id(&self) -> ast::NodeId {
279282
self.reserve_node_ids(1)

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,8 @@ impl<'a> Visitor<()> for Context<'a> {
14251425

14261426
impl<'a> IdVisitingOperation for Context<'a> {
14271427
fn visit_id(&self, id: ast::NodeId) {
1428-
match self.tcx.sess.lints.pop(&id) {
1428+
let mut lints = self.tcx.sess.lints.borrow_mut();
1429+
match lints.get().pop(&id) {
14291430
None => {}
14301431
Some(l) => {
14311432
for (lint, span, msg) in l.move_iter() {
@@ -1477,7 +1478,8 @@ pub fn check_crate(tcx: ty::ctxt,
14771478

14781479
// If we missed any lints added to the session, then there's a bug somewhere
14791480
// in the iteration code.
1480-
for (id, v) in tcx.sess.lints.iter() {
1481+
let lints = tcx.sess.lints.borrow();
1482+
for (id, v) in lints.get().iter() {
14811483
for &(lint, span, ref msg) in v.iter() {
14821484
tcx.sess.span_bug(span, format!("unprocessed lint {:?} at {}: {}",
14831485
lint,

0 commit comments

Comments
 (0)