I accidentally hit this in #162804 (comment).
Essentially, replacing Unique<u8> with NonNull<u8> in RawVecInner<A> meant that I had to rewrite the Send, Sync, and UnwindSafe impls for it.
I initially chose to do this on RawVec<T, A> using impl<T: AuTr, A: Allocator + AuTr> AuTr for RawVec<T, A>.
This caused slight compile time regressions, as well as a compile error due to the trait solver now exceeding the recursion limit on a complex rayon iterator, likely due to the Send supertrait bound on ParallelIterator.
The benchmark that failed to compile can be found in src/tools/rustc-perf/collector/runtime-benchmarks/css/, and the failure reproduced with cargo +b67dca92df005a4ebbe8c3b45e6cfe97925fff26 check, using kennytm/rustup-toolchain-install-master.
This is dangerous especially for std, because it risks introducing regressions when refactoring the internals of commonly used types.
Note that the old impls were auto-derived from the A and PhantomData<T> fields, because Unique<u8> implemented all the relevant traits.
Now that I've pulled the manual impls back to impl<A: Allocator + AuTr> AuTr for RawVecInner<A>, it seems to no longer be regressing (still waiting for perf).
All these impls should be equivalent (if anything, I'd expect the auto impl to be more work than the manual one).
@rustbot label WG-trait-system-refactor A-auto-traits E-needs-mcve T-types
I accidentally hit this in #162804 (comment).
Essentially, replacing
Unique<u8>withNonNull<u8>inRawVecInner<A>meant that I had to rewrite theSend,Sync, andUnwindSafeimpls for it.I initially chose to do this on
RawVec<T, A>usingimpl<T: AuTr, A: Allocator + AuTr> AuTr for RawVec<T, A>.This caused slight compile time regressions, as well as a compile error due to the trait solver now exceeding the recursion limit on a complex
rayoniterator, likely due to theSendsupertrait bound onParallelIterator.The benchmark that failed to compile can be found in
src/tools/rustc-perf/collector/runtime-benchmarks/css/, and the failure reproduced withcargo +b67dca92df005a4ebbe8c3b45e6cfe97925fff26 check, using kennytm/rustup-toolchain-install-master.This is dangerous especially for std, because it risks introducing regressions when refactoring the internals of commonly used types.
Note that the old impls were auto-derived from the
AandPhantomData<T>fields, becauseUnique<u8>implemented all the relevant traits.Now that I've pulled the manual impls back to
impl<A: Allocator + AuTr> AuTr for RawVecInner<A>, it seems to no longer be regressing (still waiting for perf).All these impls should be equivalent (if anything, I'd expect the auto impl to be more work than the manual one).
@rustbot label WG-trait-system-refactor A-auto-traits E-needs-mcve T-types