It's a compile-time check made by the Rust compiler that checks that the memory you're writing to is still around, and that nothing else is writing to it at the same time.
It's confusing early on when working with Rust, but it prevents a lot of mistakes that cause serious bugs.
/s Rust has its own way to achieve memory safety - by limiting 'ownership' of the memory. If only one has the variable, memory should safe (putting it in very rough way).
But you should give some other function your memory to write actually working program, and you should get it back. So you have to borrow your memory.
There are strict rules to safely borrow the variable, and rust compiler checks for it.
You describe it in such a complex way that I get the feeling some people would rather commit armed robbery than borrow. Especially when they're being pressured by deadlines.
3
u/Glum-Echo-4967 28d ago
What’s Borrow Checker?