File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ static GROUP_DESCRIPTIONS: &[(&str, &str)] = &[
2828 ( "deprecated-safe" , "Lints for functions which were erroneously marked as safe in the past" ) ,
2929] ;
3030
31+ pub fn exists ( name : & str ) -> bool {
32+ GROUP_DESCRIPTIONS . iter ( ) . any ( |& ( n, _) | n == name)
33+ }
34+
3135type LintGroups = BTreeMap < String , BTreeSet < String > > ;
3236
3337impl < ' a > LintExtractor < ' a > {
Original file line number Diff line number Diff line change @@ -578,9 +578,15 @@ impl<'a> LintExtractor<'a> {
578578fn add_renamed_lints ( lints : & mut Vec < Lint > ) {
579579 for ( level, names) in RENAMES {
580580 for ( from, to) in * names {
581+ let doc = if groups:: exists ( to) {
582+ format ! ( "The lint `{from}` has been renamed to the group `{to}`." )
583+ } else {
584+ format ! ( "The lint `{from}` has been renamed to [`{to}`](#{to})." )
585+ } ;
586+
581587 lints. push ( Lint {
582588 name : from. to_string ( ) ,
583- doc : vec ! [ format! ( "The lint `{from}` has been renamed to [`{to}`](#{to})." ) ] ,
589+ doc : vec ! [ doc ] ,
584590 level : * level,
585591 path : PathBuf :: new ( ) ,
586592 lineno : 0 ,
You can’t perform that action at this time.
0 commit comments