File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,26 @@ impl LintStore {
287287 self . by_name . insert ( old_name. to_string ( ) , Renamed ( new_name. to_string ( ) , target) ) ;
288288 }
289289
290+ #[ track_caller]
291+ pub fn register_renamed_group ( & mut self , old_name : & ' static str , new_name : & ' static str ) {
292+ let prev_lint = self . lint_groups . insert (
293+ old_name,
294+ LintGroup {
295+ lint_ids : vec ! [ ] ,
296+ is_externally_loaded : false ,
297+ depr : Some ( LintAlias { name : new_name, silent : false } ) ,
298+ } ,
299+ ) ;
300+
301+ if prev_lint. is_some ( ) {
302+ bug ! ( "The lint group {old_name} has already been registered" ) ;
303+ }
304+
305+ if !self . lint_groups . contains_key ( new_name) {
306+ bug ! ( "The lint group {new_name} has not been registered" ) ;
307+ }
308+ }
309+
290310 pub fn register_removed ( & mut self , name : & str , reason : & str ) {
291311 self . by_name . insert ( name. into ( ) , Removed ( reason. into ( ) ) ) ;
292312 }
You can’t perform that action at this time.
0 commit comments