You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Return a mutable slice containing all elements of the vector.pubfnas_mut_slice(&mutself) -> &mut[T]{ArrayVecImpl::as_mut_slice(self)}
AFAIK, const trait implementation is not landing soon. If ArrayVecImpl::as_mut_slice is defined via the call to the inherent function instead (i.e. if we reverse the implementation dependency), it will be possible to have easier feature-gated support for the const inherent associated function. Instead of the dependence on both const_trait_impl and const_mut_refs features there will be the dependency only on the latter.
I guess it may be fine if you don't want to offer a feature-gated support for nightly const_mut_refs. However, I wouldn't mind to help you with reversing the dependency and opt-in support for the aforementioned nightly features. There's a popular crate const_fn that can help provide such support cleaner.
The text was updated successfully, but these errors were encountered:
JohnScience
changed the title
Why are inherent associated methods of ArrayVec implemented via calls to trait-associated methods of ArrayVecImpl and not vice versa?
Why are inherent associated functions of ArrayVec implemented via calls to trait-associated functions of ArrayVecImpl and not vice versa?
Oct 13, 2022
Example:
AFAIK, const trait implementation is not landing soon. If ArrayVecImpl::as_mut_slice is defined via the call to the inherent function instead (i.e. if we reverse the implementation dependency), it will be possible to have easier feature-gated support for the const inherent associated function. Instead of the dependence on both
const_trait_impl
andconst_mut_refs
features there will be the dependency only on the latter.I guess it may be fine if you don't want to offer a feature-gated support for nightly
const_mut_refs
. However, I wouldn't mind to help you with reversing the dependency and opt-in support for the aforementioned nightly features. There's a popular crateconst_fn
that can help provide such support cleaner.The text was updated successfully, but these errors were encountered: