{"record":{"id":"63b7477b1c16a710","repo":"rust-lang/rust-clippy","slug":"using-config-file-will-be-ignored","errorCode":null,"errorMessage":"using config file `{}`, `{}` will be ignored","messagePattern":"using config file `(.+?)`, `(.+?)` will be ignored","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clippy_config/src/conf.rs","lineNumber":895,"sourceCode":"        .into_iter()\n        .find_map(|(var, msg)| env::var_os(var).map(|p| (PathBuf::from(p), msg)))\n        .unwrap_or_else(|| (PathBuf::from(\".\"), \"failed to get the current directory\"));\n    let mut current = match current.canonicalize() {\n        Ok(x) => x,\n        Err(e) => {\n            sess.dcx().err(format!(\"{msg}: {e}\"));\n            return None;\n        },\n    };\n\n    let mut loaded_config: Option<(PathBuf, Arc<SourceFile>)> = None;\n    loop {\n        for config_file_name in CONFIG_FILE_NAMES {\n            if let Ok(config_path) = current.join(config_file_name).canonicalize() {\n                if let Some((loaded_path, _)) = &loaded_config {\n                    if fs::metadata(loaded_path).is_ok_and(|x| x.is_file()) {\n                        // Warn if `.clippy.toml` and `clippy.toml` exist\n                        sess.dcx().warn(format!(\n                            \"using config file `{}`, `{}` will be ignored\",\n                            loaded_path.display(),\n                            config_path.display(),\n                        ));\n                    }\n                } else {\n                    match sess.source_map().load_file(&config_path) {\n                        Ok(src) => loaded_config = Some((config_path, src)),\n                        Err(e)\n                            if matches!(\n                                e.kind(),\n                                io::ErrorKind::NotFound | io::ErrorKind::IsADirectory | io::ErrorKind::NotADirectory\n                            ) => {},\n                        Err(e) => {\n                            sess.dcx()\n                                .err(format!(\"error reading `{}`: {e}\", config_path.display()));\n                            return None;\n                        },","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/rust-lang/rust-clippy/blob/13aece11388703700981f29d9480ffd6409a3192/clippy_config/src/conf.rs#L877-L913","documentation":"A warning, not a hard error: both .clippy.toml and clippy.toml exist in the same directory, and Clippy only loads one of them. load_conf_file iterates CONFIG_FILE_NAMES in order, so .clippy.toml wins and clippy.toml is silently skipped. The first placeholder is the loaded path and the second the ignored one. The mismatch usually comes from tooling or teammates generating differently-named config files.","triggerScenarios":"Thrown at clippy_config/src/conf.rs:895 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete or rename the redundant config file so only one of .clippy.toml / clippy.toml remains","Merge any settings from the ignored file into the loaded one before removing it","Add a repo convention or lint check that rejects committing both filenames"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13aece11388703700981f29d9480ffd6409a3192","analyzedAt":"2026-09-07T23:08:18.134Z","contentChangedAt":"2026-09-07T23:08:18.134Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}