We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1258959 commit 89d5d37Copy full SHA for 89d5d37
vhdl_lang/src/analysis/named_entity.rs
@@ -410,7 +410,8 @@ impl<'a> AnyEnt<'a> {
410
411
#[allow(clippy::mut_from_ref)]
412
unsafe fn unsafe_ref_mut(&self) -> &mut Self {
413
- let mut_self: *mut AnyEnt = self as *const AnyEnt as *mut AnyEnt;
+ // NOTE: Use read_volatile to prevent compiler to optimization away assignment to the returned reference
414
+ let mut_self: *mut AnyEnt = std::ptr::read_volatile(&self) as *const AnyEnt as *mut AnyEnt;
415
&mut *mut_self
416
}
417
0 commit comments