@@ -393,7 +393,6 @@ pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
393393
394394#[ doc( hidden) ]
395395pub fn read_conf ( sess : & Session ) -> Conf {
396- use std:: path:: Path ;
397396 let file_name = match utils:: conf:: lookup_conf_file ( ) {
398397 Ok ( Some ( path) ) => path,
399398 Ok ( None ) => return Conf :: default ( ) ,
@@ -404,16 +403,6 @@ pub fn read_conf(sess: &Session) -> Conf {
404403 } ,
405404 } ;
406405
407- let file_name = if file_name. is_relative ( ) {
408- sess. local_crate_source_file
409- . as_deref ( )
410- . and_then ( Path :: parent)
411- . unwrap_or_else ( || Path :: new ( "" ) )
412- . join ( file_name)
413- } else {
414- file_name
415- } ;
416-
417406 let TryConf { conf, errors } = utils:: conf:: read ( & file_name) ;
418407 // all conf errors are non-fatal, we just use the default conf in case of error
419408 for error in errors {
@@ -493,6 +482,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
493482 "clippy::filter_map" ,
494483 "this lint has been replaced by `manual_filter_map`, a more specific lint" ,
495484 ) ;
485+ store. register_removed (
486+ "clippy::pub_enum_variant_names" ,
487+ "set the `avoid_breaking_exported_api` config option to `false` to enable the `enum_variant_names` lint for public items" ,
488+ ) ;
489+ store. register_removed (
490+ "clippy::wrong_pub_self_convention" ,
491+ "set the `avoid_breaking_exported_api` config option to `false` to enable the `wrong_self_convention` lint for public items" ,
492+ ) ;
496493 // end deprecated lints, do not remove this comment, it’s used in `update_lints`
497494
498495 // begin register lints, do not remove this comment, it’s used in `update_lints`
@@ -606,7 +603,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
606603 enum_variants:: ENUM_VARIANT_NAMES ,
607604 enum_variants:: MODULE_INCEPTION ,
608605 enum_variants:: MODULE_NAME_REPETITIONS ,
609- enum_variants:: PUB_ENUM_VARIANT_NAMES ,
610606 eq_op:: EQ_OP ,
611607 eq_op:: OP_REF ,
612608 erasing_op:: ERASING_OP ,
@@ -790,7 +786,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
790786 methods:: UNNECESSARY_LAZY_EVALUATIONS ,
791787 methods:: UNWRAP_USED ,
792788 methods:: USELESS_ASREF ,
793- methods:: WRONG_PUB_SELF_CONVENTION ,
794789 methods:: WRONG_SELF_CONVENTION ,
795790 methods:: ZST_OFFSET ,
796791 minmax:: MIN_MAX ,
@@ -1014,7 +1009,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10141009 LintId :: of( methods:: FILETYPE_IS_FILE ) ,
10151010 LintId :: of( methods:: GET_UNWRAP ) ,
10161011 LintId :: of( methods:: UNWRAP_USED ) ,
1017- LintId :: of( methods:: WRONG_PUB_SELF_CONVENTION ) ,
10181012 LintId :: of( misc:: FLOAT_CMP_CONST ) ,
10191013 LintId :: of( misc_early:: UNNEEDED_FIELD_PATTERN ) ,
10201014 LintId :: of( missing_doc:: MISSING_DOCS_IN_PRIVATE_ITEMS ) ,
@@ -1066,7 +1060,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10661060 LintId :: of( doc:: MISSING_PANICS_DOC ) ,
10671061 LintId :: of( empty_enum:: EMPTY_ENUM ) ,
10681062 LintId :: of( enum_variants:: MODULE_NAME_REPETITIONS ) ,
1069- LintId :: of( enum_variants:: PUB_ENUM_VARIANT_NAMES ) ,
10701063 LintId :: of( eta_reduction:: REDUNDANT_CLOSURE_FOR_METHOD_CALLS ) ,
10711064 LintId :: of( excessive_bools:: FN_PARAMS_EXCESSIVE_BOOLS ) ,
10721065 LintId :: of( excessive_bools:: STRUCT_EXCESSIVE_BOOLS ) ,
@@ -1850,7 +1843,8 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
18501843 } )
18511844 } ) ;
18521845
1853- store. register_late_pass ( move || box methods:: Methods :: new ( msrv) ) ;
1846+ let avoid_breaking_exported_api = conf. avoid_breaking_exported_api ;
1847+ store. register_late_pass ( move || box methods:: Methods :: new ( avoid_breaking_exported_api, msrv) ) ;
18541848 store. register_late_pass ( move || box matches:: Matches :: new ( msrv) ) ;
18551849 store. register_early_pass ( move || box manual_non_exhaustive:: ManualNonExhaustive :: new ( msrv) ) ;
18561850 store. register_late_pass ( move || box manual_strip:: ManualStrip :: new ( msrv) ) ;
@@ -1932,6 +1926,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
19321926 let pass_by_ref_or_value = pass_by_ref_or_value:: PassByRefOrValue :: new (
19331927 conf. trivial_copy_size_limit ,
19341928 conf. pass_by_value_size_limit ,
1929+ conf. avoid_breaking_exported_api ,
19351930 & sess. target ,
19361931 ) ;
19371932 store. register_late_pass ( move || box pass_by_ref_or_value) ;
@@ -1958,7 +1953,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
19581953 store. register_late_pass ( || box redundant_clone:: RedundantClone ) ;
19591954 store. register_late_pass ( || box slow_vector_initialization:: SlowVectorInit ) ;
19601955 store. register_late_pass ( || box unnecessary_sort_by:: UnnecessarySortBy ) ;
1961- store. register_late_pass ( || box unnecessary_wraps:: UnnecessaryWraps ) ;
1956+ store. register_late_pass ( move || box unnecessary_wraps:: UnnecessaryWraps :: new ( avoid_breaking_exported_api ) ) ;
19621957 store. register_late_pass ( || box assertions_on_constants:: AssertionsOnConstants ) ;
19631958 store. register_late_pass ( || box transmuting_null:: TransmutingNull ) ;
19641959 store. register_late_pass ( || box path_buf_push_overwrite:: PathBufPushOverwrite ) ;
@@ -1999,10 +1994,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
19991994 let literal_representation_threshold = conf. literal_representation_threshold ;
20001995 store. register_early_pass ( move || box literal_representation:: DecimalLiteralRepresentation :: new ( literal_representation_threshold) ) ;
20011996 let enum_variant_name_threshold = conf. enum_variant_name_threshold ;
2002- store. register_early_pass ( move || box enum_variants:: EnumVariantNames :: new ( enum_variant_name_threshold) ) ;
1997+ store. register_late_pass ( move || box enum_variants:: EnumVariantNames :: new ( enum_variant_name_threshold, avoid_breaking_exported_api ) ) ;
20031998 store. register_early_pass ( || box tabs_in_doc_comments:: TabsInDocComments ) ;
20041999 let upper_case_acronyms_aggressive = conf. upper_case_acronyms_aggressive ;
2005- store. register_early_pass ( move || box upper_case_acronyms:: UpperCaseAcronyms :: new ( upper_case_acronyms_aggressive) ) ;
2000+ store. register_late_pass ( move || box upper_case_acronyms:: UpperCaseAcronyms :: new ( avoid_breaking_exported_api , upper_case_acronyms_aggressive) ) ;
20062001 store. register_late_pass ( || box default:: Default :: default ( ) ) ;
20072002 store. register_late_pass ( || box unused_self:: UnusedSelf ) ;
20082003 store. register_late_pass ( || box mutable_debug_assertion:: DebugAssertWithMutCall ) ;
0 commit comments