From 25a2025e3112298a96e568a9a064d547a53fa50c Mon Sep 17 00:00:00 2001 From: Zyad Hassan Date: Mon, 2 Dec 2024 15:41:45 -0800 Subject: [PATCH] Use cfg_attr for kani::modifies --- library/core/src/ptr/non_null.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs index 680b3b177ddd6..715e70b98ea1d 100644 --- a/library/core/src/ptr/non_null.rs +++ b/library/core/src/ptr/non_null.rs @@ -1132,7 +1132,7 @@ impl NonNull { #[inline(always)] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[stable(feature = "non_null_convenience", since = "1.80.0")] - #[kani::modifies(self.as_ptr())] + #[cfg_attr(kani, kani::modifies(self.as_ptr()))] #[requires(ub_checks::can_write(self.as_ptr()))] pub unsafe fn write_volatile(self, val: T) where