-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
featNew feature or requestNew feature or request
Description
Safety properties may vary in projects: libcore, Rust for Linux, and Asterinas all have their own properties.
And if we want non-customed attributes (i.e. non-Memo), the only choice for now is to define builtin ones in safety-macro crates.
But it is awkward:
- safety-macro versioning will be a mess: when to bump a major version?
- once a property is newly added or modified, safety-macro and safety-lib need to update as well
So a solution to this is support a safety configuration system:
- a project-aware configuration file, in toml or json format, mapping property name, arguments, and description (including string interpolation)
- when compiling safety-macro, its build.rs will read the project mapping, and auto generate macros
- future proofing: a LSP tool to analyze safety properties and offer safety attributes autocompletion
- RA may fail to expand macro-generated safety comments (rustdoc won't fail!)
- it's lovely to see safety properties, including descriptions and transitive safety relation, in a separate view and have context-aware diagnostics and completion
We're trying to experiment on this soon.
- also cc Reflection and comptime goal rust-lang/rust-project-goals#311 , while we don't expect this to happen today
Metadata
Metadata
Assignees
Labels
featNew feature or requestNew feature or request