Skip to main content

validate_language

Function validate_language 

Source
pub fn validate_language(raw: WitLanguageSpec) -> Result<LanguageSpec, String>
Expand description

Validate a guest’s language declaration, or reject it.

Guest output is untrusted, and the rejections here are the ones a buggy guest actually produces. Each is an Err back to the guest rather than a trap, so one bad language costs itself and the plugin’s others still register.

Note what is NOT validated here: whether the grammar bytes are a loadable wasm module, and whether the queries compile. Both need lattice-syntax and both happen in the loader’s drain — checking them here would mean either duplicating that logic or holding the guest’s store alive across a ~100 ms Cranelift compile.