match self {
InvalidationCause::Access(kind) => write!(f, "{kind}"),
InvalidationCause::Retag(perm, kind) =>
- if *kind == RetagCause::FnEntry {
- write!(f, "{perm:?} FnEntry retag")
- } else {
- write!(f, "{perm:?} retag")
- },
+ write!(f, "{perm:?} {retag}", retag = kind.summary()),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum RetagCause {
Normal,
- FnReturn,
+ FnReturnPlace,
FnEntry,
TwoPhase,
}
fn summary(&self) -> String {
match self {
RetagCause::Normal => "retag",
- RetagCause::FnEntry => "FnEntry retag",
- RetagCause::FnReturn => "FnReturn retag",
+ RetagCause::FnEntry => "function-entry retag",
+ RetagCause::FnReturnPlace => "return-place retag",
RetagCause::TwoPhase => "two-phase retag",
}
.to_string()
access: Some(AccessKind::Write),
protector: Some(ProtectorKind::StrongProtector),
};
- let val = this.sb_retag_reference(&val, new_perm, RetagCause::FnReturn)?;
+ let val = this.sb_retag_reference(&val, new_perm, RetagCause::FnReturnPlace)?;
// And use reborrowed pointer for return place.
let return_place = this.ref_to_mplace(&val)?;
this.frame_mut().return_place = return_place.into();
| ^^
| |
| trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
- | this error occurs as part of FnEntry retag at ALLOC[0x0..0x4]
+ | this error occurs as part of function-entry retag at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
|
LL | safe_raw(xraw, xshr);
| ^^^^
-help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique FnEntry retag inside this call
+help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique function-entry retag inside this call
--> $DIR/aliasing_mut3.rs:LL:CC
|
LL | safe_raw(xraw, xshr);
|
LL | let z = &mut x as *mut i32;
| ^^^^^^
-help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique FnEntry retag inside this call
+help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique function-entry retag inside this call
--> $DIR/fnentry_invalidation.rs:LL:CC
|
LL | x.do_bad();
|
LL | let ptr = t.sli.as_ptr();
| ^^^^^^^^^^^^^^
-help: <TAG> was later invalidated at offsets [0x0..0xc] by a Unique FnEntry retag inside this call
+help: <TAG> was later invalidated at offsets [0x0..0xc] by a Unique function-entry retag inside this call
--> $DIR/fnentry_invalidation2.rs:LL:CC
|
LL | let _ = t.sli.as_mut_ptr();