Some reports weren’t announced last week, so there are multiple weeks covered below.
Lang
Today we accepted three RFCs:
-
RFC #1358: Adding the
#[repr(align)]
attribute. To avoid an incompatibility case between gcc and msvc, we decided to disallow structs with a manual alignment from being packed into another struct. - RFC #1592: An amendment to account for the WF requirement on tuples, which was overlooked before.
-
RFC #1492: Allow
..
in more places within patterns.
We decided not to accept two RFCs as well. Both were dealing with some details of how to handle intrinsics and atomic types. Given the recent libs team decisions in RFC 1543, the issue is somewhat moot.
We put one RFC into FCP:
-
RFC 1590: add the
lifetime
fragment specifier formacro_rules
.
Compiler
The compiler team has all gathered together at Mozilla’s offices in Mountain View in the first ever “rustc development sprint”. We’ve been hacking away on MIR support as well as incremental compilation, and progress has been quite rapid. As of this writing, the hardest part of the backend work on incremental compilation appears to be nearing completion – restructuring the backend to create the reusable codegen units. In MIR land, a number of optimization improvements have landed, and there is even preliminary work on implementing non-zeroing drop. Finally, we’ve had a number of good architectural discussions.
I mentioned that last week we had our first ever “compiler team development sprint”. I wanted to give a few more details on what we did during the week.
First off, we had a number of design discussions, covering such topics as incremental compilation, the shortest path to IDE integration, and how to restructure the compiler to move lifetime checking so that it operates on the MIR (which is required for non-lexical lifetimes).
Secondly, we did a lot of hacking! Some of the notable highlights were:
- arielb1 implemented a more-or-less working version of non-zeroing drop!
- pnkfelix implemented a number of fixes and a unit-testing framework for the dataflow framework that underlies the non-zeroing drop work.
- nagisa implemented a lattice-based dataflow framework for constant propagation and other optimizations on MIR.
- eddyb hacked up the compiler to save metadata even when not generating code, which could serve as the basis for a cross-crate version of cargo check (think: very fast type-checking while you are working). He also worked on some refactorings in support of incremental compilation.
- nrc made a number of improvements to rustw, interfacing it to the compiler’s metadata so it can support things like “go to definition” etc. This will hopefully evolve into something that other IDEs can tap into as well.
- mw and aatch made great progress on refactoring the back-end of the compiler to be more suitable for incremental compilation; we’re getting close to a working prototype!
- doener made a number of small improvements to MIR that collectively had a huge impact on the time it takes to translate various crates using MIR.
- nmatsakis (that’s me!) fixed a horrible bug in the lifetime errors that was often causing them to give terrible suggestions, and made some improvements to track incremental changes across crates.
- Alon Zakai and Brian Anderson did some preliminary hacking that allowed us to translate Rust MIR into WebAssembly, successfully converting a simple “hello, world” style example.
Quite a successful week!
Libs
This week we decided on API stabilizations for the 1.10 release:
- static sync primitives - https://github.com/rust-lang/rust/issues/27717
- deprecate
- recommend lazy static, which is destined for
std
eventually
- OpenOptionsExt on windows - https://github.com/rust-lang/rust/issues/27720
- stabilize – alex will verify
- char encoding - https://github.com/rust-lang/rust/issues/27784
- stablize write_utf8
- don’t stabilize others
- OpenOptions expansion - https://github.com/rust-lang/rust/issues/30014
- stabilize after verification
- Weak::new - https://github.com/rust-lang/rust/issues/30425
- stabilize + add default
- panic hooks - https://github.com/rust-lang/rust/issues/30449
- stabilize
- CStr::from_bytes_with_nul - https://github.com/rust-lang/rust/issues/31190
- stabilize
- SystemTime + fs::Metadata - https://github.com/rust-lang/rust/issues/31399
- stabilize
- compare_exchange - https://github.com/rust-lang/rust/issues/31767
- stabilize
- is_empty - https://github.com/rust-lang/rust/issues/32111
- deprecate
- exposing keys from Entry - https://github.com/rust-lang/rust/issues/32281
- stabilize
- unix sockets - https://github.com/rust-lang/rust/issues/32312
- stabilize
- Map values_mut - https://github.com/rust-lang/rust/issues/32551
- stabilize
- binary_search_by_key - https://github.com/rust-lang/rust/issues/33018
- stabilize
We also discussed the policy around Rust compiler version support and
rust-lang
crates, which resulted in a new
policy RFC.
Finally, this week saw a
major RFC covering the regex
crate, which will ultimately transition it to 1.0 and full rust-lang
status.
Tools
- An excellent blog post about rustup was published, detailing the vision for the tool and next steps.
- Custom panic runtimes are now implemented which means that the
compiler flag
-C panic=abort
can now be use to implement panics as aborts. - The new rust build system can now run crate tests which should bring it up to feature parity for tier 1 platforms.
- Various Android targets have [seen][android1] [updates][android2] to enable more features and align them with the upstream definitions.
- A new crate type,
cdylib
, is now available for production by the compiler which is optimized for producing a dynamic library with a C API. More information can be found in the relevant RFC. - Cargo will now retry failed network requests by default if they look like they’re spurious failures.
- Cargo will now emit status to stderr instead of stdout.