{"record":{"id":"e1583a7f7f4901aa","repo":"rust-lang/rust","slug":"unknown-query-modifier","errorCode":null,"errorMessage":"unknown query modifier","messagePattern":"unknown query modifier","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"compiler/rustc_macros/src/query.rs","lineNumber":204,"sourceCode":"            // `desc { \"foo {}\", tcx.item_path(key) }`\n            let attr_content;\n            braced!(attr_content in input);\n            let expr_list = attr_content.parse_terminated(Expr::parse, Token![,])?;\n            try_insert!(desc = Desc { modifier, expr_list });\n        } else if modifier == \"eval_always\" {\n            try_insert!(eval_always = modifier);\n        } else if modifier == \"feedable\" {\n            try_insert!(feedable = modifier);\n        } else if modifier == \"handle_cycle_error\" {\n            try_insert!(handle_cycle_error = modifier);\n        } else if modifier == \"no_force\" {\n            try_insert!(no_force = modifier);\n        } else if modifier == \"no_hash\" {\n            try_insert!(no_hash = modifier);\n        } else if modifier == \"separate_provide_extern\" {\n            try_insert!(separate_provide_extern = modifier);\n        } else {\n            return Err(Error::new(modifier.span(), \"unknown query modifier\"));\n        }\n    }\n    let Some(desc) = desc else {\n        return Err(input.error(\"no description provided\"));\n    };\n    Ok(QueryModifiers {\n        // tidy-alphabetical-start\n        arena_cache,\n        cache_on_disk,\n        depth_limit,\n        desc,\n        eval_always,\n        feedable,\n        handle_cycle_error,\n        no_force,\n        no_hash,\n        separate_provide_extern,\n        // tidy-alphabetical-end","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_macros/src/query.rs#L186-L222","documentation":"Emitted by parse_query_modifiers in the rustc_queries! macro when an identifier in the modifier block doesn't match any of the ten known modifier keys: arena_cache, cache_on_disk, depth_limit, desc, eval_always, feedable, handle_cycle_error, no_force, no_hash, separate_provide_extern. The else branch of the if-else chain (query.rs:204) produces this error at the unknown identifier's span.","triggerScenarios":"Typing a modifier name incorrectly (e.g., \"eval_alwyas\", \"cach_on_disk\") or using a modifier that doesn't exist in this version of the compiler. The modifier block is the { } body of a query declaration.","commonSituations":"Typo in modifier name; using a modifier from a newer/older rustc version; guessing a modifier name instead of checking the documented list; copy-paste from documentation that uses a different name.","solutions":["Check the canonical list in query.rs:178-202 or rustc_middle::query::modifiers for the exact spelling of each modifier.","Correct the typo — note that all modifiers use snake_case.","If the modifier exists in a different rustc version, update your source tree to match the version you're compiling."],"exampleFix":"// before\nquery foo(key: DefId) -> Ty<'tcx> {\n    desc { \"foo for `{}`\", key }\n    eval_alwyas\n}\n// after: fix the typo\nquery foo(key: DefId) -> Ty<'tcx> {\n    desc { \"foo for `{}`\", key }\n    eval_always\n}","handlingStrategy":"validation","validationCode":"// Validate modifier names against the known set before committing.\nconst VALID_MODIFIERS: &[&str] = &[\n    \"arena_cache\", \"cache_on_disk\", \"depth_limit\", \"desc\",\n    \"eval_always\", \"feedable\", \"handle_cycle_error\",\n    \"no_force\", \"no_hash\", \"separate_provide_extern\",\n];\n\nfn is_valid_modifier(name: &str) -> bool {\n    VALID_MODIFIERS.contains(&name)\n}","typeGuard":null,"tryCatchPattern":"// Compile-time error — cannot be caught at runtime.\n// Fix the typo or remove the unknown modifier.","preventionTips":["Reference the modifier list in query.rs (lines 178-202) for exact spelling.","All modifier names are snake_case identifiers.","Run cargo check after editing query declarations to catch typos early."],"tags":["rustc","proc-macro","query","compiler-internals"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}