@@ -131,8 +131,8 @@ pub enum CheckLintNameResult<'a> {
131131 /// Lint doesn't exist
132132 NoLint ,
133133 /// 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 > ) ,
136136}
137137
138138impl LintStore {
@@ -280,7 +280,7 @@ impl LintStore {
280280 level : Level ) {
281281 let db = match self . check_lint_name ( lint_name) {
282282 CheckLintNameResult :: Ok ( _) => None ,
283- CheckLintNameResult :: Warning ( ref msg) => {
283+ CheckLintNameResult :: Warning ( ref msg, _ ) => {
284284 Some ( sess. struct_warn ( msg) )
285285 } ,
286286 CheckLintNameResult :: NoLint => {
@@ -313,12 +313,14 @@ impl LintStore {
313313 match self . by_name . get ( lint_name) {
314314 Some ( & Renamed ( ref new_name, _) ) => {
315315 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 ( ) )
317318 )
318319 } ,
319320 Some ( & Removed ( ref reason) ) => {
320321 CheckLintNameResult :: Warning (
321- format ! ( "lint {} has been removed: {}" , lint_name, reason)
322+ format ! ( "lint `{}` has been removed: `{}`" , lint_name, reason) ,
323+ None
322324 )
323325 } ,
324326 None => {
0 commit comments