diff options
| author | Ralf Jung <post@ralfj.de> | 2020-12-30 14:29:33 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-12-30 14:29:33 +0100 |
| commit | f76bae924438fbf4a885fd8827d43499ab5d1f68 (patch) | |
| tree | 43247d6ec2ca469125a5e92a27bb70fa7a570f63 /library | |
| parent | 95aed7ab3b38f908d357ee5e433946639fff6b03 (diff) | |
| download | rust-f76bae924438fbf4a885fd8827d43499ab5d1f68.tar.gz rust-f76bae924438fbf4a885fd8827d43499ab5d1f68.zip | |
CTFE: test size/align_of_val_raw on dangling pointers
Diffstat (limited to 'library')
| -rw-r--r-- | library/core/src/mem/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index e84014c68a6..70c3fded692 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -374,7 +374,8 @@ pub const fn size_of_val<T: ?Sized>(val: &T) -> usize { /// ``` #[inline] #[unstable(feature = "layout_for_ptr", issue = "69835")] -pub unsafe fn size_of_val_raw<T: ?Sized>(val: *const T) -> usize { +#[rustc_const_unstable(feature = "const_size_of_val_raw", issue = "46571")] +pub const unsafe fn size_of_val_raw<T: ?Sized>(val: *const T) -> usize { intrinsics::size_of_val(val) } @@ -505,7 +506,8 @@ pub const fn align_of_val<T: ?Sized>(val: &T) -> usize { /// ``` #[inline] #[unstable(feature = "layout_for_ptr", issue = "69835")] -pub unsafe fn align_of_val_raw<T: ?Sized>(val: *const T) -> usize { +#[rustc_const_unstable(feature = "const_align_of_val_raw", issue = "46571")] +pub const unsafe fn align_of_val_raw<T: ?Sized>(val: *const T) -> usize { intrinsics::min_align_of_val(val) } |
