Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brim-lang.com/llms.txt

Use this file to discover all available pages before exploring further.

What this means

mutation invalidates outstanding iterator borrows

Metadata

  • Code: E4012
  • Default level: Error
  • Phase: Borrow Check
  • Canonical docs URL: https://docs.brim-lang.com/diagnostics/E4012
  • Tags: borrow, iterator

How to fix

  • collect first
  • avoid mutating backing collection during iteration

Typical output

E4012: iterator invalidation pattern
note: mutation invalidates outstanding iterator borrows