Skip to content

Rust 1.12 release announcement #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Sep 29, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 17 additions & 32 deletions _posts/2016-09-29-Rust-1.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ what you think of them:

The largest internal change in this release is moving to a new compiler backend
based on the new Rust [MIR]. While this feature does not result in anything
user-visible, it paves the way for a number of future compiler optimizations,
and for some codebases it already results in improvements to compile times and
reductions in code size.
user-visible today, but it paves the way for a number of future compiler

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"while... but" typo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thank you

optimizations, and for some codebases it already results in improvements to
compile times and reductions in code size.

[previously talked]: https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html
[volunteer effort]: https://github.com/rust-lang/rust/issues/35233
Expand All @@ -43,9 +43,9 @@ reductions in code size.
#### Overhauled error messages

With 1.12 we're introducing a new error format which helps to surface a lot of
the internal knowledge about why an error is occurring to you, the developer. It
does this by focusing on your code and the points of interest in your code that
are relevant to the error.
the internal knowledge about why an error is occurring to you, the developer.
It does this by putting your code front and center, highlighting the parts
relevant to the error with annotations describing what went wrong.

For example, in 1.11 if a implementation of a trait didn't match the trait
declaration, you would see an error like the one below:
Expand Down Expand Up @@ -103,29 +103,6 @@ the compiler and less bloat at runtime. In addition, because MIR is a simpler
'language' than the full AST, it's also easier to implement compiler passes on,
and easier to verify that they are correct.

The improvements in compile times of some workloads due to this change alone
are significant:

| | 1.11 | 1.12 | compile time |
|---------------|--------|-------|--------------|
| inflate-0.1.0 | 10.17s | 4.32s | 2.35x faster |
| hyper-0.5.0 | 24.03s | 5.23s | 4.58x faster |
| helloworld | 0.17s | 0.14s | 1.20x faster |
| regex 0.1.30 | 9.63s | 2.39s | 4.03x faster |

It is worth remembering that not all workloads may see this large of an
improvement: it depends on a large number of factors.

The compiler's [memory usage](https://en.wikipedia.org/wiki/Resident_set_size)
while compiling these crates was also improved:

| | 1.11 | 1.12 | % of original size |
|---------------|-------|-------|--------------------|
| inflate-0.1.0 | 175MB | 135MB | 77.1% |
| hyper.0.5.0 | 321MB | 302MB | 94.1% |
| helloworld | 127MB | 90MB | 70.9% |
| regex.0.1.30 | 230MB | 194MB | 84.3% |

#### Other improvements

* Many minor improvements to the documentation.
Expand Down Expand Up @@ -185,10 +162,18 @@ See the [detailed release notes][notes] for more.

#### Cargo features

Cargo has some modest improvments:
The biggest feature added to Cargo this cycle is the ability to [override the
source of a crate](https://github.com/rust-lang/cargo/pull/2857). Using this
with tools like [cargo-vendor] and [cargo-local-registry] allow vendoring
dependencies locally in a robust fashion. Eventually this support will be the
foundation of supporting mirrors of [crates.io] as well.

[cargo-vendor]: https://github.com/alexcrichton/cargo-vendor
[cargo-local-registry]: https://github.com/alexcrichton/cargo-local-registry
[crates.io]: https://crates.io/

There are some other improvments as well:

* [Support local mirrors of
registries](https://github.com/rust-lang/cargo/pull/2857)
* [Speed up noop registry updates](https://github.com/rust-lang/cargo/pull/2974)
* [Add a `--lib` flag to `cargo new`]
(https://github.com/rust-lang/cargo/pull/2921)
Expand Down