@@ -34,8 +34,7 @@ use core::uint;
34
34
use core:: vec;
35
35
use std:: oldmap:: { Map , HashMap } ;
36
36
use std:: oldmap;
37
- use std:: oldsmallintmap:: { Map , SmallIntMap } ;
38
- use std:: oldsmallintmap;
37
+ use std:: smallintmap:: SmallIntMap ;
39
38
use syntax:: ast_util:: { path_to_ident} ;
40
39
use syntax:: attr;
41
40
use syntax:: codemap:: span;
@@ -275,7 +274,7 @@ pub fn get_lint_dict() -> LintDict {
275
274
}
276
275
277
276
// This is a highly not-optimal set of data structure decisions.
278
- type LintModes = SmallIntMap < level > ;
277
+ type LintModes = @ mut SmallIntMap < level > ;
279
278
type LintModeMap = HashMap < ast:: node_id , LintModes > ;
280
279
281
280
// settings_map maps node ids of items with non-default lint settings
@@ -288,14 +287,14 @@ pub struct LintSettings {
288
287
289
288
pub fn mk_lint_settings ( ) -> LintSettings {
290
289
LintSettings {
291
- default_settings : oldsmallintmap :: mk ( ) ,
290
+ default_settings : @ mut SmallIntMap :: new ( ) ,
292
291
settings_map : HashMap ( )
293
292
}
294
293
}
295
294
296
295
pub fn get_lint_level ( modes : LintModes , lint : lint ) -> level {
297
- match modes. find ( lint as uint ) {
298
- Some ( c) => c,
296
+ match modes. find ( & ( lint as uint ) ) {
297
+ Some ( & c) => c,
299
298
None => allow
300
299
}
301
300
}
@@ -314,8 +313,7 @@ pub fn get_lint_settings_level(settings: LintSettings,
314
313
// This is kind of unfortunate. It should be somewhere else, or we should use
315
314
// a persistent data structure...
316
315
fn clone_lint_modes ( modes : LintModes ) -> LintModes {
317
- oldsmallintmap:: SmallIntMap_ ( @oldsmallintmap:: SmallIntMap_
318
- { v : copy modes. v } )
316
+ @mut ( copy * modes)
319
317
}
320
318
321
319
struct Context {
@@ -332,7 +330,7 @@ impl Context {
332
330
333
331
fn set_level ( & self , lint : lint , level : level ) {
334
332
if level == allow {
335
- self . curr . remove ( lint as uint ) ;
333
+ self . curr . remove ( & ( lint as uint ) ) ;
336
334
} else {
337
335
self . curr . insert ( lint as uint , level) ;
338
336
}
@@ -440,7 +438,7 @@ fn build_settings_item(i: @ast::item, &&cx: Context, v: visit::vt<Context>) {
440
438
pub fn build_settings_crate ( sess : session:: Session , crate : @ast:: crate ) {
441
439
let cx = Context {
442
440
dict : get_lint_dict ( ) ,
443
- curr : oldsmallintmap :: mk ( ) ,
441
+ curr : @ mut SmallIntMap :: new ( ) ,
444
442
is_default : true ,
445
443
sess : sess
446
444
} ;
@@ -458,7 +456,7 @@ pub fn build_settings_crate(sess: session::Session, crate: @ast::crate) {
458
456
459
457
do cx. with_lint_attrs ( /*bad*/ copy crate. node . attrs ) |cx| {
460
458
// Copy out the default settings
461
- for cx. curr . each |k, v | {
459
+ for cx. curr . each |& ( k, & v ) | {
462
460
sess. lint_settings . default_settings . insert ( k, v) ;
463
461
}
464
462
0 commit comments