// Copyright Kani Contributors // SPDX-License-Identifier: Apache-2.0 OR MIT //! Test code generation for FnDef items #[kani::proof] fn test_reify_fn_pointer() { assert!(poly:: as fn() == poly:: as fn()); assert!(poly:: as fn() != poly:: as fn()); } fn poly() {} #[kani::proof] fn test_fn_pointer_call() { let x: bool = kani::any(); assert_eq!(id(x), x); assert_eq!((id:: as fn(bool) -> bool)(x), x); } fn id(x: T) -> T { x } struct Wrapper { inner: T, } #[kani::proof] fn test_fn_wrapper() { let w = Wrapper { inner: id:: }; assert!(w.inner as fn(bool) -> bool == id:: as fn(bool) -> bool); let x: bool = kani::any(); assert_eq!((w.inner)(x), x); }