Hello and welcome to the ninth issue of This Week in Rust. This week brings
the new for
loop, which is very exciting, as well as a bunch of runtime
changes and cleanup.
What's cooking on master
?
Issue churn was +4 this week. A total of 63 PRs were merged (again).
Breaking Changes
- The
for
loop now uses external iterators. This means any code written to use the old internal iterator protocol will no longer work. See the iterator tutorial for more information on how to use it. Related pull requests: #8141, #8184, #8190, #8244. A few uses now requiredo
rather thanfor
because they cannot/have not been implemented in terms of external iterators. unsafe
is no longer allowed for functions inextern
blocks: they are all unsafe.- The
extra::dbg
module has been removed. uint::range
and all its friends have been replaced with an external iterator, that is in the prelude. Code like the following now works:for x in range(0, 10) { println(x.to_str()); }
- The pipes compiler (the thing driving
proto!
) has been removed, as it saw limited use, was very old, and was a significant maintenance burden. PortSet
has been removed from std, as the new scheduler does not support it.- A bunch of old task APIs have been removed, also in preparation for the new schduler.
is_utf8
now rejects overlong encodings.- The iterator adaptors no longer have the Iterator suffix, same with str and vec iterators as well.
newrt changes
A bunch of newrt things landed this week, so it gets its own section.
- Some bugs preventing the arc and sync tests from passing have been fixed.
- The new scheduler now supports the
SingleThreaded
spawn mode. - A bunch of work with task killing has landed.
- Some major TLS changes also landed.
- Tasks can now be named.
select
on newrt pipes has been implemented.
Notable library additions, bugfixes, and cleanup
Map::contains_key
is now a default method implemented in terms ofMap::find
- A
dynamic_lib
segfault has been fixed. - A keyed
HashMap
constructor is now exposed for runtimeless programs that want to use it. - The
Str
trait now has aninto_owned
method to avoid copies when you already have a~str
. - A bunch of SHA1 and SHA2 cleanup/optimizations landed. I hear that the speed is almost optimal, only a few cycles/byte short of Intel's optimized implementation.
- Errno coverage has been significantly expanded for Linux. I added all of the ones that were missing, at least the ones that were present on my system.
assert!()
without a message now does less allocation.- '\' is no longer treated as a path separater on POSIX system.
getopt
'sopts_str
has been corrected to use more than just the first element of the vector.- Some more methods were added in
std::num
. - An iterator over the offsets of each character in a string was added.
- A bunch of
RandomAccessIterator
implementations have been added. Clone
andDeepClone
are now implemented forextern "Rust" fn
.
Notable compiler additions, bugfixes, and cleanup
- A
cfg!
syntax extension has been added for conditionally running code based on crate configuration, similar to what#[cfg]
does for conditional compilation. It expands into a true/false constant, so LLVM should optimize out the dead branches. - Some more codegen tests have been added.
copy
has been removed as a keyword.- Static struct initializers can now contain
..base
for functional update. - Take glue has been unified for unique pointer type.
- Pointer arithmetic is now implemented with GEP rather than casting to int and back to the pointer.
- Some more AST types were renamed.
- Cross-crate conditions now work.
Documentation, tools, and other stuff
- LLVM assertions can now be disabled with a configure option.
- Benchmarking can now be
disabled by passing
NO_BENCH=1
to make. NO_REBUILD
no longer requires a re-boostrap, which should make debug cycles on libstd much shorter.vec
now has module documentation.- rustpkg now handles tags, and not just version numbers, in the package ID.
Meetings
The Tuesday meeting this week was quite meaty. I'm not going to try to summarize it, as it seems no real decisions were made.
Discussion + Blog posts
- Visibility scopes in Rust Debug Info.
- Architecting Servo: Pipelines and Parallelism, a talk by Tim Kuehn.
- Runtimeless sprocketnes.
- Porting machine learning algorithms to Rust.
- RFC: Overloadable dereference operator.
External projects
- RustGnuplot was updated to latest Rust.
- A protobuf implementation has been started.
- rustsqlite has been updated to latest Rust.
- A library for HTML escaping has been created.
- A library for procedurally generating noise has been created.
- A pure-Rust implementation of Keccak has been created.
- rust-zmq has been updated to latest Rust, as well as cleaner error/constant interface.
- q3 now does multithreaded rendering.