Skip to content

Commit d22ecc6

Browse files
committed
Disable contracts that are no longer supported
1 parent 3e48d75 commit d22ecc6

File tree

1 file changed

+11
-8
lines changed
  • library/core/src/intrinsics

1 file changed

+11
-8
lines changed

library/core/src/intrinsics/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3324,10 +3324,11 @@ pub fn contract_check_ensures<'a, Ret, C: Fn(&'a Ret) -> bool>(ret: &'a Ret, con
33243324
#[rustc_intrinsic]
33253325
// VTable pointers must be valid for dereferencing at least 3 `usize` (size, alignment and drop):
33263326
// <https://github.com/rust-lang/unsafe-code-guidelines/issues/166>
3327-
#[requires(ub_checks::can_dereference(_ptr as *const [usize; 3]))]
3328-
pub unsafe fn vtable_size(_ptr: *const ()) -> usize {
3329-
unreachable!()
3330-
}
3327+
// TODO: we can no longer do this given https://github.com/model-checking/kani/issues/3325 (this
3328+
// function used to have a dummy body, but no longer has since
3329+
// https://github.com/rust-lang/rust/pull/137489 has been merged).
3330+
// #[requires(ub_checks::can_dereference(_ptr as *const [usize; 3]))]
3331+
pub unsafe fn vtable_size(_ptr: *const ()) -> usize;
33313332

33323333
/// The intrinsic will return the alignment stored in that vtable.
33333334
///
@@ -3339,10 +3340,12 @@ pub unsafe fn vtable_size(_ptr: *const ()) -> usize {
33393340
#[rustc_intrinsic]
33403341
// VTable pointers must be valid for dereferencing at least 3 `usize` (size, alignment and drop):
33413342
// <https://github.com/rust-lang/unsafe-code-guidelines/issues/166>
3342-
#[requires(ub_checks::can_dereference(_ptr as *const [usize; 3]))]
3343-
pub unsafe fn vtable_align(_ptr: *const ()) -> usize {
3344-
unreachable!()
3345-
}
3343+
// TODO: we can no longer do this given https://github.com/model-checking/kani/issues/3325 (this
3344+
// function used to have a dummy body, but no longer has since
3345+
// https://github.com/rust-lang/rust/pull/137489 has been merged).
3346+
// #[requires(ub_checks::can_dereference(_ptr as *const [usize; 3]))]
3347+
// #[requires(ub_checks::can_dereference(_ptr as *const [usize; 3]))]
3348+
pub unsafe fn vtable_align(_ptr: *const ()) -> usize;
33463349

33473350
/// The size of a type in bytes.
33483351
///

0 commit comments

Comments
 (0)