@@ -131,8 +131,8 @@ pub enum CheckLintNameResult<'a> {
131
131
/// Lint doesn't exist
132
132
NoLint ,
133
133
/// The lint is either renamed or removed. This is the warning
134
- /// message.
135
- Warning ( String ) ,
134
+ /// message, and an optional new name (`None` if removed) .
135
+ Warning ( String , Option < String > ) ,
136
136
}
137
137
138
138
impl LintStore {
@@ -280,7 +280,7 @@ impl LintStore {
280
280
level : Level ) {
281
281
let db = match self . check_lint_name ( lint_name) {
282
282
CheckLintNameResult :: Ok ( _) => None ,
283
- CheckLintNameResult :: Warning ( ref msg) => {
283
+ CheckLintNameResult :: Warning ( ref msg, _ ) => {
284
284
Some ( sess. struct_warn ( msg) )
285
285
} ,
286
286
CheckLintNameResult :: NoLint => {
@@ -313,12 +313,14 @@ impl LintStore {
313
313
match self . by_name . get ( lint_name) {
314
314
Some ( & Renamed ( ref new_name, _) ) => {
315
315
CheckLintNameResult :: Warning (
316
- format ! ( "lint {} has been renamed to {}" , lint_name, new_name)
316
+ format ! ( "lint `{}` has been renamed to `{}`" , lint_name, new_name) ,
317
+ Some ( new_name. to_owned ( ) )
317
318
)
318
319
} ,
319
320
Some ( & Removed ( ref reason) ) => {
320
321
CheckLintNameResult :: Warning (
321
- format ! ( "lint {} has been removed: {}" , lint_name, reason)
322
+ format ! ( "lint `{}` has been removed: `{}`" , lint_name, reason) ,
323
+ None
322
324
)
323
325
} ,
324
326
None => {
0 commit comments