-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
SOUNDNESS: Query should not be Copy #17693
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorP-UnsoundA bug that results in undefined compiler behaviorA bug that results in undefined compiler behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Milestone
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorP-UnsoundA bug that results in undefined compiler behaviorA bug that results in undefined compiler behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
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)