Show lint names
This commit is contained in:
parent
356ebe8792
commit
dc48a558b6
@ -234,6 +234,7 @@ pub impl Session_ {
|
||||
msg: &str) {
|
||||
let level = lint::get_lint_settings_level(
|
||||
self.lint_settings, lint_mode, expr_id, item_id);
|
||||
let msg = fmt!("%s [-W%s]", msg, lint::get_lint_name(lint_mode));
|
||||
self.span_lint_level(level, span, msg);
|
||||
}
|
||||
fn next_node_id(@self) -> ast::node_id {
|
||||
|
@ -245,6 +245,14 @@ pub fn get_lint_dict() -> LintDict {
|
||||
return @map;
|
||||
}
|
||||
|
||||
pub fn get_lint_name(lint_mode: lint) -> ~str {
|
||||
for lint_table.each |&(name, spec)| {
|
||||
if spec.lint == lint_mode {
|
||||
return name.to_str();
|
||||
}
|
||||
}
|
||||
fail!();
|
||||
}
|
||||
// This is a highly not-optimal set of data structure decisions.
|
||||
type LintModes = @mut SmallIntMap<level>;
|
||||
type LintModeMap = @mut HashMap<ast::node_id, LintModes>;
|
||||
|
Loading…
Reference in New Issue
Block a user