diff options
| author | woppopo <woppopo@protonmail.com> | 2022-01-28 17:27:33 +0900 |
|---|---|---|
| committer | woppopo <woppopo@protonmail.com> | 2022-01-28 17:27:33 +0900 |
| commit | 7a7144f4136897605842886b1ca51515e75d654e (patch) | |
| tree | cb58bd9bd3bbba358733c17019d844e47a7b372d | |
| parent | 29932db09bb985072dc68d9d4e4acab09e69562a (diff) | |
| download | rust-7a7144f4136897605842886b1ca51515e75d654e.tar.gz rust-7a7144f4136897605842886b1ca51515e75d654e.zip | |
test_const_allocate_at_runtime
| -rw-r--r-- | library/core/tests/intrinsics.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/library/core/tests/intrinsics.rs b/library/core/tests/intrinsics.rs index e5b6fa7f732..df940de4795 100644 --- a/library/core/tests/intrinsics.rs +++ b/library/core/tests/intrinsics.rs @@ -83,7 +83,16 @@ fn test_hints_in_const_contexts() { #[cfg(not(bootstrap))] #[test] -fn test_const_dealocate_at_runtime() { +fn test_const_allocate_at_runtime() { + use core::intrinsics::const_allocate; + unsafe { + assert!(const_allocate(4, 4).is_null()); + } +} + +#[cfg(not(bootstrap))] +#[test] +fn test_const_deallocate_at_runtime() { use core::intrinsics::const_deallocate; const X: &u32 = &42u32; let x = &0u32; |
