@@ -40,6 +40,8 @@ const DEFAULT_DOC_VALID_IDENTS: &[&str] = &[
4040const DEFAULT_DISALLOWED_NAMES : & [ & str ] = & [ "foo" , "baz" , "quux" ] ;
4141const DEFAULT_ALLOWED_IDENTS_BELOW_MIN_CHARS : & [ & str ] = & [ "i" , "j" , "x" , "y" , "z" , "w" , "n" ] ;
4242const DEFAULT_ALLOWED_PREFIXES : & [ & str ] = & [ "to" , "as" , "into" , "from" , "try_into" , "try_from" ] ;
43+ const DEFAULT_ALLOWED_TRAITS_WITH_RENAMED_PARAMS : & [ & str ] =
44+ & [ "core::convert::From" , "core::convert::TryFrom" , "core::str::FromStr" ] ;
4345
4446/// Conf with parse errors
4547#[ derive( Default ) ]
@@ -455,6 +457,10 @@ define_Conf! {
455457 ///
456458 /// Whether `unwrap` should be allowed in test functions or `#[cfg(test)]`
457459 ( allow_unwrap_in_tests: bool = false ) ,
460+ /// Lint: PANIC.
461+ ///
462+ /// Whether `panic` should be allowed in test functions or `#[cfg(test)]`
463+ ( allow_panic_in_tests: bool = false ) ,
458464 /// Lint: DBG_MACRO.
459465 ///
460466 /// Whether `dbg!` should be allowed in test functions or `#[cfg(test)]`
@@ -613,6 +619,27 @@ define_Conf! {
613619 /// - Use `".."` as part of the list to indicate that the configured values should be appended to the
614620 /// default configuration of Clippy. By default, any configuration will replace the default value
615621 ( allowed_prefixes: Vec <String > = DEFAULT_ALLOWED_PREFIXES . iter( ) . map( ToString :: to_string) . collect( ) ) ,
622+ /// Lint: RENAMED_FUNCTION_PARAMS.
623+ ///
624+ /// List of trait paths to ignore when checking renamed function parameters.
625+ ///
626+ /// #### Example
627+ ///
628+ /// ```toml
629+ /// allow-renamed-params-for = [ "std::convert::From" ]
630+ /// ```
631+ ///
632+ /// #### Noteworthy
633+ ///
634+ /// - By default, the following traits are ignored: `From`, `TryFrom`, `FromStr`
635+ /// - `".."` can be used as part of the list to indicate that the configured values should be appended to the
636+ /// default configuration of Clippy. By default, any configuration will replace the default value.
637+ ( allow_renamed_params_for: Vec <String > =
638+ DEFAULT_ALLOWED_TRAITS_WITH_RENAMED_PARAMS . iter( ) . map( ToString :: to_string) . collect( ) ) ,
639+ /// Lint: MACRO_METAVARS_IN_UNSAFE.
640+ ///
641+ /// Whether to also emit warnings for unsafe blocks with metavariable expansions in **private** macros.
642+ ( warn_unsafe_macro_metavars_in_private_macros: bool = false ) ,
616643}
617644
618645/// Search for the configuration file.
@@ -674,6 +701,10 @@ fn deserialize(file: &SourceFile) -> TryConf {
674701 extend_vec_if_indicator_present ( & mut conf. conf . doc_valid_idents , DEFAULT_DOC_VALID_IDENTS ) ;
675702 extend_vec_if_indicator_present ( & mut conf. conf . disallowed_names , DEFAULT_DISALLOWED_NAMES ) ;
676703 extend_vec_if_indicator_present ( & mut conf. conf . allowed_prefixes , DEFAULT_ALLOWED_PREFIXES ) ;
704+ extend_vec_if_indicator_present (
705+ & mut conf. conf . allow_renamed_params_for ,
706+ DEFAULT_ALLOWED_TRAITS_WITH_RENAMED_PARAMS ,
707+ ) ;
677708 // TODO: THIS SHOULD BE TESTED, this comment will be gone soon
678709 if conf. conf . allowed_idents_below_min_chars . contains ( ".." ) {
679710 conf. conf
0 commit comments