Open bjoernager opened 1 day ago
r? @jhpratt
rustbot has assigned @jhpratt. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
r? libs-api
@rustbot label +T-libs-api -T-libs
Should lifetimes be explicit here or can the compiler still deduce that they derive from that of self
?
E.g.:
pub const fn each_ref<'a>(&'a self) -> [&'a T; N];
@bors r+
Tracking issue: #133289
The methods
<[T; N]>::each_ref
and<[T; N]>::each_mut
can easily be reimplemented to allow marking them with theconst
specifier.This specific implementation takes a different approach than the original as to avoid using iterators (which are illegal in constant expressions).