@@ -423,16 +423,12 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
423
423
'-' to '_' in command-line flags
424
424
*/
425
425
pub fn get_lint_dict ( ) -> LintDict {
426
- let mut map = HashMap :: new ( ) ;
427
- for & ( k, v) in lint_table. iter ( ) {
428
- map. insert ( k, v) ;
429
- }
430
- return map;
426
+ lint_table. iter ( ) . map ( |& ( k, v) | ( k, v) ) . collect ( )
431
427
}
432
428
433
429
struct Context < ' a > {
434
430
// All known lint modes (string versions)
435
- dict : @ LintDict ,
431
+ dict : LintDict ,
436
432
// Current levels of each lint warning
437
433
cur : SmallIntMap < ( level , LintSource ) > ,
438
434
// context we're checking in (used to access fields like sess)
@@ -1775,7 +1771,7 @@ pub fn check_crate(tcx: &ty::ctxt,
1775
1771
exported_items : & privacy:: ExportedItems ,
1776
1772
krate : & ast:: Crate ) {
1777
1773
let mut cx = Context {
1778
- dict : @ get_lint_dict ( ) ,
1774
+ dict : get_lint_dict ( ) ,
1779
1775
cur : SmallIntMap :: new ( ) ,
1780
1776
tcx : tcx,
1781
1777
exported_items : exported_items,
@@ -1788,7 +1784,9 @@ pub fn check_crate(tcx: &ty::ctxt,
1788
1784
// Install default lint levels, followed by the command line levels, and
1789
1785
// then actually visit the whole crate.
1790
1786
for ( _, spec) in cx. dict . iter ( ) {
1791
- cx. set_level ( spec. lint , spec. default , Default ) ;
1787
+ if spec. default != allow {
1788
+ cx. cur . insert ( spec. lint as uint , ( spec. default , Default ) ) ;
1789
+ }
1792
1790
}
1793
1791
for & ( lint, level) in tcx. sess . opts . lint_opts . iter ( ) {
1794
1792
cx. set_level ( lint, level, CommandLine ) ;
0 commit comments