I realize it wouldn't be practical, but part of me wishes there was a block similar to `unsafe {}` to encapsulate any code in Rust that could potentially panic. E.g. indexing into a vector using `my_vec[i]` is allowed in safe code, but can crash your program. Same for `x + y`.
Replying to @CWMma
Oh, it's different in idea! It's not so much to *catch* errors, but to enable a superset of the language which can cause panics. Similar in idea to `unsafe {}` blocks which are a superset of Rust with access to raw pointers. Try {} blocks are also useful, but different purpose!
6:54 AM - 19 Sep 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.