Hello and welcome to another issue of This Week in Rust! Rust is a systems language pursuing the trifecta: safety, concurrency, and speed. This is a weekly summary of its progress and community. Want something mentioned? Tweet us at @ThisWeekInRust or send us an email! Want to get involved? We love contributions.
This Week in Rust is openly developed on GitHub. If you find any errors in this week's issue, please submit a PR.
From the Blogosphere
- Announcing Rust 1.2.
- Writing Unsafe and Low-Level Code in Rust.
- Creating a PHP Extension to Rust.
- Objective-C from Rust: objc_msgSend.
- A Simple Web App in Rust, Part 4 -- CLI Option Parsing.
- [video] The Rust Programming Language from Google TechTalks.
New Releases & Project Updates
- Check out the new unofficial German-language Rust forums.
- rust-cpp. Embed C++ directly inside your rust code.
- rustty. A terminal UI library.
- coalesce-rs. Combine disjoint types that share common traits.
- mdBook. Create a book from markdown files.
- Serde 0.5.0 adds support for bincode.
- Cargo Crusader 0.1. A tool for validating changes to APIs prior to publishing.
New Contributors
- Ivan Jager
- Jan Likar
- Marko Lalic
- Matt Friedman
- Mike Marcacci
- Ruby
- Tim Neumann
Subteam reports
Every week The Rust Team release a report on what is going on in their corner of the project. Here are the highlights from this week's report.
Libs team
First off, we had a great RustCamp last weekend! As many of us were involved with the event, it was a bit of a slow week.
Decisions from last week:
- RFC PR #1184: RFC: Stabilize the #![no_std] attribute
- Merged
- RFC PR #1183: RFC: Allow changing the default allocator
- Merged
- RFC PR #770: io error handling design
- Closed
- RFC PR #980: read_exact
- Merged
- RFC PR #1194: RFC: Add item recovery collection APIs
- To be merged, pending last bits of bikeshedding
- PR #26818: Stabilize duration (with renamings)
- Merge, need to decide about 1.3 backport
We'd like to call attention to the following two policy RFCs:
- PR #1242: RFC: policy for rust-lang crates
- PR #1224: Update the RFC process with sub-teams, amongst other things.
as well as an RFC relating to catch_panic
and exception safety in Rust:
- PR #1236: RFC: Stabilize catch_panic
This week's RFCs going into (or staying in) final comment period:
- FCP PR #1195: ordered query API
- FCP PR #1192: RFC for inclusive ranges with ...
Lang team
The following RFCs are being promoted to final comment period:
- PR #886: Permit
#[must_use]
attributes on functions as well as types. This allows for functions whose return value should not be ignored even if the type of that value is unexceptional (e.g., theok()
method ofResult
). - PR #890: Custom
preludes. This RFC proposes an extension that allows crates to
define their own preludes. This can be used to have common names
available throughout a crate without forcing them to be explicitly
imported everywhere. This is particularly useful when combined with
the convention of having external crates define a
pub mod prelude
that downstream crates can import into their own local preludes. While clearly convenient, there were some concerns raised that this will give rise to multiple dialects of Rust. - PR #953: This defines
traits to support
+=
and other operators, closing a gap in our operator overloading support. The traits take the LHS via an&mut
reference to permit in-place updates, take the RHS by value, and do not require that theAdd
trait also be implemented. - PR #1135: This PR
permits raw fat pointers (e.g.,
*[i32]
or*Trait
) to be compared, just like raw thin pointer (e.g.,*i32
). The semantics are to compare both the pointer itself and any accompanying data (e.g., the length of the slice). - PR #1189: This PR simply corrects typos.
The following two RFCs have been accepted:
- PR #1214: Clarify (and improve) rules for projections and well-formedness.
- PR #1219: Allow aliasing imports when importing as a group.
In addition, I would like to call attention to the following RFC:
- PR #1238: Nonparametric dropck. This RFC simplifies the dropck rules to close some soundness holes and make room for specialization. The change is expected to cause little to no breakage in practice, e.g., a crater run found no affected crates, but it nonetheless affects a core component of the language.
Compiler team
@arielb1 opened
PR #27551, which
changes how structs and enums are represented in the compiler,
replacing various hashtables with a single AdtDef
struct. This is a
reimplementation of a similar PR by @aatch. In addition to cleaner
code, it results in a small performance boost (approximately 5%).
There has been some progress towards removing drop flags. @pnkfelix landed his "nonzeroing move hints" branch (PR #26173). Unfortunately, some critical bugs were found shortly thereafter. The fix (PR #27413) is not yet ready.
Upcoming Events
- 8/10. Seattle.
- 8/11. San Diego.
- 8/18. Sydney.
- 8/19. Los Angeles.
- 8/20. Berlin.
- 8/26. Columbus Rust Society.
- 8/31. Paris.
If you are running a Rust event please add it to the calendar to get it mentioned here. Email Erick Tryzelaar or Brian Anderson for access.
fn work(on: RustProject) -> Money
There are some jobs writing Rust! This week's listings:
- Student Research Assistant in Karlsruhe, Germany for embedded development on ARM stm32. Contact Oliver Schneider
Quote of the Week
<bluss> I've tried using unchecked indexing in non-trivial code now a couple of times. It never makes a big difference
<bluss> Profiling shows like 1-2% improvement if that
<bluss> so it's the tightest loops you should worry about, not much more
@bluss knows a few things about micro-optimization.
Thanks to @bluss for the tip. Submit your quotes for next week!.