Rust is a memory-safe programming language that disallows undefined behavior. Its safety guarantees have been extensively examined by the community through empirical studies, which has led to its remarkable success. However, unsafe code remains a critical concern in Rust. By reviewing the safety design of Rust and analyzing real-world Rust projects, this paper establishes a systematic framework for understanding unsafe code and undefined behavior, and summarizes the soundness criteria for Rust code. It further derives actionable guidance for achieving sound encapsulation.
Rust는 메모리 안전성을 보장하는 프로그래밍 언어로, 정의되지 않은 동작을 금지합니다. 그 안전성 보장은 커뮤니티의 광범위한 실증 연구를 통해 검증되었으며, 이것이 Rust의 현저한 성공의 원인입니다. 그러나 unsafe 코드는 여전히 Rust의 핵심 문제입니다. 본 논문은 Rust의 안전 설계를 검토하고 실제 Rust 프로젝트를 분석함으로써 unsafe 코드와 정의되지 않은 동작을 이해하기 위한 체계적 프레임워크를 구축하고, Rust 코드의 건전성 기준을 정리하며, 나아가 건전한 캡슐화 구현을 위한 실행 가능한 지침을 제시합니다.
Rust Team. Soundness (of code / a library). Rust Unsafe Code Guidelines.
Zihao Rao, et al. Annotating and Auditing the Safety Properties of Unsafe Rust. arXiv preprint arXiv:2504.21312, 2025.
종합 평가: 본 논문은 Rust unsafe 코드 안전성 분석 분야에서 중요한 이론적 기여를 하였으며, 체계적인 분석 프레임워크를 구축했습니다. 실험 검증 및 도구 구현 측면에서 개선의 여지가 있지만, 그 이론적 가치와 실용적 잠재력은 충분히 인정할 만합니다. 본 연구는 Rust 안전성 연구 및 실무에 견고한 이론적 기초를 제공합니다.