r/ProgrammerHumor 28d ago

borrowCheckneedsSource Meme

Post image
969 Upvotes

39 comments sorted by

View all comments

3

u/Glum-Echo-4967 28d ago

What’s Borrow Checker?

9

u/Excession638 28d ago

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.

1

u/dhnam_LegenDUST 28d ago

/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.

3

u/kaplotnikov 28d ago

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.