Skip to content

Commit

Permalink
Merge branch 'issue-3022-test' into tests-for-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzech committed Sep 3, 2024
2 parents 2db3d3b + 8f4c07d commit 29a009c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/expected/issue-3022/issue_3022.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
main.assertion\
- Status: SUCCESS\
- Description: "assertion failed: inner == func2.inner"

VERIFICATION:- SUCCESSFUL
24 changes: 24 additions & 0 deletions tests/expected/issue-3022/issue_3022.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

type BuiltIn = for<'a> fn(&str);

struct Function {
inner: BuiltIn,
}

impl Function {
fn new(subr: BuiltIn) -> Self {
Self { inner: subr }
}
}

fn dummy(_: &str) {}

#[kani::proof]
fn main() {
let func1 = Function::new(dummy);
let func2 = Function::new(dummy);
let inner: fn(&'static _) -> _ = func1.inner;
assert!(inner == func2.inner);
}

0 comments on commit 29a009c

Please sign in to comment.