@@ -21,7 +21,6 @@ and provide first-class IDE support.
21
21
#![feature(custom_inner_attributes)]
22
22
#![clippy:: safety(invariant:: ValidPtr )] // 💡
23
23
24
-
25
24
pub mod invariant {
26
25
#[clippy:: safety:: tag]
27
26
pub fn ValidPtr () {}
@@ -239,14 +238,16 @@ Safety-tag analysis requirements:
239
238
240
239
* Harvest every item marked ` #[clippy::safety::tag] ` , including those pulled in from dependencies.
241
240
* Offer path completion for ` #![clippy::safety { ... }] ` .
242
- * Offer tag-name completion for ` #[clippy::safety] ` on unsafe functions, let-statements, or expressions.
243
- * Validate all tags inside ` #[clippy::safety] ` , and support “go-to-definition” plus inline documentation hover.
241
+ * Offer tag-name completion for ` #[clippy::safety] ` on unsafe functions, let-statements, or
242
+ expressions.
243
+ * Validate all tags inside ` #[clippy::safety] ` , and support “go-to-definition” plus inline
244
+ documentation hover.
244
245
245
246
# Drawbacks
246
247
[ drawbacks ] : #drawbacks
247
248
248
249
Even though safety tags are machine-readable, their correctness still hinges on human review:
249
- developers can silence Clippy by discharging tags without verifying the underlying obligations .
250
+ developers can silence Clippy by discharging tags without verifying underlying safety requirements .
250
251
251
252
# Rationale and alternatives
252
253
[ rationale-and-alternatives ] : #rationale-and-alternatives
@@ -318,7 +319,7 @@ Currently, there are efforts on introducing contracts and formal verification in
318
319
* [ verify-rust-std] pursues applying formal verification tools to libstd. Also see Rust Foundation
319
320
[ announcement] [ vrs#ann ] , project goals during [ 2024h2] and [ 2025h1] .
320
321
321
- While safety tags are less formally verified, intended to be a check list on safety requirements.
322
+ While safety tags are less formally verified and intended to be a check list on safety requirements.
322
323
323
324
[ verify-rust-std ] : https://github.com/model-checking/verify-rust-std
324
325
[ vrs#ann ] : https://foundation.rust-lang.org/news/rust-foundation-collaborates-with-aws-initiative-to-verify-rust-standard-libraries/
@@ -336,7 +337,7 @@ Crates with heavy unsafe-trait usage will likely need. We’d welcome more minds
336
337
337
338
## Tagging on Datastructures
338
339
339
- We believe safety obligations are almost always imposed by unsafe functions, so tagging a struct,
340
+ We believe safety requirements are almost always imposed by unsafe functions, so tagging a struct,
340
341
enum, or union is neither needed nor permitted.
341
342
342
343
## Tagging on Unsafe Fields
0 commit comments