Skip to content

Precise summary of Rust's safety guarantees #1204

Open
@kornelski

Description

@kornelski

I've noticed that there isn't (or I couldn't find) a summary of what Rust safety guarantees are, and how it achieves it.

It's a bit odd, because I somehow know what these guarantees are, and I think everyone in the community has an idea what Rust considers as safe, but I can't find resources (other than forum posts and unofficial blog posts) that clearly state these things.

The homepage has a pitch:

Rust’s rich type system and ownership model guarantee memory-safety and thread-safety — enabling you to eliminate many classes of bugs at compile-time.

but there are no links to any details what the "many classes" of the bugs are, or what counts as memory-safety in Rust.

The homepage pitch is ok, but it's not enough to understand how Rust compares to safety in modern C++ or Go.

Rust reference and Rustonomicon go into detail of what is not considered safe, and how to use unsafe to uphold Rust's safety guarantees. That could theoretically be used to figure out what Rust considers safe, but these resources are written for advanced Rust users, and may be hard to digest for people who are only evaluating Rust.

I think it would be good to have a resource that is somewhere in between an elevator pitch and a language reference, which explains what Rust guarantees and what it doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions