Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
nostrademons
on Sept 23, 2015
|
parent
|
context
|
favorite
| on:
Linus on compiler warnings and code reviews
Most of the time, you'll be accessing Rust collections through iterators, and iterators fold the bounds-check into the termination condition. There's no additional overhead here; it compiles into the exact same code that the C would.
acconsta
on Sept 23, 2015
[–]
If you're using iterators, you don't have to worry about buffer overflow. But every A[i] random access needs to be bound checked.
FreeFull
on Sept 23, 2015
|
parent
[–]
Although the bounds check can also be elided if the compiler knows i < len
acconsta
on Sept 24, 2015
|
root
|
parent
[–]
Right. I think that's mostly immutable containers though, right? Or is the compiler smarter than that?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: