Skip to content

Commit 2a4dd43

Browse files
committed
rustc: de-@ lint.
1 parent 186ac71 commit 2a4dd43

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/librustc/middle/lint.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,16 +423,12 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
423423
'-' to '_' in command-line flags
424424
*/
425425
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()
431427
}
432428

433429
struct Context<'a> {
434430
// All known lint modes (string versions)
435-
dict: @LintDict,
431+
dict: LintDict,
436432
// Current levels of each lint warning
437433
cur: SmallIntMap<(level, LintSource)>,
438434
// context we're checking in (used to access fields like sess)
@@ -1775,7 +1771,7 @@ pub fn check_crate(tcx: &ty::ctxt,
17751771
exported_items: &privacy::ExportedItems,
17761772
krate: &ast::Crate) {
17771773
let mut cx = Context {
1778-
dict: @get_lint_dict(),
1774+
dict: get_lint_dict(),
17791775
cur: SmallIntMap::new(),
17801776
tcx: tcx,
17811777
exported_items: exported_items,
@@ -1788,7 +1784,9 @@ pub fn check_crate(tcx: &ty::ctxt,
17881784
// Install default lint levels, followed by the command line levels, and
17891785
// then actually visit the whole crate.
17901786
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+
}
17921790
}
17931791
for &(lint, level) in tcx.sess.opts.lint_opts.iter() {
17941792
cx.set_level(lint, level, CommandLine);

0 commit comments

Comments
 (0)