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 a pull request. 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.
Updates from Rust Community
News & Blog Posts
- Writing an OS in Rust: Introduction to paging.
- Librsvg is almost rustified now.
- Understanding Rust lifetimes.
- const types, traits and implementations in Rust.
- Generate Rust tests from data files.
- The evolution of a Rust programmer.
#Rust2019
Find all #Rust2019 posts at Read Rust.
Crate of the Week
This week's crate is ropey, an editable text buffer data structure. Thanks to Vikrant Chaudhary for the suggestion!
Submit your suggestions and votes for next week!
Call for Participation
Always wanted to contribute to open-source projects but didn't know where to start? Every week we highlight some tasks from the Rust community for you to pick and get started!
Some of these tasks may also have mentors available, visit the task page for more information.
- [easy] Mundane: Rename
Signature::verify
tois_valid
. - [easy] Crater: Test Clippy lint.
- Review source code of yaserde: Yet another serializer/deserializer.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from Rust Core
189 pull requests were merged in the last week
- add miri to rustup
- fix undefined behavior
- resolve: mark extern crate items as used in more cases
- clarify resolve typo suggestion
- privacy: fix private-in-public check for existential types
- tweak output of type mismatch between "then" and
else
if
arms - use structured suggestion when casting a reference
- use structured suggestions for nonstandard style lints
- point at match discriminant on type error in match arm pattern
- const-stabilize
const_int_ops
+const_ip
- don't actually create a full MIR stack frame when not needed
- speed up item_bodies for large match statements involving regions
- change
String
to&'static str
inParseResult::Failure
- parallelize and optimize parts of HIR map creation
- stabilize cfg_target_vendor
- stabilize cfg_attr_multi
- stabilize core::convert::identity
- stabilize
let
bindings and destructuring in constants and const fn - clean up and optimize OpenTask / read_index
- NLL: add union justifications to conflicting borrows
- fix and optimize query profiling
- make
TokenStream
less recursive - replace LockCell with atomic types
- make more passes incremental
- librustc_mir: fix ICE with slice patterns
- don't unwrap unexpected tokens in
format!
- stabilize
uniform_paths
- stabilize irrefutable if-let and while-let patterns
- stabilize
if_while_or_patterns
- std: render large exit codes as hex on Windows
- add
#[must_use]
toIterator
andFuture
- std: force
Instant::now()
to be monotonic - optimise floating point
is_finite
(2x) andis_infinite
(1.6x) cargo --
{example
,bin
,bench
,test
} with no argument now lists all available targets- rustup: fix
utils::copy_file
for symlink - rustdoc: allow inlining of reexported crates and crate items
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation this week:
No RFCs were approved this week.
Final Comment Period
Every week the team announces the 'final comment period' for RFCs and key PRs which are reaching a decision. Express your opinions now.
RFCs
- [disposition: close] Using enums like traits.
- [disposition: close] Local
loop
bindings. - [disposition: close] Item-level blocks (was: Item-level scopes).
Tracking Issues & PRs
- [disposition: merge] Add signed num::NonZeroI* types.
- [disposition: merge] Stabilize extern_crate_self.
- [disposition: merge] Stabilize the
integer_atomics
feature: Atomic{I,U}{8,16,32,64}.
New RFCs
Upcoming Events
Online
Asia
Europe
- Jan 20. St.Petersburg, RU - St. Petersburg Rust Meetup.
- Jan 22. Lyon, FR - TupperRust.
- Jan 23. Berlin, DE - Berlin Rust Hack and Learn.
- Jan 24. Hamburg, DE - Rust Hack & Learn Hamburg.
- Jan 24. Frankfurt, DE - How to Start in Embedded Rust.
- Jan 30. Toulouse, FR - Rust Toulouse.
North America
- Jan 16. Ciudad de México, MX - Rust MX: primera reunión del 2019.
- Jan 20. Mountain View, US - Rust Dev in Mountain View!.
- Jan 23. Ann Arbor, US - Ann Arbor Rust Meetup.
- Jan 23. Vancouver, CA - Vancouver Rust meetup.
- Jan 28. North Carolina, US - Triangle Rustaceans.
- Jan 30. Chicago, US - Chicago Rust Meetup - Property-Based Testing in Rust.
If you are running a Rust event please add it to the calendar to get it mentioned here. Please remember to add a link to the event too. Email the Rust Community Team for access.
Rust Jobs
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
Right. I've never even used this impl, but my first thought upon seeing the question "I have an
Iterator
ofX
and need aY
" was to look at theFromIterator
impls ofY
.If that impl didn't exist, I'd then look for the following:
- Other
FromIterator<X>
impls forString
to see if any of thoseX
can easily be produced fromchar
(and then I would callmap
before.collect()
).impl FromIterator<char> for Vec<u8>
. If this existed I would useString::from_utf8(iterator.collect())
.impl Add<char> for String
. If this existed, I would use.fold(String::new(), |s, c| s + c)
- methods of char to see if there's anything that lets you obtain the UTF8 bytes. Indeed, there is
encode_utf8
, which even gives a&mut str
, so one can writerust .fold(String::new(), |s, c| { let mut buffer = [u8; 4]; s += &*c.encode_utf8(&mut buffer); s })
- idly check the inherent methods of
String
for whatever pops out at meand if I could still find nothing after all of that I'd slam my head into a wall somewhere.
– Michael Lamparski on rust-users
Thanks to Cauê Baasch De Souza for the suggestion!
Please submit your quotes for next week!
This Week in Rust is edited by: nasa42, llogiq, and Flavsditz.