From 0f736c877df8bce5d0d956214a76503f6757c9e1 Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Wed, 8 Nov 2023 19:14:41 -0500 Subject: [PATCH] const-ify `cover` (#2867) This allows `kani::cover` to be used in the body of const fns under verification. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --- library/kani/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/kani/src/lib.rs b/library/kani/src/lib.rs index 1da6a46550187..d2959e548417c 100644 --- a/library/kani/src/lib.rs +++ b/library/kani/src/lib.rs @@ -146,7 +146,7 @@ pub const fn assert(cond: bool, msg: &'static str) { /// #[inline(never)] #[rustc_diagnostic_item = "KaniCover"] -pub fn cover(_cond: bool, _msg: &'static str) {} +pub const fn cover(_cond: bool, _msg: &'static str) {} /// This creates an symbolic *valid* value of type `T`. You can assign the return value of this /// function to a variable that you want to make symbolic.