Skip to content

Commit 4aaba41

Browse files
committed
chore: typos
1 parent 66eda21 commit 4aaba41

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

text/0000-safety-tags.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,19 +239,19 @@ unsafe fn delegation<T>(ptr: *const T) -> T {
239239

240240
#[safety::checked(
241241
aligned = "alignment of ptr has be adjusted",
242-
validPtr, initialized = "delegated to the caller"
242+
valid_ptr, initialized = "delegated to the caller"
243243
)]
244244
unsafe { read(ptr) }
245245
}
246246
```
247247

248248
`valid_ptr` and `initialized` are grouped together to share "delegated to the caller". We do not
249249
introduce new syntax for grouping tags but instead suggest visually grouping them for clarity. When
250-
`rustfmt` automatically formats `ValidPtr` to its own line, the only workaround is to set
250+
`rustfmt` automatically formats `valid_ptr` to its own line, the only workaround is to set
251251
`attr_fn_like_width = 0` in the `rustfmt.toml` configuration file. For further discussion on this
252252
tag styling, see this [link](https://github.com/rust-lang/rfcs/pull/3842#discussion_r2296076785).
253253

254-
In this delegation case, you're able to declare a new meaningful tag for ValidPtr and Initialized
254+
In this delegation case, you're able to declare a new meaningful tag for valid_ptr and initialized
255255
invariants, and define the new tag on `delegation` function. This practice extends to partial unsafe
256256
delegation of multiple tag discharges:
257257

@@ -402,15 +402,15 @@ Treat `#[safety::requires]` tool attributes on unsafe functions as `#[doc]` attr
402402
tag names and definitions to render as item list:
403403

404404
```rust
405-
#[safety::requires(tag1 = "definition1")]
406-
#[safety::requires(tag2 = "definition2")]
405+
#[safety::requires(first_tag = "definition1")]
406+
#[safety::requires(second_tag = "definition2")]
407407
```
408408

409409
will be rendered if in markdown syntax
410410

411411
```md
412-
* `Tag1`: definition1
413-
* `Tag2`: definition2
412+
* First tag: definition1
413+
* Second tag: definition2
414414
```
415415

416416
It'd be good if tag names have a special css class like background color to be attractive. Tag

0 commit comments

Comments
 (0)