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
Show file tree
Hide file tree
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
305 changes: 305 additions & 0 deletions _posts/2016-09-29-Rust-1.12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
---
layout: post
title: "Announcing Rust 1.12.0"
author: The Rust Core Team
---

The Rust team is happy to announce the latest version of Rust, 1.12.0. Rust is a
systems programming language focused on safety, speed, and concurrency.

As always, you can [install Rust 1.12.0][install] from the appropriate page on our
website, and check out the [detailed release notes for 1.12.0][notes] on GitHub.
1361 patches were landed in this release.

[install]: https://www.rust-lang.org/install.html
[notes]: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1120-2016-09-29

### What's in 1.12.0 stable

Oh my god! So much stuff!
Copy link
Contributor

Choose a reason for hiding this comment

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

Ha! I think brson put this in as a joke. I don't mind something fun here since there is a lot of stuff in this release, but maybe "Oh my god!" is a step too far.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I just imported the raw text for now 😄 I've just pushed a commit that re-works the intro a bit.


With 1.12 stable, one of the first visible changes you will notice is the new
error message format emitted by `rustc`. We've [previously talked] about this
format and this is the first release where they are broadly available. These
error messages are a result of the effort of many hours of [volunteer effort] to
design, test, and update every one of `rustc`s errors to the new format. We're
excited to see what you think of them:

