Welcome to another issue of This Week in Rust, a weekly newsletter summarizing Rust's progress and community activity. As always, if you have something you'd like to be featured, just send me an email.
Last week was very slow, but this week more than makes up for it I think! Static linking landed, and there's been some nice cleanup of error messages and various APIs.
What's cooking on master?
59 PRs were merged this week.
Breaking Changes
- Names of methods creating iterators have changed
drastically to remove the
_iter
suffix. This reflects that iterators are a primary focus of APIs. The PR description has all of the changes summarized. - We now have static linking
support! It does, however,
involve some changes with how the
link
attribute works. The error messages should guide you to the fixes. - In preparation for the placement new changes, the
Path
constructor has been renamed fromnew
toinit
,. - Some overly-permissive borrow checking for
&mut &mut
has been fixed. This is fairly obscure, most code shouldn't have hit it. - The parser is more strict
about what it accepts as a doc comment. Now, only
///
and/**
are counted as introducing doc comments (previously,////
and/***
would also introduce a doc comment). std::{uint, int}::{min, max}
have been removed. They were identical to the functions instd::cmp
, so use those instead.extra::json
has been rid of @ boxes, and now uses idiomatic constructor names.- The
type_id
intrinsic now uses a language item as its return value. - Some cleanup has been done to
std::rt::thread
, which is an interface to native threads (rather than tasks). do
blocks are no longer allowed in non-proc
contexts. This means thatdo
can not be used with a function whose last argument is not aproc
. A fairly large thread on the mailing list is ongoing about this change.LittleLock
now uses RAII.- C-like enums are now represented as an integer rather than a struct, at the LLVM level. This affects ABI.
- Linked failure has been removed from the runtime.
extra::term
no longer uses@mut Writer
, instead taking the writer to use by value.
Other changes
RefCell<T>
, previously known asMut<T>
, has finally landed, for all your dynamic borrow checking needs.- A lint for unknown attributes has finally been added. The compiler will now warn when it sees an attribute it doesn't recognize.
- A lock-free Chase-Lev deque has been added to the runtime.
- The shootout-spectralnorm benchmark has been resurrected.
- Unknown feature gates are now linted, rather than being a hard failure.
- The AST is now frozen!
GenericPort
now has an iterator over the messages it receives.NodeId
,CrateNum
,Name
, andMrk
(types in libsyntax) have been shrunk to 32 bits.- The restriction on macros expanding to a single item has been lifted. This obviates the need for macros hackily expanding to a module containing the desired items. Do note that this only works when the macro is in "item position", or where an item is expected. There is an issue open for lifting this restriction.
- A
thread_local
attribute has been added, which exposes a platform's native TLS, a la C11/C++11thread_local
. - Cross compilation to win64 (via mingw-w64) is now supported. There were also a bunch of fixes on real win64.
- The parser gives a better error message when it encounters an unclosed delimiter it didn't expect.
- There is a better error
message when a module name is
used as a type (the motivating example being
impl SomeTrait for some_module
). - JSON decoding now gives better errors.
- Linker optimizations are now used on Linux.
New contributors
Our first-time contributors this week are:
- Andreas Ots
- Eric Biggers
- Jannis Harder
- Kiet Tran
Weekly Meeting
The weekly
meeting
discussed bootstrap times, the thread_local
PR, mutexes, and the GC. In
particular, it was decided that we should have nightlies.
This Week in Servo
Servo is a web browser engine written in Rust and is one of the primary test cases for the Rust language.
This was a short week due to the US Thanksgiving holiday, but there were still 17 landed PRs this week.
Notable additions
- Hyunjune Kim and Sammy Kim landed some border style extensions in #1276.
- Youngmin Yoo, Seonghyun Kim, and Jaemin Moon landed overflow:hidden in #1298.
- Isabelle Carter landed changing the unrendered portion of content to use the doc's background color in #1210.
- Patrick Walton has been experimenting with some very promising parallel layout work, which he described in a message to the mailing list.
Meetings
This week's meeting covered the poor situation with Nvidia support on Linux, fleshed out the string interning plan during CSS selector parsing/matching, and went into some Servo and Rust-related build issues.
Announcements etc
Do note that all the links are pulled directly from the subreddit.
- Matrix Multiply Performance in Rust
- nrays - a 3d/4d raytracer
- SprocketNES: Practical Systems Programming in Rust. Contrary to the title, this is actually a recording of the presentations at the Bay Area meetup.
- uutils - an attempt at writing universal (as in cross-platform) CLI utils in Rust
- lbac - a Rust port of Jack Crenshaw's "Let's Build a Compiler"