The trimming algorithm will happily copy all the transactions that are getting evicted so they can be parsed and the coin view updated. This is due to the algorithm being written prior to the existence of CTransactionRef, aka shared_ptr<const CTransactionRef>, which will let us hold the pointer instead even after the transaction has been removed from the mempool.
Note that the MempoolEviction benchmark does not show any significant performance difference with previous code (increase the benchmark min time, see D12903).
There is no change in behavior.