@@ -393,7 +393,6 @@ pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
393
393
394
394
#[ doc( hidden) ]
395
395
pub fn read_conf ( sess : & Session ) -> Conf {
396
- use std:: path:: Path ;
397
396
let file_name = match utils:: conf:: lookup_conf_file ( ) {
398
397
Ok ( Some ( path) ) => path,
399
398
Ok ( None ) => return Conf :: default ( ) ,
@@ -404,16 +403,6 @@ pub fn read_conf(sess: &Session) -> Conf {
404
403
} ,
405
404
} ;
406
405
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
-
417
406
let TryConf { conf, errors } = utils:: conf:: read ( & file_name) ;
418
407
// all conf errors are non-fatal, we just use the default conf in case of error
419
408
for error in errors {
@@ -493,6 +482,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
493
482
"clippy::filter_map" ,
494
483
"this lint has been replaced by `manual_filter_map`, a more specific lint" ,
495
484
) ;
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
+ ) ;
496
493
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
497
494
498
495
// 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:
606
603
enum_variants:: ENUM_VARIANT_NAMES ,
607
604
enum_variants:: MODULE_INCEPTION ,
608
605
enum_variants:: MODULE_NAME_REPETITIONS ,
609
- enum_variants:: PUB_ENUM_VARIANT_NAMES ,
610
606
eq_op:: EQ_OP ,
611
607
eq_op:: OP_REF ,
612
608
erasing_op:: ERASING_OP ,
@@ -790,7 +786,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
790
786
methods:: UNNECESSARY_LAZY_EVALUATIONS ,
791
787
methods:: UNWRAP_USED ,
792
788
methods:: USELESS_ASREF ,
793
- methods:: WRONG_PUB_SELF_CONVENTION ,
794
789
methods:: WRONG_SELF_CONVENTION ,
795
790
methods:: ZST_OFFSET ,
796
791
minmax:: MIN_MAX ,
@@ -1014,7 +1009,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1014
1009
LintId :: of( methods:: FILETYPE_IS_FILE ) ,
1015
1010
LintId :: of( methods:: GET_UNWRAP ) ,
1016
1011
LintId :: of( methods:: UNWRAP_USED ) ,
1017
- LintId :: of( methods:: WRONG_PUB_SELF_CONVENTION ) ,
1018
1012
LintId :: of( misc:: FLOAT_CMP_CONST ) ,
1019
1013
LintId :: of( misc_early:: UNNEEDED_FIELD_PATTERN ) ,
1020
1014
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:
1066
1060
LintId :: of( doc:: MISSING_PANICS_DOC ) ,
1067
1061
LintId :: of( empty_enum:: EMPTY_ENUM ) ,
1068
1062
LintId :: of( enum_variants:: MODULE_NAME_REPETITIONS ) ,
1069
- LintId :: of( enum_variants:: PUB_ENUM_VARIANT_NAMES ) ,
1070
1063
LintId :: of( eta_reduction:: REDUNDANT_CLOSURE_FOR_METHOD_CALLS ) ,
1071
1064
LintId :: of( excessive_bools:: FN_PARAMS_EXCESSIVE_BOOLS ) ,
1072
1065
LintId :: of( excessive_bools:: STRUCT_EXCESSIVE_BOOLS ) ,
@@ -1850,7 +1843,8 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1850
1843
} )
1851
1844
} ) ;
1852
1845
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) ) ;
1854
1848
store. register_late_pass ( move || box matches:: Matches :: new ( msrv) ) ;
1855
1849
store. register_early_pass ( move || box manual_non_exhaustive:: ManualNonExhaustive :: new ( msrv) ) ;
1856
1850
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:
1932
1926
let pass_by_ref_or_value = pass_by_ref_or_value:: PassByRefOrValue :: new (
1933
1927
conf. trivial_copy_size_limit ,
1934
1928
conf. pass_by_value_size_limit ,
1929
+ conf. avoid_breaking_exported_api ,
1935
1930
& sess. target ,
1936
1931
) ;
1937
1932
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:
1958
1953
store. register_late_pass ( || box redundant_clone:: RedundantClone ) ;
1959
1954
store. register_late_pass ( || box slow_vector_initialization:: SlowVectorInit ) ;
1960
1955
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 ) ) ;
1962
1957
store. register_late_pass ( || box assertions_on_constants:: AssertionsOnConstants ) ;
1963
1958
store. register_late_pass ( || box transmuting_null:: TransmutingNull ) ;
1964
1959
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:
1999
1994
let literal_representation_threshold = conf. literal_representation_threshold ;
2000
1995
store. register_early_pass ( move || box literal_representation:: DecimalLiteralRepresentation :: new ( literal_representation_threshold) ) ;
2001
1996
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 ) ) ;
2003
1998
store. register_early_pass ( || box tabs_in_doc_comments:: TabsInDocComments ) ;
2004
1999
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) ) ;
2006
2001
store. register_late_pass ( || box default:: Default :: default ( ) ) ;
2007
2002
store. register_late_pass ( || box unused_self:: UnusedSelf ) ;
2008
2003
store. register_late_pass ( || box mutable_debug_assertion:: DebugAssertWithMutCall ) ;
0 commit comments