Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vstd: copy_from_slice and extend_from_slice specs #1153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hayley-leblanc
Copy link
Collaborator

This PR adds specifications for the slice method copy_from_slice and the vec method extend_from_slice.

#[verifier::external_fn_specification]
pub fn ex_vec_extend_from_slice<T: Clone, A: Allocator>(vec: &mut Vec<T, A>, slice: &[T])
ensures
vec@ == old(vec)@ + slice@,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new elements in vec are generated by calling clone, so I think this needs to be based on the ensures from clone, like ex_vec_clone is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants