{"record":{"id":"8361694e33dddaa3","repo":"rust-lang/rust-clippy","slug":"msg-e","errorCode":null,"errorMessage":"{msg}: {e}","messagePattern":"\\{msg\\}: \\{e\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clippy_config/src/conf.rs","lineNumber":883,"sourceCode":"    const CONFIG_FILE_NAMES: [&str; 2] = [\".clippy.toml\", \"clippy.toml\"];\n\n    // Start looking for a config file in CLIPPY_CONF_DIR, or failing that, CARGO_MANIFEST_DIR.\n    // If neither of those exist, use \".\". (Update documentation if this priority changes)\n    const CONFIG_VARS: [(&str, &str); 2] = [\n        (\"CLIPPY_CONF_DIR\", \"failed to read `CLIPPY_CONF_DIR` as a directory\"),\n        (\n            \"CARGO_MANIFEST_DIR\",\n            \"failed to read `CARGO_MANIFEST_DIR` as a directory\",\n        ),\n    ];\n    let (current, msg) = CONFIG_VARS\n        .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 {","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/rust-lang/rust-clippy/blob/13aece11388703700981f29d9480ffd6409a3192/clippy_config/src/conf.rs#L865-L901","documentation":"Emitted when canonicalizing the directory Clippy searches for its config file fails. The {msg} placeholder carries a generic sentinel naming the input at fault: the directory given by CLIPPY_CONF_DIR, CARGO_MANIFEST_DIR, or the current directory '.' if neither env var is set. load_conf_file canonicalizes that path before scanning for .clippy.toml/clippy.toml; an I/O error here means the configured search directory does not exist, is not readable, or a path component is invalid, so config discovery aborts and returns None.","triggerScenarios":"Thrown at clippy_config/src/conf.rs:883 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the directory named in the error exists and is readable by the Clippy process","Fix or unset CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR so they point at a valid directory","Check for typos, removed mount points, or permission restrictions on path components","Fall back to running Clippy from the workspace root so the '.' default resolves"],"exampleFix":null,"handlingStrategy":"fallback","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"}