Auto merge of #79621 - usbalbin:constier_maybe_uninit, r=RalfJung
Constier maybe uninit I was playing around trying to make `[T; N]::zip()` in #79451 be `const fn`. One of the things I bumped into was `MaybeUninit::assume_init`. Is there any reason for the intrinsic `assert_inhabited<T>()` and therefore `MaybeUninit::assume_init` not being `const`? --- I have as best as I could tried to follow the instruction in [library/core/src/intrinsics.rs](https://github.com/rust-lang/rust/blob/master/library/core/src/intrinsics.rs#L11). I have no idea what I am doing but it seems to compile after some slight changes after the copy paste. Is this anywhere near how this should be done? Also any ideas for name of the feature gate? I guess `const_maybe_assume_init` is quite misleading since I have added some more methods. Should I add test? If so what should be tested?
This commit is contained in:
commit
39b841dfe3
12 changed files with 87 additions and 14 deletions
|
@ -70,6 +70,7 @@
|
|||
#![feature(cfg_target_has_atomic)]
|
||||
#![cfg_attr(not(bootstrap), feature(const_heap))]
|
||||
#![feature(const_alloc_layout)]
|
||||
#![feature(const_assert_type)]
|
||||
#![feature(const_discriminant)]
|
||||
#![feature(const_cell_into_inner)]
|
||||
#![feature(const_checked_int_methods)]
|
||||
|
@ -93,6 +94,7 @@
|
|||
#![feature(const_ptr_offset)]
|
||||
#![feature(const_ptr_offset_from)]
|
||||
#![feature(const_raw_ptr_comparison)]
|
||||
#![feature(const_raw_ptr_deref)]
|
||||
#![feature(const_slice_from_raw_parts)]
|
||||
#![feature(const_slice_ptr_len)]
|
||||
#![feature(const_size_of_val)]
|
||||
|
@ -101,6 +103,8 @@
|
|||
#![feature(const_type_name)]
|
||||
#![feature(const_likely)]
|
||||
#![feature(const_unreachable_unchecked)]
|
||||
#![feature(const_maybe_uninit_assume_init)]
|
||||
#![feature(const_maybe_uninit_as_ptr)]
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(doc_cfg)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue