diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 7d11dd2800fd4..590f4e46c1d2f 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -71,6 +71,8 @@ #![feature(cfg_target_has_atomic)] #![feature(concat_idents)] #![feature(const_fn)] +#![feature(const_if_match)] +#![feature(const_panic)] #![feature(const_fn_union)] #![feature(const_generics)] #![feature(const_ptr_offset_from)] diff --git a/src/libcore/ptr/const_ptr.rs b/src/libcore/ptr/const_ptr.rs index e5297a0c1e094..fc3c02e1f066d 100644 --- a/src/libcore/ptr/const_ptr.rs +++ b/src/libcore/ptr/const_ptr.rs @@ -288,10 +288,7 @@ impl *const T { T: Sized, { let pointee_size = mem::size_of::(); - let ok = 0 < pointee_size && pointee_size <= isize::max_value() as usize; - // assert that the pointee size is valid in a const eval compatible way - // FIXME: do this with a real assert at some point - [()][(!ok) as usize]; + assert!(0 < pointee_size && pointee_size <= isize::max_value() as usize); intrinsics::ptr_offset_from(self, origin) }