News for hackers. Stuff that matters.
Re:A 30 minute introduction to Rust by kibwen on Monday January 13, 2014 @03:35PM (#7053083)
For reference, the following actions are what are enabled within `unsafe` blocks in Rust:

1. Dereferencing raw pointers (a.k.a. "unsafe" pointers). Note that's just dereferencing: there's nothing inherently unsafe about just creating and passing around the pointers themselves.

2. Calling a Rust function that has been marked with the entirely-optional `unsafe` keyword.

3. Calling an external function via the C FFI, all of which are automatically considered unsafe.

Re:A 30 minute introduction to Rust by silon3 on Tuesday January 14, 2014 @03:56AM (#7056055)
>Note that's just dereferencing: there's nothing inherently unsafe about just creating and passing around the pointers themselves.

Sure there is. Passing around multiple pointers can result in a double free and then the dangerous dereference can happen. I'm guessing the developer must be careful when writing unsafe blocks to make sure this doesn't happen.

Re:A 30 minute introduction to Rust by dbaupp on Tuesday January 14, 2014 @06:32AM (#7056462)
Unsafe behaviours with raw pointers:

  - dereferencing
  - arithmetic (implemented as ptr.offset(number) in the stdlib), 
    since it is undefined behaviour for LLVM to move a pointer to
    point outside* of the object that it came from originally 
    (even without deferencing)
Everything else is OK. (Although the only other thing possible is passing it around as "black box" value.)

*One byte past the end is ok.

Re:A 30 minute introduction to Rust by octo_t on Tuesday January 14, 2014 @04:41AM (#7056173)
but they are safe until you decide to do that deferencing, otherwise they're just uint_ptrs really.
Re:A 30 minute introduction to Rust by valtron on Monday January 13, 2014 @06:34PM (#7054367)
Don't points 2 & 3 together imply that anything that uses built-ins, which I assume are implemented with C FFI, is `unsafe`?
Re:A 30 minute introduction to Rust by evincarofautumn on Monday January 13, 2014 @08:24PM (#7054782)
No, “unsafe” means “evaluate this unsafe block as though it were safe”. This enables Modula-style safe interfaces for unsafe implementations.
Re:A 30 minute introduction to Rust by anon_d on Monday January 13, 2014 @06:56PM (#7054464)
Just to clarify, using a `unsafe` block in a function does NOT mean that you have to tag that function as unsafe.
Re:A 30 minute introduction to Rust by steveklabnik on Monday January 13, 2014 @06:37PM (#7054382)
I'm not 100% sure exactly what you mean by 'built-ins', but Rust is almost entirely written in Rust. I don't think there's anything major implemented via C FFI in the compiler itself.