{"record":{"id":"45ee40860e16f1ee","repo":"rust-lang/cargo","slug":"lints-tool-name-is-not-a-valid-lint-name","errorCode":null,"errorMessage":"`lints.{tool}.{name}` is not a valid lint name","messagePattern":"`lints\\.(.+?)\\.(.+?)` is not a valid lint name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/workspace/parser/mod.rs","lineNumber":2745,"sourceCode":"            }\n            if let Some(existing) = seen_normalized.get(&normalized) {\n                warnings.push(format!(\n                    \"duplicate lint `{existing}` in `[lints.{tool}]`, \\\n                     conflicts with `{name}` and will not work in a future edition\"\n                ));\n            }\n            seen_normalized.insert(normalized.clone(), name.to_string());\n            if let Some((prefix, suffix)) = name.split_once(\"::\") {\n                if tool == prefix {\n                    anyhow::bail!(\n                        \"`lints.{tool}.{name}` is not valid lint name; try `lints.{prefix}.{suffix}`\"\n                    )\n                } else if tool == \"rust\" && supported.contains(&prefix) {\n                    anyhow::bail!(\n                        \"`lints.{tool}.{name}` is not valid lint name; try `lints.{prefix}.{suffix}`\"\n                    )\n                } else {\n                    anyhow::bail!(\"`lints.{tool}.{name}` is not a valid lint name\")\n                }\n            } else if let Some(config) = config.config() {\n                for config_name in config.keys() {\n                    // manually report unused manifest key warning since we collect all the \"extra\"\n                    // keys and values inside the config table\n                    let expected = EXPECTED_LINT_CONFIG.contains(&(tool, name, config_name));\n                    if !expected {\n                        let message =\n                            format!(\"unused manifest key: `lints.{tool}.{name}.{config_name}`\");\n                        warnings.push(message);\n                    }\n                }\n            }\n        }\n    }\n\n    Ok(())\n}","sourceCodeStart":2727,"sourceCodeEnd":2763,"githubUrl":"https://github.com/rust-lang/cargo/blob/98a09e7e7d62850f14e5b6132101fc1edd19a16f/src/workspace/parser/mod.rs#L2727-L2763","documentation":"Thrown during [lints] validation when a lint name contains '::' but the prefix does not match the tool name and is not a supported tool under 'rust'. This is the catch-all for unrecognized namespaced lint keys — e.g. [lints.rust] 'foo::bar' where 'foo' is unknown. Unlike the other two branches, no fix suggestion is offered because the intended location is unknown.","triggerScenarios":"Writing a [lints] entry with a '::' in the name where the prefix is neither the current tool nor a recognized tool. For example [lints.rust] \"unknown::lint\" = \"warn\".","commonSituations":"A developer guesses a lint name that does not exist or misremembers the namespace. A typo in the prefix. Using a clippy lint under [lints.rust] without realizing clippy lints are bare names under [lints.rust] (clippy lints don't use '::').","solutions":["Remove the '::' and use the lint's bare name under the correct tool table (most rustc/clippy lints are bare names under [lints.rust]).","Verify the lint exists in the target tool's lint list.","If the lint is from a plugin, check whether [lints] supports it at all."],"exampleFix":"# before\n[lints.rust]\n\"clippy::needless_return\" = \"warn\"  # '::' form is invalid here\n\n# after\n[lints.rust]\nclippy_needless_return = \"warn\"  # or configure clippy via [lints] with the correct bare name per docs","handlingStrategy":"validation","validationCode":"fn lint_name_recognized(tool: &str, name: &str, supported: &[&str]) -> Result<(), String> {\n    if name.contains(\"::\") {\n        let prefix = name.split_once(\"::\").unwrap().0;\n        let known = prefix == tool || (tool == \"rust\" && supported.contains(&prefix));\n        if !known {\n            return Err(format!(\"unrecognized lint name `{name}` under [lints.{tool}]; remove `::` or verify the lint exists\"));\n        }\n    }\n    Ok(())\n}","typeGuard":"fn is_valid_lint_key(tool: &str, name: &str, supported: &[&str]) -> bool {\n    if let Some((prefix, _)) = name.split_once(\"::\") {\n        return prefix == tool || (tool == \"rust\" && supported.contains(&prefix));\n    }\n    true\n}","tryCatchPattern":null,"preventionTips":["Avoid '::' in lint keys under [lints]; use the bare lint name.","Verify each lint exists in the target tool before adding it.","Remove unknown lint entries surfaced by CI manifest validation."],"tags":["cargo","lints","manifest","naming","unknown","parser"],"backgroundTag":null,"analyzedSha":"98a09e7e7d62850f14e5b6132101fc1edd19a16f","analyzedAt":"2026-08-11T17:42:36.556Z","contentChangedAt":"2026-08-11T17:42:36.556Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}