unsafe-operation
Default severity: error · Identifier: weavec::unsafe-operation
What it means
Section titled “What it means”A raw operation outside a WEAVEC_UNSAFE region (RFC 0004): dereference of raw pointer '<p>' outside an unsafe region, '<f>' dereferences raw pointer '<p>' ... (also releases, takes ownership of), raw pointer '<p>' is assigned to '<q>', which is declared WEAVEC_OWNED, outside an unsafe region (any safe annotation), raw pointer is returned from a function whose return type is annotated WEAVEC_OWNED outside an unsafe region, and with --strict-externs, unchecked call to '<f>' outside an unsafe region / unchecked call through '<fp>' .... Notes: why the pointer is raw ('<p>' is raw: cast from an integer here, declared WEAVEC_RAW here, loaded through raw pointer '<q>' here, handed out by '<f>' here, returned by a call into unchecked code ('<f>') here, each optionally (through '<alias>')) and move this operation into a WEAVEC_UNSAFE block or function, or assert the pointer's ownership first.
How to resolve it
Section titled “How to resolve it”Inspect why the pointer or call is raw. Prefer a modeled or verified interface with an accurate contract. If the operation necessarily crosses the supported model, put the smallest reviewed operation inside a WEAVEC_UNSAFE boundary and document the assumptions. Unsafe code still affects ownership outside the boundary.