https://github.com/safer-rust/safety-tags
Tag the safety properties of the Rust standard library.
https://github.com/safer-rust/safety-tags
Last synced: 4 months ago
JSON representation
Tag the safety properties of the Rust standard library.
- Host: GitHub
- URL: https://github.com/safer-rust/safety-tags
- Owner: safer-rust
- Created: 2025-01-04T09:29:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-01T08:44:35.000Z (5 months ago)
- Last Synced: 2026-02-01T19:12:01.751Z (5 months ago)
- Language: Rust
- Homepage: https://artisan-lab.github.io/tag-std
- Size: 1.3 MB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Rust-Checker - safety-tags - 04-24 | (Static Checkers)
README
# safety-tags (formerly tag-std)
This project aims to provide an annotation-based approach to managing safety-related comments in unsafe Rust code. It has three main objectives:
- The annotation system should be user-friendly and compatible with existing developer workflows.
- The annotations should be syntactically checkable by the compiler, thereby enabling standardized usage.
- If sufficiently precise, the annotations could also support formal verification, for example by being extended into contracts. However, this is not required for general projects.
See this [RFC](https://github.com/rust-lang/rfcs/pull/3842), and [pre-RFC](https://internals.rust-lang.org/t/pre-rfc-safety-property-system/23252) for more details.
The project is named tag-std because it was originally intended to standardize safety property annotations for unsafe code within the Rust core and standard libraries through a simple yet precise tag-based approach. We have already defined a set of [primitive safety properties](primitive-sp.md) to describe the safety concerns associated with unsafe APIs in the standard library, and we have [labeled these unsafe APIs with tags](data/std.json) accordingly. In addition, we have developed a systematic method to detect annotation discrepancies through program analysis, demonstrating the effectiveness of safety tags. For more details, please refer to our paper:
- "[Annotating and Auditing the Safety Properties of Unsafe Rust](https://arxiv.org/abs/2504.21312)", Zihao Rao, Hongliang Tian, Xin Wang, **Hui Xu**, _arXiv:2504.21312_, 2025.
While we are formulating the [annotation method](usage.md) and developing the [corresponding tools](safety-tool), we are also exploring the application of this approach to Rust projects beyond the standard library, including [Rust-for-Linux](https://github.com/rust-for-linux) and [Asterinas](https://github.com/asterinas/asterinas)