-
Notifications
You must be signed in to change notification settings - Fork 66
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
Deep view unsupported for &[u8] #1070
Comments
Adding this to modified source/vstd/view.rs
@@ -1,4 +1,6 @@
#[allow(unused_imports)]
+use crate::prelude::*;
+#[allow(unused_imports)]
use builtin::*;
#[allow(unused_imports)]
use builtin_macros::*;
@@ -40,6 +42,16 @@ impl<A: DeepView> DeepView for &A {
}
}
+impl<T: DeepView> DeepView for [T] {
+ type V = Seq<T::V>;
+
+ #[verifier::inline]
+ open spec fn deep_view(&self) -> Self::V {
+ let v = self.view();
+ Seq::new(v.len(), |i: int| v[i].deep_view())
+ }
+}
+
#[cfg(feature = "alloc")]
impl<A: View> View for alloc::boxed::Box<A> {
type V = A::V; To make a PR, this probably needs some tests, but otherwise yeah, this code is sufficient to get |
@jaybosamiya Thanks! I turned this into pull request #1078 . |
Implemented by #1078 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works:
but this doesn't:
as it returns the error
Is this simply a matter of adding the function to
SliceAdditionalSpecFns
?The text was updated successfully, but these errors were encountered: