diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/consts/min_const_fn/min_const_fn_unsafe_ok.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/consts/min_const_fn/min_const_fn_unsafe_ok.rs')
-rw-r--r-- | src/test/ui/consts/min_const_fn/min_const_fn_unsafe_ok.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_ok.rs b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_ok.rs deleted file mode 100644 index 02c7970de..000000000 --- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_ok.rs +++ /dev/null @@ -1,44 +0,0 @@ -// check-pass - -const unsafe fn ret_i32_no_unsafe() -> i32 { 42 } -const unsafe fn ret_null_ptr_no_unsafe<T>() -> *const T { std::ptr::null() } -const unsafe fn ret_null_mut_ptr_no_unsafe<T>() -> *mut T { std::ptr::null_mut() } -const fn no_unsafe() { unsafe {} } - -const fn call_unsafe_const_fn() -> i32 { - unsafe { ret_i32_no_unsafe() } -} -const fn call_unsafe_generic_const_fn() -> *const String { - unsafe { ret_null_ptr_no_unsafe::<String>() } -} -const fn call_unsafe_generic_cell_const_fn() - -> *const Vec<std::cell::Cell<u32>> -{ - unsafe { ret_null_mut_ptr_no_unsafe::<Vec<std::cell::Cell<u32>>>() } -} - -const unsafe fn call_unsafe_const_unsafe_fn() -> i32 { - unsafe { ret_i32_no_unsafe() } -} -const unsafe fn call_unsafe_generic_const_unsafe_fn() -> *const String { - unsafe { ret_null_ptr_no_unsafe::<String>() } -} -const unsafe fn call_unsafe_generic_cell_const_unsafe_fn() - -> *const Vec<std::cell::Cell<u32>> -{ - unsafe { ret_null_mut_ptr_no_unsafe::<Vec<std::cell::Cell<u32>>>() } -} - -const unsafe fn call_unsafe_const_unsafe_fn_immediate() -> i32 { - ret_i32_no_unsafe() -} -const unsafe fn call_unsafe_generic_const_unsafe_fn_immediate() -> *const String { - ret_null_ptr_no_unsafe::<String>() -} -const unsafe fn call_unsafe_generic_cell_const_unsafe_fn_immediate() - -> *const Vec<std::cell::Cell<u32>> -{ - ret_null_mut_ptr_no_unsafe::<Vec<std::cell::Cell<u32>>>() -} - -fn main() {} |