Skip to content

Commit

Permalink
Cherry-pick #3375 into verify-rust-std (Import apply_closure into kan…
Browse files Browse the repository at this point in the history
…i_core) (#3376)

This adds the commit from #3375 to features/verify-rust-std.
  • Loading branch information
tautschnig authored Jul 24, 2024
1 parent 8d9d1e5 commit 412771a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/kani_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,13 @@ macro_rules! kani_intrinsics {
#[doc(hidden)]
#[rustc_diagnostic_item = "KaniInitContracts"]
pub fn init_contracts() {}

/// This should only be used within contracts. The intent is to
/// perform type inference on a closure's argument
#[doc(hidden)]
pub fn apply_closure<T, U: Fn(&T) -> bool>(f: U, x: &T) -> bool {
f(x)
}
}
};
}

0 comments on commit 412771a

Please sign in to comment.