Module safety_annotations

Module safety_annotations 

Source

Structs§

FunctionSignature
Function signature for disambiguating overloaded functions
SafetyContext

Enums§

ClassAnnotation
Class annotation types for inheritance safety
SafetyMode

Functions§

check_class_interface_annotation
Check if a class is marked as @interface by reading source file comments This is needed when libclang’s get_comment() doesn’t capture the annotation
check_method_safety_annotation
Check method safety annotation by reading source file comments This is needed when libclang’s get_comment() doesn’t capture the annotation for methods inside a class definition
parse_class_annotation
Parse class annotation from entity comment (for clang AST) Returns @interface, @safe, or @unsafe annotation for a class
parse_entity_safety
Parse safety annotation from entity comment (for clang AST) Bug fix: Only match @safe/@unsafe at the START of comment lines (or after prefix like //, /*, *) This prevents false matches like “No @safe annotation” being treated as @safe
parse_safety_annotations
Parse safety annotations from a C++ file using the unified rule: @safe/@unsafe attaches to the next statement/block/function/namespace