clippy · rust-lang/rust@abbe244

3 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -17,6 +17,7 @@ enum PermissionPriv {

1717

/// is relevant

1818

/// - `conflicted` is set on foreign reads,

1919

/// - `conflicted` must not be set on child writes (there is UB otherwise).

20+

///

2021

/// This is so that the behavior of `Reserved` adheres to the rules of `noalias`:

2122

/// - foreign-read then child-write is UB due to `conflicted`,

2223

/// - child-write then foreign-read is UB since child-write will activate and then

@@ -339,15 +340,15 @@ pub mod diagnostics {

339340

/// This function assumes that its arguments apply to the same location

340341

/// and that they were obtained during a normal execution. It will panic otherwise.

341342

/// - all transitions involved in `self` and `err` should be increasing

342-

/// (Reserved < Active < Frozen < Disabled);

343+

/// (Reserved < Active < Frozen < Disabled);

343344

/// - 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`;

345346

/// - `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;

348349

/// - `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)

351352

pub(in super::super) fn is_relevant(&self, err: TransitionError) -> bool {

352353

// NOTE: `super::super` is the visibility of `TransitionError`

353354

assert!(self.is_possible());

Original file line numberDiff line numberDiff line change

@@ -230,6 +230,7 @@ mod spurious_read {

230230

/// - any access to the same location

231231

/// - end of one of them being protected

232232

/// - a retag that would change their relative position

233+

///

233234

/// The type `TestEvent` models these kinds of events.

234235

///

235236

/// In order to prevent `x` or `y` from losing their protector,

Original file line numberDiff line numberDiff line change

@@ -1106,9 +1106,9 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {

11061106

/// Temporarily allow data-races to occur. This should only be used in

11071107

/// one of these cases:

11081108

/// - 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.

11101110

/// - 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.

11121112

/// - Execution of the interpreted program execution has halted.

11131113

#[inline]

11141114

fn allow_data_races_ref<R>(&self, op: impl FnOnce(&MiriInterpCx<'mir, 'tcx>) -> R) -> R {