SIFR-OWN-0002 belongs to the Ownership and borrowing diagnostic family. It means: conflicting borrow.
Why It Happens
The ownership model would be violated. Move values only once, keep borrows scoped, and cross task/channel/IPC boundaries only with owned values that satisfy the required safety traits.Use
sifr --explain SIFR-OWN-0002 locally to see the renderer’s exact message template and any machine-applicable suggestions for the compiler version you are running.Erroneous Code
The same storage cannot participate in conflicting reads, moves, or mutable borrows. Most often this happens when an overlapping field read, shared borrow, mutable borrow, or owned move occurs in the same call as a mutable receiver or mutable argument. It can also happen when a secondanext() advance starts
before the first pending advance has been awaited.
How To Fix It
Use a disjoint place for every other argument while a mutable receiver or argument is active. If an argument only needs a value derived from the same place, snapshot that value in a local before the call. For example, rewritevalues.append(len(values)) as:
anext() result before starting the
next advance.
For example, this starts a second advance while the first one still holds the
generator:
Fixed Code
Details
See the Error Codes index for the complete catalog.
