Comments (3)
It seems as though deleting
fn visit_receiver(&mut self, _: &'ast syn::Receiver) {
self.0.insert(Ident::new("self", proc_macro2::Span::call_site()));
}
From the initialize.rs file has no impact on the current tests. This means we are not properly testing consuming the self
parameter in a function properly.
This is related to this change as self
falls into the same category of arguments that need to be unsafely copied, but adds a layer of complication as self
is a reserved keyword and cannot be reassigned.
from kani.
The following two test cases seem to fail kani's checks. Copy is derived in both situations, so it would make sense for the struct to be available in the ensures statement. However, since we are doing an untracked dereference, I suspect that rust memory checker thinks that the memory is no longer needed after the function and frees it, so self_renamed and x_renamed no longer point at valid pieces of data after the function.
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: -Zfunction-contracts
#[derive(Clone,Copy)]
struct DestructSelf;
impl DestructSelf {
#[kani::requires(self.five()==5)]
#[kani::ensures(|_| self.five()==5)]
fn eat(self : DestructSelf){
}
fn five(self : &DestructSelf) -> u32{
5
}
}
#[kani::proof_for_contract(DestructSelf::eat)]
fn eat_harness() {
let x = DestructSelf;
x.eat()
}
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
// kani-flags: -Zfunction-contracts
#[derive(Clone,Copy)]
struct Five;
impl Five {
fn five(self : &Five) -> u32{
5
}
}
#[kani::ensures(|result : &Five| x.five() == result.five())]
fn id(x : Five) -> Five {
x
}
#[kani::proof_for_contract(id)]
fn eat_harness() {
let x = Five;
id(x);
}
from kani.
Changed the variable that the old
implementation was using so that it uses the variable tracked by rust and not the one that is untracked. This means this is still an issue for the ensures statement as seen in the past two test cases, but no longer for old
statements.
from kani.
Related Issues (20)
- Tracking Issue: Automatically Verify Memory Initialization HOT 5
- Toolchain upgrade to nightly-2024-06-28 failed
- UX Improvement: Ensures clause requires type annotation HOT 1
- Add core intrisincs tests for f16 and f128
- Overwriting a composite object in an array causes a blowup in variables HOT 3
- Kani internal panic when calling somehwat complex library path with no symbolic inputs HOT 4
- Function Contracts: Mutual recursion function contract wrapper for replace code stub
- Kani panicked in codegen/rvalue HOT 4
- Toolchain upgrade to nightly-2024-07-02 failed
- `BuildBundle-Linux` CI jobs are failing with `version GLIBC_2.28 not found` HOT 1
- Uninitialized memory detection mitigates delayed UB, but does not support it fully HOT 1
- Allow users to annotate functions without body with contracts HOT 2
- Add an option to turn `requires` clauses into assertions
- Disable Divide by 0 Checks for Floats
- Performance drastically differs across two string indexing operations HOT 1
- Build bundle jobs could test bundles before upload HOT 1
- Kani Setup Fail MacOS HOT 3
- Modifies property points to a temporary variable
- Add contract support to intrinsics
- Checking memory initialization in presence of `copy` and `copy_nonoverlapping` produces false positives
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kani.