

Rust for C++ programmers – part 5: borrowed references - hobo_mark
http://featherweightmusings.blogspot.ch/2014/05/rust-for-c-programmers-part-5-borrowed.html

======
pohl
This might be a silly question (I've spent my whole career in languages that
don't offer much control), but: does it matter - with regard to these borrowed
references - whether the item is on the heap or the stack, or can one have
borrowed references to either?

I'm guessing the answer is the latter since I believe "let x = 5" in the
examples doesn't box the integer. But I thought I should ask to confirm that
suspicion.

~~~
ben0x539
You can have references to values on the heap or on the stack, and to whole
objects or to single fields in a struct/enum/tuple/vector (though that might
freeze the whole containing object).

