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