@@ -120,8 +120,10 @@ pub fn get() -> &'static InterpreterConfig {
120120 . map ( |path| path. exists ( ) )
121121 . unwrap_or ( false ) ;
122122
123- // CONFIG_FILE is generated in build.rs, so its content can vary
124- #[ allow( unknown_lints, clippy:: const_is_empty) ]
123+ #[ allow(
124+ clippy:: const_is_empty,
125+ reason = "CONFIG_FILE is generated in build.rs, content can vary"
126+ ) ]
125127 if let Some ( interpreter_config) = InterpreterConfig :: from_cargo_dep_env ( ) {
126128 interpreter_config
127129 } else if let Some ( interpreter_config) = config_from_pyo3_config_file_env ( ) {
@@ -141,8 +143,10 @@ fn config_from_pyo3_config_file_env() -> Option<InterpreterConfig> {
141143 #[ doc( hidden) ]
142144 const CONFIG_FILE : & str = include_str ! ( concat!( env!( "OUT_DIR" ) , "/pyo3-build-config-file.txt" ) ) ;
143145
144- // CONFIG_FILE is generated in build.rs, so its content can vary
145- #[ allow( clippy:: const_is_empty) ]
146+ #[ allow(
147+ clippy:: const_is_empty,
148+ reason = "CONFIG_FILE is generated in build.rs, content can vary"
149+ ) ]
146150 if !CONFIG_FILE . is_empty ( ) {
147151 let config = InterpreterConfig :: from_reader ( Cursor :: new ( CONFIG_FILE ) )
148152 . expect ( "contents of CONFIG_FILE should always be valid (generated by pyo3-build-config's build.rs)" ) ;
@@ -265,8 +269,10 @@ pub mod pyo3_build_script_impl {
265269 /// Steps 2 and 3 are necessary because `pyo3-ffi`'s build script is the first code run which knows
266270 /// the correct target triple.
267271 pub fn resolve_build_config ( target : & Triple ) -> Result < BuildConfig > {
268- // CONFIG_FILE is generated in build.rs, so it's content can vary
269- #[ allow( unknown_lints, clippy:: const_is_empty) ]
272+ #[ allow(
273+ clippy:: const_is_empty,
274+ reason = "CONFIG_FILE is generated in build.rs, content can vary"
275+ ) ]
270276 if let Some ( mut interpreter_config) = config_from_pyo3_config_file_env ( ) {
271277 interpreter_config. apply_default_lib_name_to_config_file ( target) ;
272278 interpreter_config. generate_import_libs ( ) ?;
0 commit comments