check_safe_class_copy_semantics

Function check_safe_class_copy_semantics 

Source
pub fn check_safe_class_copy_semantics(class: &Class) -> Vec<String>
Expand description

Check that @safe classes don’t have non-deleted copy operations

In Rust, types are moved by default - copying requires explicit Clone trait. Similarly, @safe classes in C++ should not have implicit copy operations. Classes should either:

  1. Delete copy constructor and copy assignment (like Rust’s default)
  2. Use @unsafe if copy semantics are intentionally needed

This enforces move-by-default semantics for @safe classes, matching Rust’s ownership model where types are moved unless explicitly cloned.