Hello and welcome to another issue of This Week in Rust! Rust is a programming language empowering everyone to build reliable and efficient software. 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.
This week's crate is rustc_codegen_nvvm, a rustc codegen backend that targets NVIDIA's libnvvm CUDA library.
Thanks to troiganto for the suggestion!
Please submit your suggestions and votes for next week!
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.
Artichoke
mezzaluna_feature_loader::LoadedFeatures::shrink_to
artichoke_backend::module::Registry::shrink_to
artichoke_backend::class::Registry::shrink_to
Ockam
If you are a Rust project owner and are looking for contributors, please submit tasks here.
284 pull requests were merged in the last week
-Z strip
as -C strip
for
loop desugar#[must_use]
use on async fn's&str.chars()
on attempt to &str.iter()
await
in more situations where infer types are involvedManuallyDrop
suggestionTraitRef
s when emitting suggestionsimpl Hash for ObligationCauseData
by not hashing ObligationCauseCode
variant fieldsf32
/f64
const
str
conversion and related functions const
<*const _>::align_offset
and <*mut _>::align_offset
as const fn
Arc::from_inner
/ Rc::from_inner
as unsafe
File::options
Vec::retain_mut
Termination
for Result<Infallible, E>
clone_from
for State
Log
implementation for &impl Log
and Arc<impl Log>
--message-format
for install
commandoctal_escapes
suboptimal_flops
in const
functionsdoc-markdown
no_effect
warning on unit structs implementing fn_once
undocumented_unsafe_blocks
manual_map
with unsafe functionsneedless_collect
's tendency to suggest code requiring multiple mutable borrows of the same value.manual_split_once
suggestion and add new lint needless_splitn
shadow_same
false positives for async function argumentsneedless_borrow
lintoption_map_or_none
This week, there were a number of cases where the incr-unchanged
variants of inflate
went up or down by 5% to 6%; we believe these are instances of increased noise in benchmarks documented on rustc-perf#1105. I was tempted to remove these from the report, but its non-trivial to re-construct the report "as if" some benchmark were omitted.
Otherwise, there were some nice wins for performance. For example, PR #90996 more than halved the time to document builds of diesel
by revising how we hash ObligationCauseData
. If anyone is interested, it might be good to follow-up on the effects of PR #90352, "Simplify for
loop desugar", where we have hypothesized that the increased compilation time is due to more LLVM optimizations being applied.
Triage done by @pnkfelix. Revision range: 934624fe..22c2d9dd
1 Regressions, 3 Improvements, 8 Mixed; 3 of them in rollups 34 comparisons made in total
Changes to Rust follow the Rust RFC (request for comments) process. These are the RFCs that were approved for implementation this week:
Every week the team announces the 'final comment period' for RFCs and key PRs which are reaching a decision. Express your opinions now.
Rusty Events between 11/24-12/08 🦀
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.
StackBlitz
Elektron
tangram
Kraken
Maasa Labs
Tweet us at @ThisWeekInRust to get your job offers listed here!
On the topic of reframing UB, I was reminded of an article about the mechanics of oaths and vows in historical cultures.
When a programmer writes
get_unchecked
, we can imagine them wanting to promise the compiler that they uphold its preconditions. But since the compiler is normally not so trusting of unproven assertions, the programmer swears an oath that their argument is in bounds.The compiler, seeing such a solemn commitment, treats the programmer's word as true and optimizes accordingly. The compiler is so thoroughly convinced that it never even entertains the possibility of doubting the programmer's oath.
But if the programmer has sworn falsely, then they might well suffer divine retribution in the form of nasal demons — or worse, subtly baffling program behaviour.
Thanks to G. Thorondorsen for the suggestion!
Please submit quotes and vote for next week!
This Week in Rust is edited by: nellshamrell, llogiq, cdmistman, ericseppanen, extrawurst, andrewpollack, U007D, kolharsam, joelmarcey, marriannegoldin.
Email list hosting is sponsored by The Rust Foundation