File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,10 @@ test_verify_one_file! {
222
222
223
223
test_verify_one_file ! {
224
224
#[ test] pointer_exec_eq_is_not_spec_eq verus_code! {
225
+ use vstd:: prelude:: * ;
225
226
fn test_const_eq( x: * const u8 , y: * const u8 ) {
226
227
if x == y {
228
+ assert( x@. addr == y@. addr) ;
227
229
assert( x == y) ; // FAILS
228
230
}
229
231
}
@@ -233,7 +235,7 @@ test_verify_one_file! {
233
235
assert( x == y) ; // FAILS
234
236
}
235
237
}
236
- } => Err ( err) => assert_vir_error_msg ( err, "The verifier does not yet support the following Rust feature: ==/!= for non smt equality types" )
238
+ } => Err ( err) => assert_fails ( err, 2 )
237
239
}
238
240
239
241
test_verify_one_file ! {
Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ impl<T: ?Sized> View for *mut T {
144
144
spec fn view( & self ) -> Self :: V ;
145
145
}
146
146
147
+ #[ cfg( verus_keep_ghost) ]
148
+ impl <T : ?Sized > super :: std_specs:: cmp:: SpecPartialEqOp <* mut T > for * mut T {
149
+ open spec fn spec_partial_eq( & self , other: & * mut T ) -> bool {
150
+ self @. addr == other@. addr
151
+ }
152
+ }
153
+
147
154
impl <T : ?Sized > View for * const T {
148
155
type V = PtrData ;
149
156
@@ -153,6 +160,13 @@ impl<T: ?Sized> View for *const T {
153
160
}
154
161
}
155
162
163
+ #[ cfg( verus_keep_ghost) ]
164
+ impl <T : ?Sized > super :: std_specs:: cmp:: SpecPartialEqOp <* const T > for * const T {
165
+ open spec fn spec_partial_eq( & self , other: & * const T ) -> bool {
166
+ self @. addr == other@. addr
167
+ }
168
+ }
169
+
156
170
impl <T > View for PointsTo <T > {
157
171
type V = PointsToData <T >;
158
172
You can’t perform that action at this time.
0 commit comments