![A new mismatched trait
error](/images/2016-09-Rust-1.12/mismatched-trait-error.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to use the same trait error in both this section and the expanded section below? Might read better to have pictures of a different kind of error here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I agree


The other major change in this release is moving to a new compiler backend based
on the new Rust [MIR]. While this feature does not result in any new
user-visible features, 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.

Repeating the word "feature" sounds weird, I would change the first occurrence to "change".

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
[MIR]: https://blog.rust-lang.org/2016/04/19/MIR.html

## 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra comma

Copy link
Member Author

Choose a reason for hiding this comment

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

i would put it here, but i over-comma, so 👍

are relevant to the error.

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:

![An old mismatched trait
error](/images/2016-09-Rust-1.12/old-mismatched-trait-error.png)

In the new error format we represent the error by instead showing the points in
the code that matter the most. Here the relevant line in the trait declaration,

Choose a reason for hiding this comment

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

There's a missing word after "Here" -- "is" or "it shows"?

and the relevant line in the implementation, using labels to describe why they
don't match:

![A new mismatched trait
error](/images/2016-09-Rust-1.12/mismatched-trait-error.png)

Choose a reason for hiding this comment

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

Please use a screenshot which doesn't include the //~ comments from the test suite. Otherwise, it looks like errors are printed twice.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jonathandturner mind sending a PR to my PR with new screenshots?


Initially, this error design was built to aid borrow-checking errors, but we

Choose a reason for hiding this comment

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

aid -> aid in understanding

found, like the error above, the format can be broadly applied to a wide variety

Choose a reason for hiding this comment

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

like -> as with

of errors. If you would like to learn more about the design, check out the
[previous blog post on the subject][err].

[err]: https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html

## MIR code generation

The new Rust "mid-level IR", usually called "MIR", gives the compiler a simpler
way to think about Rust code than it's previous way of operating entirely on the
Copy link
Contributor

Choose a reason for hiding this comment

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

it's -> its

Choose a reason for hiding this comment

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

it's -> its

Rust abstract syntax tree. It makes analysis and optimizations possible that
have previously been difficult to implement correctly. The first of many
Copy link
Contributor

Choose a reason for hiding this comment

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

We just said "previous" in the sentence prior. Maybe "that would otherwise have been difficult to implement correctly"

Copy link
Member Author

Choose a reason for hiding this comment

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

giving "historically" a try

upcoming changes to the compiler enabled by MIR is a rewrite of the pass that
generates LLVM IR, what `rustc` calls "translation", and after many months of
effort the MIR-based backend has proved itself ready for prime-time.

TODO: Improve code complexity: size of old trans vs size of new trans.

While for the most part this new backend is simply laying the groundwork for
future improvements, this release does include one long-awaited refinement to
the run-time representation of Rust types that results in both compile-time wins
and runtime wins: the removal of "drop flags", AKA "non-zeroing drop", as
specified in [RFC 320].

To maintain the semantics of Rust's `Drop` implementation, we always need to
check whether a type must be dropped when it goes out of scope. Historically,
this has been done by adding a special flag to all types that implement `Drop`,
but this resulted in significant extra memory being used at runtime.
Copy link
Member

Choose a reason for hiding this comment

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

This paragraph and the one before need to go (although you can say that MIR doesn't need to fill memory with a specific byte pattern to know when to drop values), as the full removal of old trans and drop flags is only in 1.13.

Copy link
Contributor

Choose a reason for hiding this comment

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

@eddyb - we saw the compile time performance from perf.rust-lang.org. How would you describe what happened between 1.11 and 1.12 to improve compile-time performance?

Copy link
Member

Choose a reason for hiding this comment

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

The MIR backend is barely faster - however it's possible some of @nikomatsakis performance improvements to type/trait-related instrumentation to be in there, warrants further investigation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am removing these paras but we should talk about it.


MIR exposes perfect information about the program's control flow, so the
compiler knows exactly whether types are moved or not, in which case it knows
Copy link
Contributor

Choose a reason for hiding this comment

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

Awkward wording

Copy link
Member Author

Choose a reason for hiding this comment

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

updatin'

statically whether or not the value's destructor needs to be run. In cases where
a value may or may not be moved at the end of a scope, the compiler now simply
uses a single bitflag on the stack, which is in turn easier for optimization
passes in LLVM to reason about. The end result is less work for the compiler and
less bloat at runtime.

The improvements in compile times of some workloads due to this change alone are
Copy link
Member Author

Choose a reason for hiding this comment

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

Does "this change" refer to static drop, or to MIR trans?

Copy link
Contributor

Choose a reason for hiding this comment

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

@brson mentioned yesterday this was from the non-zeroing drop. Brian, can we confirm that?

significant:
Copy link
Contributor

Choose a reason for hiding this comment

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

We may also want to say something to the effect "though not all workloads will see these improvements" or something to help set expectations. I don't want people to be like "but 1.12 doesn't compile my codebase 4.5x faster :( :("

Copy link
Member Author

Choose a reason for hiding this comment

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

yes


```
1.11 1.12 % change (compile time)
inflate-0.1.0 10.17s 4.32s -57.5%
hyper.0.5.0 24.03s 5.23s -78.2%
helloworld 0.17s 0.14s -16.4%
regex.0.1.30 9.63s 2.39s -75.2%
```
Copy link
Contributor

@sophiajt sophiajt Sep 27, 2016

Choose a reason for hiding this comment

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

We were thinking of this being a table. We may also want to turn the negative percentages into a column called "compile time" and change the percentage to a multiplier of improvement. Maybe something like:

2.35x faster
4.58x faster
1.20x faster
4.03x faster

Copy link
Member Author

Choose a reason for hiding this comment

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

done


TODO: Future improvements.

TODO: non-zeroing drop PR https://github.com/rust-lang/rust/pull/33622
https://irccloud.mozilla.com/pastebin/qqGY34SK

[RFC 320]: https://github.com/rust-lang/rfcs/blob/master/text/0320-nonzeroing-dynamic-drop.md

#### Library stabilizations

See the [detailed release notes][notes] for more.

#### Cargo features

See the [detailed release notes][notes] for more.

### Contributors to 1.12.0

We had 176 individuals contribute to 1.12.0. Thank you so much!
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to point out how many more people are in this one than before? Looking at 1.11 we had 126 and 1.10 had 139. It's not like an order of magnitude more, but the bump is noticeable at least.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am of two minds. It will then be conspicuously absent in the future 😉


* Aaron Gallagher
* abhi
* Adam Medziński
* Ahmed Charles
* Alan Somers
* Alexander Altman
* Alexander Merritt
* Alex Burka
* Alex Crichton
* Amanieu d'Antras
* Andrea Pretto
* Andre Bogus
* Andrew
* Andrew Cann
* Andrew Paseltiner
* Andrii Dmytrenko
* Antti Keränen
* Aravind Gollakota
* Ariel Ben-Yehuda
* Bastien Dejean
* Ben Boeckel
* Ben Stern
* bors
Copy link
Contributor

Choose a reason for hiding this comment

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

lol bors

Copy link
Member Author

Choose a reason for hiding this comment

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

bots are people too! @bors has been credited in every release so far. They work really hard!

* Brendan Cully
* Brett Cannon
* Brian Anderson
* Bruno Tavares
* Cameron Hart
* Camille Roussel
* Cengiz Can
* CensoredUsername
* cgswords
* Chiu-Hsiang Hsu
* Chris Stankus
* Christian Poveda
* Christophe Vu-Brugier
* Clement Miao
* Corey Farwell
* CrLF0710
* crypto-universe
* Daniel Campbell
* David
* [email protected]
* Diggory Blake
* Dominik Boehi
* Doug Goldstein
* Dridi Boukelmoune
* Eduard Burtescu
* Eduard-Mihai Burtescu
* Evgeny Safronov
* Federico Ravasio
* Felix Rath
* Felix S. Klock II
* Fran Guijarro
* Georg Brandl
* ggomez
* gnzlbg
* Guillaume Gomez
* hank-der-hafenarbeiter
* Hariharan R
* Isaac Andrade
* Ivan Nejgebauer
* Ivan Ukhov
* Jack O'Connor
* Jake Goulding
* Jakub Hlusička
* James Miller
* Jan-Erik Rediger
* Jared Manning
* Jared Wyles
* Jeffrey Seyfried
* Jethro Beekman
* Jonas Schievink
* Jonathan A. Kollasch
* Jonathan Creekmore
* Jonathan Giddy
* Jonathan Turner
* Jorge Aparicio
* José manuel Barroso Galindo
* Josh Stone
* Jupp Müller
* Kaivo Anastetiks
* kc1212
* Keith Yeung
* Knight
* Krzysztof Garczynski
* Loïc Damien
* Luke Hinds
* Luqman Aden
* m4b
* Manish Goregaokar
* Marco A L Barbosa
* Mark Buer
* Mark-Simulacrum
* Martin Pool
* Masood Malekghassemi
* Matthew Piziak
* Matthias Rabault
* Matt Horn
* mcarton
* M Farkas-Dyck
* Michael Gattozzi
* Michael Neumann
* Michael Rosenberg
* Michael Woerister
* Mike Hommey
* Mikhail Modin
* mitchmindtree
* mLuby
* Moritz Ulrich
* Murarth
* Nick Cameron
* Nick Massey
* Nikhil Shagrithaya
* Niko Matsakis
* Novotnik, Petr
* Oliver Forral
* Oliver Middleton
* Oliver Schneider
* Omer Sheikh
* Panashe M. Fundira
* Patrick McCann
* Paul Woolcock
* Peter C. Norton
* Phlogistic Fugu
* Pietro Albini
* Rahiel Kasim
* Rahul Sharma
* Robert Williamson
* Roy Brunton
* Ryan Scheel
* Ryan Scott
* saml
* Sam Payson
* Samuel Cormier-Iijima
* Scott A Carr
* Sean McArthur
* Sebastian Thiel
* Seo Sanghyeon
* Shantanu Raj
* ShyamSundarB
* silenuss
* Simonas Kazlauskas
* srdja
* Srinivas Reddy Thatiparthy
* Stefan Schindler
* Stephen Lazaro
* Steve Klabnik
* Steven Fackler
* Steven Walter
* Sylvestre Ledru
* Tamir Duberstein
* Terry Sun
* TheZoq2
* Thomas Garcia
* Tim Neumann
* Timon Van Overveldt
* Tobias Bucher
* Tomasz Miąsko
* trixnz
* Tshepang Lekhonkhobe
* ubsan
* Ulrik Sverdrup
* Vadim Chugunov
* Vadim Petrochenkov
* Vincent Prouillet
* Vladimir Vukicevic
* Wang Xuerui
* Wesley Wiser
* William Lee
* Ximin Luo
* Yojan Shrestha
* Yossi Konstantinovsky
* Zack M. Davis
* Zhen Zhang
* 吴冉波
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.