Skip to content

Commit 9b57573

Browse files
authored
Challenge 7: make panicking part optional; remove mention of verifying intrinsics (#357)
Update the atomic intrinsics challenge to make verifying the intrinsics out of scope, since that would require verifying compiler implementations that are out of scope for this effort. Also make the part about verifying the absence of panics optional to restrict the requirements to safety only. I also added a `mdbook-linkcheck` dependency because I discovered I needed that to build the book locally. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent 07b7465 commit 9b57573

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

doc/mdbook-metrics/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ edition = "2021"
55

66
[dependencies]
77
mdbook = { version = "^0.4" }
8+
mdbook-linkcheck = "0.7.7"
89
serde_json = "1.0.132"

doc/src/challenges/0007-atomic-types.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,18 @@ Write and verify safety contracts for the unsafe functions:
8787
- `atomic_umax`
8888
- `atomic_umin`
8989

90+
##### Panicking (Optional)
9091
Then, for each of the safe abstractions that invoke the unsafe functions listed above, write contracts that ensure that they are not invoked with `order`s that would cause panics.
9192

9293
For example, `atomic_store` panics if invoked with `Acquire` or `AcqRel` ordering.
9394
In this case, you would write contracts on the safe `store` methods that enforce that they are not called with either of those `order`s.
9495

96+
This section is not required to complete the challenge, since panicking is not undefined behavior.
97+
However, it would be incorrect for someone to call these functions with the wrong arguments, so we encourage providing these specifications.
98+
9599
#### Part 3: Atomic Intrinsics
96100

97-
Write and verify safety contracts for the intrinsics invoked by the unsafe functions from Part 2 (in `core::intrinsics`):
101+
Write safety contracts for the intrinsics invoked by the unsafe functions from Part 2 (in `core::intrinsics`):
98102

99103
| Operations | Functions |
100104
|-----------------------|-------------|

0 commit comments

Comments
 (0)