@@ -34,8 +34,7 @@ use core::uint;
3434use core:: vec;
3535use std:: oldmap:: { Map , HashMap } ;
3636use std:: oldmap;
37- use std:: oldsmallintmap:: { Map , SmallIntMap } ;
38- use std:: oldsmallintmap;
37+ use std:: smallintmap:: SmallIntMap ;
3938use syntax:: ast_util:: { path_to_ident} ;
4039use syntax:: attr;
4140use syntax:: codemap:: span;
@@ -275,7 +274,7 @@ pub fn get_lint_dict() -> LintDict {
275274}
276275
277276// This is a highly not-optimal set of data structure decisions.
278- type LintModes = SmallIntMap < level > ;
277+ type LintModes = @ mut SmallIntMap < level > ;
279278type LintModeMap = HashMap < ast:: node_id , LintModes > ;
280279
281280// settings_map maps node ids of items with non-default lint settings
@@ -288,14 +287,14 @@ pub struct LintSettings {
288287
289288pub fn mk_lint_settings ( ) -> LintSettings {
290289 LintSettings {
291- default_settings : oldsmallintmap :: mk ( ) ,
290+ default_settings : @ mut SmallIntMap :: new ( ) ,
292291 settings_map : HashMap ( )
293292 }
294293}
295294
296295pub 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,
299298 None => allow
300299 }
301300}
@@ -314,8 +313,7 @@ pub fn get_lint_settings_level(settings: LintSettings,
314313// This is kind of unfortunate. It should be somewhere else, or we should use
315314// a persistent data structure...
316315fn clone_lint_modes ( modes : LintModes ) -> LintModes {
317- oldsmallintmap:: SmallIntMap_ ( @oldsmallintmap:: SmallIntMap_
318- { v : copy modes. v } )
316+ @mut ( copy * modes)
319317}
320318
321319struct Context {
@@ -332,7 +330,7 @@ impl Context {
332330
333331 fn set_level ( & self , lint : lint , level : level ) {
334332 if level == allow {
335- self . curr . remove ( lint as uint ) ;
333+ self . curr . remove ( & ( lint as uint ) ) ;
336334 } else {
337335 self . curr . insert ( lint as uint , level) ;
338336 }
@@ -440,7 +438,7 @@ fn build_settings_item(i: @ast::item, &&cx: Context, v: visit::vt<Context>) {
440438pub fn build_settings_crate ( sess : session:: Session , crate : @ast:: crate ) {
441439 let cx = Context {
442440 dict : get_lint_dict ( ) ,
443- curr : oldsmallintmap :: mk ( ) ,
441+ curr : @ mut SmallIntMap :: new ( ) ,
444442 is_default : true ,
445443 sess : sess
446444 } ;
@@ -458,7 +456,7 @@ pub fn build_settings_crate(sess: session::Session, crate: @ast::crate) {
458456
459457 do cx. with_lint_attrs ( /*bad*/ copy crate. node . attrs ) |cx| {
460458 // Copy out the default settings
461- for cx. curr . each |k, v | {
459+ for cx. curr . each |& ( k, & v ) | {
462460 sess. lint_settings . default_settings . insert ( k, v) ;
463461 }
464462
0 commit comments