-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2239 and #3022 are resolved in Kani v0.5.4. Add tests for them. Resolves #2239 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
- Loading branch information
1 parent
eb4d5a6
commit 6cf4ea4
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test_trivial_bounds.unreachable.1\ | ||
- Status: FAILURE\ | ||
- Description: "unreachable code" | ||
|
||
VERIFICATION:- FAILED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
#![feature(trivial_bounds)] | ||
#![allow(unused, trivial_bounds)] | ||
|
||
#[kani::proof] | ||
fn test_trivial_bounds() | ||
where | ||
i32: Iterator, | ||
{ | ||
for _ in 2i32 {} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |