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
- RustConf 2017 tickets are now available.
- encoding_rs, a new character encoding conversion library written in Rust, has landed in nightly Firefox.
- Bugs you'll probably only have in Rust.
- Why not to use Rust.
- Algorithms cookbook in Rust.
- Implementing cooperative multitasking in Rust.
- Switching from C++ to Rust.
- Graphics by squares: a gfx-rs tutorial.
- Rustfmt releases. There are some significant changes happening to Rustfmt. Here is what you need to know.
- System programming in Rust: beyond safety.
- Writing a LALR(1) parser generator in Rust.
- hyper v0.11 is released.
- This week in Redox 22.
- This week in Servo 104.
Crate of the Week
This week's crate is include_dir, a crate that lets you include entire directory contents in your binary – like include_str!
, but on steroids. Thanks to Michael Bryan 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] rust: Guard types should implement more traits.
- walkdir: Add Error docs to methods that return Result.
- walkdir: Default to generating constified enums, rather than generating Rust enums.
- walkdir: Change OsString args in sort_by to OsStr.
- walkdir: Remove re-export of is_same_file.
- walkdir: Document why unwraps won't fail.
- walkdir: Make skip_current_dir and filter_entry inherent methods.
- walkdir: Link references to std in docs.
- walkdir: Add build badges to Cargo.toml.
- walkdir: Implement Debug for WalkDir, Iter and IterFilterEntry.
- walkdir: Correct errors in WalkDir type docs.
- walkdir: Document that
Iter
andIterFilterEntry
are the result of trait methods. - walkdir: Add links to other walkdir items in WalkDirIterator docs.
- walkdir: Add links to other walkdir items in Iter and IterFilterEntry docs.
- walkdir: Add links to other walkdir items in DirEntry docs.
- walkdir: Add example for content_first.
- rust-cookbook: Use
filter_entry
in walkdir examples. - [easy] rust-bindgen: Default to generating constified enums, rather than generating Rust enums.
- [less-easy] rust-bindgen: Rewrite
is_unsized
as either a graph traversal or fix-point analysis. - [less-easy] rust-bindgen: Rewrite
can_derive_debug
as either a graph traversal or fix-point analysis. - [less-easy] rust-bindgen: Rewrite
can_derive_copy[_in_array]
as either a graph traversal or fix-point analysis. - [less-easy] rust-bindgen: Rewrite
has_vtable
checks as either graph traversal or fix-point analysis.
If you are a Rust project owner and are looking for contributors, please submit tasks here.
Updates from Rust Core
122 pull requests were merged in the last week.
- overflow-check
str
index by inclusive (...
) ranges - float
min
/max
is now pure Rust Ord::
{min
,max
}- allocation-less
Display
forPath
andOsStr
- suggest
==
on inadvertent assignment inif
conditions - omit trait errors implied by other errors
- save-analysis is now JSON only
collections
is back- fix type inference ICE due to missing obligations
- fix fn pointer coercion ICE
- use custom cargo/rustc paths when parsing flags
- cargo stores API tokens in separate, user-private file
New Contributors
- Marco Castelluccio
- Thomas Lively
- Wonwoo Choi
Approved RFCs
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation 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. This week's FCPs are:
- [disposition: postpone] Allow
extern crate
to take a list of crates. - [disposition: merge] Stabilize drop order.
- [disposition: merge] Specify
#[repr(transparent)]
. - [disposition: merge] Conversions from
&mut T
to&Cell<T>
. - [disposition: merge] Tiered browser support policy for Rust's web content.
New RFCs
- Experimentally add coroutines to Rust.
- Add a try_with method to LocalKey, replacing the existing but unstable state method
Style RFCs
Style RFCs are part of the process for deciding on style guidelines for the Rust community and defaults for Rustfmt. The process is similar to the RFC process, but we try to reach rough consensus on issues (including a final comment period) before progressing to PRs. Just like the RFC process, all users are welcome to comment and submit RFCs. If you want to help decide what Rust code should look like, come get involved!
We're making good progress and the style is coming together. If you want to see the style in practice, check out our example or use the Integer32 Playground and select 'Proposed RFC' from the 'Format' menu. Be aware that implementation is work in progress.
Issues in final comment period:
- [macro_use] on the same line as crate
- trait bounds
- Specify rules for breaking long
where
conditions - Single-line
where
- Combining openings and closings
Good first issues:
We're happy to mentor these, please reach out to us in #rust-style if you'd like to get involved
Upcoming Events
- Jun 21. Rust Meetup Dresden.
- Jun 21. Rust Community Team Meeting at #rust-community on irc.mozilla.org.
- Jun 21. Rust Documentation Team Meeting at #rust-docs on irc.mozilla.org.
- Jun 24. RainOfRust Camp Ahmedabad, Gujarat.
- Jun 24. Rust Workshop Bangalore - Rain of Rust.
- Jun 27. Rust Zurich - June Meetup.
- Jun 27. Cambridge Rust Meetup.
- Jun 27. Let's Rust - Hyderabad.
- Jun 27. RainOfRust Camp Patan, Gujarat.
- Jun 28. Boston Rust - Tutorial Bug-fixing Hackathon.
- Jun 28. OpenTechSchool Berlin - Rust Hack and Learn.
- Jun 28. Rust Community Team Meeting at #rust-community on irc.mozilla.org.
- Jun 28. Rust Documentation Team Meeting at #rust-docs on irc.mozilla.org.
- Jun 29. Rust release triage.
- Jun 29. Rust Durham, NC - Welcome to Rust! Introductions and Lightning Talks.
- Jun 3. Rust Prague Meetup.
- Jul 4. Rust Utrecht - Rust Workshop.
- Jul 5. Rust Atlanta - Grab a beer with fellow Rustaceans.
- Jul 5. Rust Community Team Meeting at #rust-community on irc.mozilla.org.
- Jul 5. Rust Documentation Team Meeting at #rust-docs on irc.mozilla.org.
If you are running a Rust event please add it to the calendar to get it mentioned here. Email the Rust Community Team for access.
Rust Jobs
- Senior Research Engineer - Servo at Mozilla.
- Tor: Summer 2017 Internship to Create a Bridge Bandwidth Scanner.
- Student Research Assistant for developing Clippy in Karlsruhe (contact oliver.schneider \at kit.edu).
Tweet us at @ThisWeekInRust to get your job offers listed here!
Quote of the Week
impl<T> Clone for T { fn clone(&self) -> T { unsafe { std::ptr::read(self) } } }
Thanks to llogiq for the suggestion.