File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ pub impl Session_ {
237
237
msg : & str ) {
238
238
let level = lint:: get_lint_settings_level (
239
239
self . lint_settings , lint_mode, expr_id, item_id) ;
240
+ let msg = fmt ! ( "%s [-W %s]" , msg, lint:: get_lint_name( lint_mode) ) ;
240
241
self . span_lint_level ( level, span, msg) ;
241
242
}
242
243
fn next_node_id ( @self ) -> ast:: node_id {
Original file line number Diff line number Diff line change @@ -237,6 +237,14 @@ pub fn get_lint_dict() -> LintDict {
237
237
return @map;
238
238
}
239
239
240
+ pub fn get_lint_name ( lint_mode : lint ) -> ~str {
241
+ for lint_table. each |& ( name, spec) | {
242
+ if spec. lint == lint_mode {
243
+ return name. to_str ( ) ;
244
+ }
245
+ }
246
+ fail ! ( ) ;
247
+ }
240
248
// This is a highly not-optimal set of data structure decisions.
241
249
type LintModes = @mut SmallIntMap < level > ;
242
250
type LintModeMap = @mut HashMap < ast:: node_id , LintModes > ;
You can’t perform that action at this time.
0 commit comments