Do not create a ProjectedPlace for unsupported fields#1071
Merged
zhassan-aws merged 2 commits intomodel-checking:mainfrom Apr 20, 2022
Merged
Do not create a ProjectedPlace for unsupported fields#1071zhassan-aws merged 2 commits intomodel-checking:mainfrom
zhassan-aws merged 2 commits intomodel-checking:mainfrom
Conversation
celinval
reviewed
Apr 20, 2022
Contributor
celinval
left a comment
There was a problem hiding this comment.
Is there any test case for this?
Contributor
Author
|
This test: https://github.com/model-checking/kani/blob/3c008db98f2559b131f2b10ba355ee73d6dd4943/tests/kani/Generator/main.rs |
Contributor
Author
|
I found out that the and not the one in place.rs. However, my attempts at creating a test that covers the line of code in place.rs, which I think requires having a struct with a generator field, e.g.:
#![feature(generators, generator_trait)]
use std::ops::{Generator};
struct HasGeneratorField<T>
where T: Generator {
_g: T,
}
impl<T> HasGeneratorField<T>
where T: Generator {
pub fn new(g: T) -> Self {
HasGeneratorField { _g: g }
}
}
//#[kani::proof]
fn main() {
let _s = HasGeneratorField::new(|| { yield 1; return 2; });
}all resulted in a crash that I filed as #1075. So I think this may have to stay untested till the other issue is fixed. |
celinval
approved these changes
Apr 20, 2022
Contributor
celinval
left a comment
There was a problem hiding this comment.
Thanks for trying to add a test. I think this is still beneficial as is.
tedinski
pushed a commit
to tedinski/rmc
that referenced
this pull request
Apr 26, 2022
tedinski
pushed a commit
that referenced
this pull request
Apr 27, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
With the mechanism for handling unsupported scenarios in projection code introduced in #1057, it is now possible to avoid creating a projected place for unsupported fields. This PR introduces a similar mechanism for handling unsupported fields in
codegen_fieldthat propagates an error upstream.Resolved issues:
Call-outs:
Testing:
How is this change tested? Existing tests
Is this a refactor change? Partially
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.