clippy · rust-lang/rust@abbe244 (original) (raw)

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ enum PermissionPriv {
17 17 /// is relevant
18 18 /// - `conflicted` is set on foreign reads,
19 19 /// - `conflicted` must not be set on child writes (there is UB otherwise).
20 + ///
20 21 /// This is so that the behavior of `Reserved` adheres to the rules of `noalias`:
21 22 /// - foreign-read then child-write is UB due to `conflicted`,
22 23 /// - child-write then foreign-read is UB since child-write will activate and then
@@ -339,15 +340,15 @@ pub mod diagnostics {
339 340 /// This function assumes that its arguments apply to the same location
340 341 /// and that they were obtained during a normal execution. It will panic otherwise.
341 342 /// - all transitions involved in `self` and `err` should be increasing
342 - /// (Reserved < Active < Frozen < Disabled);
343 + /// (Reserved < Active < Frozen < Disabled);
343 344 /// - between `self` and `err` the permission should also be increasing,
344 - /// so all permissions inside `err` should be greater than `self.1`;
345 + /// so all permissions inside `err` should be greater than `self.1`;
345 346 /// - `Active` and `Reserved(conflicted=false)` cannot cause an error
346 - /// due to insufficient permissions, so `err` cannot be a `ChildAccessForbidden(_)`
347 - /// of either of them;
347 + /// due to insufficient permissions, so `err` cannot be a `ChildAccessForbidden(_)`
348 + /// of either of them;
348 349 /// - `err` should not be `ProtectedDisabled(Disabled)`, because the protected
349 - /// tag should not have been `Disabled` in the first place (if this occurs it means
350 - /// we have unprotected tags that become protected)
350 + /// tag should not have been `Disabled` in the first place (if this occurs it means
351 + /// we have unprotected tags that become protected)
351 352 pub(in super::super) fn is_relevant(&self, err: TransitionError) -> bool {
352 353 // NOTE: `super::super` is the visibility of `TransitionError`
353 354 assert!(self.is_possible());
Original file line number Diff line number Diff line change
@@ -230,6 +230,7 @@ mod spurious_read {
230 230 /// - any access to the same location
231 231 /// - end of one of them being protected
232 232 /// - a retag that would change their relative position
233 + ///
233 234 /// The type `TestEvent` models these kinds of events.
234 235 ///
235 236 /// In order to prevent `x` or `y` from losing their protector,
Original file line number Diff line number Diff line change
@@ -1106,9 +1106,9 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
1106 1106 /// Temporarily allow data-races to occur. This should only be used in
1107 1107 /// one of these cases:
1108 1108 /// - One of the appropriate `validate_atomic` functions will be called to
1109 - /// to treat a memory access as atomic.
1109 + /// treat a memory access as atomic.
1110 1110 /// - The memory being accessed should be treated as internal state, that
1111 - /// cannot be accessed by the interpreted program.
1111 + /// cannot be accessed by the interpreted program.
1112 1112 /// - Execution of the interpreted program execution has halted.
1113 1113 #[inline]
1114 1114 fn allow_data_races_ref<R>(&self, op: impl FnOnce(&MiriInterpCx<'mir, 'tcx>) -> R) -> R {