Skip to content

Commit 9aedd4a

Browse files
committed
---
yaml --- r: 111214 b: refs/heads/snap-stage3 c: 2a4dd43 h: refs/heads/master v: v3
1 parent 8def143 commit 9aedd4a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 296e60be6b027a52de58251848037a92f23a0878
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 186ac7116c555ba90031eab71fa27dd71326bf6a
4+
refs/heads/snap-stage3: 2a4dd43e4442b418c27dee3de8b644cae9dcb3d4
55
refs/heads/try: 38201d7c6bf0c32b0e5bdc8ecd63976ebc1b3a4c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)