Wax_utils.WarningSourceNamed, groupable warnings whose reporting level is configurable.
Each diagnostic warning has a stable name (e.g. unused-local) and may belong to one or more groups (e.g. unused). A policy maps each warning to a level — hidden, displayed, or promoted to an error — so the same warning can be silenced, shown, or made fatal depending on the invocation (see the -W command-line option).
type t = | Unused_localA local that is declared but never read.
*)| Unused_fieldA module field (a function or global) that is defined but never referenced, exported, or used as the start function.
*)| Unused_importAn imported function or global that is never referenced, exported, or used as the start function.
*)| Unused_labelA block label that is declared but never branched to.
*)| Shift_overflowA shift by a constant count at least as large as the operand's bit width; Wasm masks the count modulo the width, so the shift is almost certainly not what was meant.
*)| Constant_trapAn operation that always traps on a constant operand: an integer division or remainder by zero, or a trapping float-to-integer conversion of an out-of-range constant.
*)| Tautological_comparisonA comparison whose result is constant regardless of its variable operand: an unsigned comparison against zero, or a comparison of two identical operands.
*)| Constant_conditionA branch, loop, or select condition that is a constant, so it always (or never) takes the same path.
| Unused_resultThe result of a side-effect-free expression is computed and then discarded (e.g. _ = x + 1).
| Dead_codeA statement that can never be reached because it follows an unconditional branch, return, or unreachable.
| Cast_always_failsA reference cast or test whose operand can never have the target type (the two are unrelated in the type hierarchy), so the cast always traps and the test is always false.
*)| Eager_selectA trapping or effectful operation (an integer division, a field or element access, a !, a descriptor cast, a call, an assignment, …) appears in a branch of a ?:. Since ?: compiles to a select, which evaluates both branches, that operation runs even when the condition selects the other branch.
| PrecedenceTwo operators whose relative precedence is easy to misremember are mixed without parentheses: a shift (<</>>) with an arithmetic operator (+, -, *, …), or a comparison with a bitwise operator (&, |, ^). The code is correct, but a reader (especially one used to C's different table) may misread the grouping.
| Redundant_operationAn operation with no effect on its result: an arithmetic identity (x + 0, x * 1, x << 0, …), an absorbing operand (x * 0, x & 0), an operation on two identical operands (x - x, x ^ x, x & x), a self-assignment (x = x), or a cast to a type the operand already has.
| Truncated_coveragePath-sensitive validation gave up after too many conditional configurations.
*)| Naming_conflictConverting from Wasm, a source name collided with another and was renamed to a fresh one.
*)| Reserved_word_renameConverting from Wasm, a source name is a Wax reserved word and was renamed to a fresh one.
*)| Generated_nameConverting from Wasm, an unnamed but referenced parameter was given a generated name (it cannot be rendered anonymously).
*)Whether the warning flags code that can be removed with no change in behaviour (an unused binding, import, or label, or unreachable code), so an editor can render it faded — LSP's DiagnosticTag.Unnecessary, VS Code's greyed-out dead code.
set policy name level returns policy updated so that the warning named name (or every warning in the group named name, including the special group "all") has level level. Returns Error msg if name matches no known warning or group. Later calls override earlier ones.
parse_spec s parses a -W argument of the form NAME=LEVEL into its warning/group name and level. LEVEL is one of hidden, warning, or error. Returns Error msg on a malformed spec or unknown level.
The names of the warning groups (excluding the special "all"), for help text.