Skip to content

Commit f6faf0b

Browse files
committed
Clean up const-hack from rust-lang#63810
1 parent 8f5f8f9 commit f6faf0b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/libcore/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
#![feature(cfg_target_has_atomic)]
7272
#![feature(concat_idents)]
7373
#![feature(const_fn)]
74+
#![feature(const_if_match)]
75+
#![feature(const_panic)]
7476
#![feature(const_fn_union)]
7577
#![feature(const_generics)]
7678
#![feature(const_ptr_offset_from)]

src/libcore/ptr/const_ptr.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@ impl<T: ?Sized> *const T {
288288
T: Sized,
289289
{
290290
let pointee_size = mem::size_of::<T>();
291-
let ok = 0 < pointee_size && pointee_size <= isize::max_value() as usize;
292-
// assert that the pointee size is valid in a const eval compatible way
293-
// FIXME: do this with a real assert at some point
294-
[()][(!ok) as usize];
291+
assert!(0 < pointee_size && pointee_size <= isize::max_value() as usize);
295292
intrinsics::ptr_offset_from(self, origin)
296293
}
297294

0 commit comments

Comments
 (0)