I don't think Query being Copy is sound?
IIUC you can go from a mutable Query to a read-only QueryLens, make a Query out of that lens again, then copy that Query, transmute_lens it again, and get a Query from it for a last time. Then you'd have a read-only query that is no longer bound to the &mut self of the original mutable Query.
Did I overlook something?
Originally posted by @Victoronz in #15858 (review)
I don't think
QuerybeingCopyis sound?IIUC you can go from a mutable
Queryto a read-onlyQueryLens, make aQueryout of that lens again, then copy thatQuery,transmute_lensit again, and get aQueryfrom it for a last time. Then you'd have a read-only query that is no longer bound to the&mut selfof the original mutableQuery.Did I overlook something?
Originally posted by @Victoronz in #15858 (review)