commit 0f47d47cc86053c26d690ab0f258d0311ff86403
parent 4ddc2ceee94de5df966a6c77103aa845b6a0e257
Author: lash <dev@holbrook.no>
Date: Sun, 30 Jun 2024 23:48:37 +0100
Add second feed to test
Diffstat:
3 files changed, 1055 insertions(+), 6 deletions(-)
diff --git a/src/lib.rs b/src/lib.rs
@@ -8,10 +8,12 @@ use rs_sha512::Sha512Hasher;
use chrono::DateTime;
mod io;
+
pub struct Sequencer {
pub items: HashMap<u64, Vec<u8>>,
item_keys: Vec<u64>,
crsr: usize,
+ limit: usize,
}
pub struct SequencerEntry {
@@ -24,7 +26,8 @@ impl Sequencer {
Sequencer {
items: HashMap::new(),
crsr: 0,
- item_keys: Vec::<u64>::new(),
+ limit: 0,
+ item_keys: Vec::new(),
}
}
@@ -37,7 +40,7 @@ impl Sequencer {
return true;
}
- pub fn add_all(&mut self, feed: Feed) -> i64 {
+ pub fn add_from(&mut self, feed: Feed) -> i64 {
let mut c: i64;
c = 0;
@@ -55,7 +58,26 @@ impl Iterator for Sequencer {
fn next(&mut self) -> Option<Self::Item> {
let c: u64;
+ if self.limit == 0 {
+ self.item_keys = Vec::new();
+ for k in self.items.keys() {
+ self.item_keys.push(k.clone());
+ self.limit += 1;
+ }
+ }
+
+ if self.limit == 0 {
+ return None;
+ }
+
+ if self.crsr == self.limit {
+ self.limit = 0;
+ self.crsr = 0;
+ return None;
+ }
+
c = self.item_keys[self.crsr];
+ self.crsr += 1;
return Some(self.items[&c].clone());
}
}
diff --git a/src/tests.rs b/src/tests.rs
@@ -1,12 +1,15 @@
-use super::Sequencer;
+use std::clone::Clone;
+
use feed_rs::model::Entry;
-use super::io::FeedGet;
use chrono::DateTime;
-use chrono::offset::Utc;
+
+use super::Sequencer;
+use super::io::FeedGet;
#[cfg(feature = "fs")]
use super::io::fs::Fs;
+
#[test]
fn test_entry_guard() {
let mut r: bool;
@@ -49,6 +52,22 @@ fn test_feed_all() {
let fs = Fs{};
let feed = fs.get("testdata/test.atom.xml", None).unwrap();
let mut seq = Sequencer::new();
- r = seq.add_all(feed);
+ r = seq.add_from(feed);
+ assert_eq!(r, 15);
+}
+
+#[test]
+#[cfg(feature = "fs")]
+fn test_feed_mix() {
+ let mut r: i64;
+ let fs = Fs{};
+ let mut feed = fs.get("testdata/test.atom.xml", None).unwrap();
+ let mut seq = Sequencer::new();
+ r = seq.add_from(feed);
assert_eq!(r, 15);
+ feed = fs.get("testdata/test2.xml", None).unwrap();
+ r = seq.add_from(feed);
+ assert_eq!(r, 10);
+ assert_eq!(seq.by_ref().count(), 25);
+ assert_eq!(seq.count(), 25);
}
diff --git a/testdata/test2.xml b/testdata/test2.xml
@@ -0,0 +1,1008 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
+ <generator uri="https://blog.rust-lang.org/" version="0.1.0">Rust Blog</generator>
+ <link href="https://blog.rust-lang.org/feed.xml" rel="self" type="application/atom+xml" />
+ <link href="https://blog.rust-lang.org/" rel="alternate" type="text/html" />
+ <id>https://blog.rust-lang.org/</id>
+ <title>Rust Blog</title>
+ <subtitle>Empowering everyone to build reliable and efficient software.</subtitle>
+ <author>
+ <name>Maintained by the Rust Teams.</name>
+ <uri>https://github.com/rust-lang/blog.rust-lang.org/</uri>
+ </author>
+ <updated>2024-06-26T23:17:01+00:00</updated>
+
+ <entry>
+ <title>Types Team Update and Roadmap</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/06/26/types-team-update.html" type="text/html" title="Types Team Update and Roadmap" />
+ <published>2024-06-26T00:00:00+00:00</published>
+ <updated>2024-06-26T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/06/26/types-team-update.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/06/26/types-team-update.html"><p>It has been more than a year since <a href="https://blog.rust-lang.org/2023/01/20/types-announcement.html">the initial blog post</a> announcing the Types team, and our initial set of goals. For details on what the team is, why it was formed, or our previously-stated overarching goals, go check out that blog post. In short the Types team's purview extends to the parts of the Rust language and compiler that involve the type system, e.g. type checking, trait solving, and borrow checking. Our short and long term goals effectively work to make the type system sound, consistent, extensible, and fast.</p>
+<p>Before getting into details, it's worth sharing a quick point: the team over the last year has been very successful. Oftentimes, it's hard to measure impact, particularly when long-term roadmap goals are hard to quantify progress on and various short-term goals either are hit or aren't. But, there is one clear statistic that is somewhat indicative of the team's progress: over the last year or so, <a href="https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3AT-types+label%3Adisposition-merge+is%3Amerged+closed%3A%3E2023-01-20+sort%3Acreated-asc+">more than 50 user-facing changes</a> have landed, each separately approved by Types Team consensus through FCP.</p>
+<p>The changes lie at the boundary between language design and implementation, and the Types Team (which is a subteam of both the Language and Compiler Teams) existing means that not only does the Rust Project have the bandwidth to make these decisions but we also have enough people with the knowledge and experience of the type system to make informed decisions that overall make the language better.</p>
+<h2><a href="#the-priorities-of-the-types-team" aria-hidden="true" class="anchor" id="the-priorities-of-the-types-team"></a>The priorities of the types team</h2>
+<p>To evaluate our progress over the last year and our roadmap going forward,
+lets start with our main priorities in order of importance. We will refer
+to them during the remainder of this post. To reach our goals, we need a
+a healthy group of maintainers which have the expertise and capacity to
+react to issues and to implement complex changes.</p>
+<h3><a href="#the-type-system-should-be-sound" aria-hidden="true" class="anchor" id="the-type-system-should-be-sound"></a>The type system should be Sound</h3>
+<p>One of the main promises of Rust is that there cannot be undefined behavior when using
+only safe code. It might surprise you that there are currently <a href="https://github.com/orgs/rust-lang/projects/44/views/1">known type system
+bugs</a> which break these guarantees. Most of these issues were found by people familiar with
+the inner workings of the compiler by explicitly looking for them and we generally do not expect
+users to encounter these bugs by accident. Regardless, we deeply care about fixing them
+and are working towards a fully sound and ideally verified type system.</p>
+<h3><a href="#the-type-system-should-be-consistent" aria-hidden="true" class="anchor" id="the-type-system-should-be-consistent"></a>The type system should be Consistent</h3>
+<p>The type system should be easy to reason about. We should avoid rough edges and
+special-cases if possible. We want to keep both the implementation and user-facing behavior
+as simple as possible. Where possible we want to consider the overall design instead of
+providing local targeted fixes. This is necessary to build trust in the soundness of the
+type system and allows for a simpler mental model of Rust.</p>
+<h3><a href="#the-type-system-should-be-extensible" aria-hidden="true" class="anchor" id="the-type-system-should-be-extensible"></a>The type system should be Extensible</h3>
+<p>Rust is still evolving and we will be required to extend the type system to enable new
+language features going forward. This requires the type system to be extensible and
+approachable. The design of the language should not be adapted to work around
+short-comings of its current type system implementation. We should collaborate with
+other teams and users to make sure we're aware of their problems and consider possible
+future extensions in our implementation and design.</p>
+<h3><a href="#the-type-system-should-be-fast" aria-hidden="true" class="anchor" id="the-type-system-should-be-fast"></a>The type system should be Fast</h3>
+<p>We care about the compile times of Rust and want to consider the impact on compile times
+of our designs. We should look for effective approaches to speed up the existing implementation,
+by improving caching or adding fast paths where applicable. We should also be aware of the
+compile time impact of future additions to the type system and suggest more performant
+solutions where possible.</p>
+<h2><a href="#updates" aria-hidden="true" class="anchor" id="updates"></a>Updates</h2>
+<p>We have been very active over the last year and made some significant progress. There
+are also a few non-technical updates we would like to share.</p>
+<h2><a href="#organizational-updates" aria-hidden="true" class="anchor" id="organizational-updates"></a>Organizational updates</h2>
+<p>First, a huge welcome to the two new members to team since the announcement post: <a href="https://github.com/boxyuwu">@BoxyUwU</a> and <a href="https://github.com/aliemjay">@aliemjay</a>. <a href="https://github.com/boxyuwu">@BoxyUwU</a> has been doing a lot of work on const generics and made significant contributions to the design of the next generation trait solver. <a href="https://github.com/aliemjay">@aliemjay</a> has been working on some very subtle improvements to opaque types - <code>impl Trait</code> - and to borrow checking. They are both invaluable additions to the team.</p>
+<p>We also organized another in-person Types Team meetup last October, immediately prior to EuroRust. We discussed the state of the team, looked at current implementation challenges and in-progress work, and reviewed and updated <a href="https://blog.rust-lang.org/2023/01/20/types-announcement.html#roadmap">the roadmap from the previous meetup</a>. Most of this will be covered in this blog post.</p>
+<p>Finally, as discussed in the <a href="https://rust-lang.github.io/rfcs/3254-types-team.html">RFC</a>, we would like to have leads rotate out regularly, largely to help share the burden and experience of leads' work. So with that being said, <a href="https://github.com/nikomatsakis">@nikomatsakis</a> is rotating out and <a href="https://github.com/lcnr">@lcnr</a> is joining to co-lead alongside <a href="https://github.com/jackh726/">@jackh726</a>.</p>
+<h2><a href="#roadmap-progress-and-major-milestones" aria-hidden="true" class="anchor" id="roadmap-progress-and-major-milestones"></a>Roadmap progress and major milestones</h2>
+<h3><a href="#the-next-generation-trait-solver" aria-hidden="true" class="anchor" id="the-next-generation-trait-solver"></a>The next-generation trait solver</h3>
+<p>There has been <a href="https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3AWG-trait-system-refactor+-label%3Arollup+is%3Amerged+closed%3A%3E2023-01-20+sort%3Acreated-asc+">a lot of work</a> on the <a href="https://github.com/rust-lang/trait-system-refactor-initiative/">next-generation trait solver</a>.
+The initiative posted <a href="https://blog.rust-lang.org/inside-rust/2023/12/22/trait-system-refactor-initiative.html">a separate update</a> at the end of last year. While
+we would have liked to <a href="https://github.com/rust-lang/rust/pull/121848">stabilize its use in coherence</a> a few months ago,
+this surfaced additional small behavior regressions and hangs, causing delays. We are working on fixing these issues and intend to merge the stabilization PR soon. We are getting close to compiling the standard library
+and the compiler with the new solver enabled everywhere, after which will be able to run
+crater to figure out the remaining issues. We expect there to be a long tail of minor issues
+and behavioral differences from the existing implementation, so there's still a lot to do
+here. There are also open design questions which we will have to resolve before stabilizing
+the new implementation.</p>
+<h3><a href="#async-and-impl-trait" aria-hidden="true" class="anchor" id="async-and-impl-trait"></a>Async and <code>impl Trait</code></h3>
+<p>We stabilized <code>async</code>-fn in traits (AFIT) and return-position <code>impl Trait</code> in
+traits (RPITIT) in version 1.75 thanks to a significant effort by <a href="https://github.com/compiler-errors">@compiler-errors</a> and
+<a href="https://github.com/spastorino">@spastorino</a>. <a href="https://github.com/cjgillot">@cjgillot</a> greatly improved the way generators, and therefore async functions,
+are represented in the type system<sup class="footnote-ref"><a href="#fn-107421" id="fnref-107421" data-footnote-ref>1</a></sup>. This allowed us to support recursive
+<code>async</code>-functions without too much additional work<sup class="footnote-ref"><a href="#fn-117703" id="fnref-117703" data-footnote-ref>2</a></sup>.</p>
+<p>Designing the next-generation trait solver surfaced issues and future-compatibility challenges
+of our type-alias <code>impl Trait</code> (TAIT) implementation using the old trait solver. We are
+currently reworking the design and implementation. <a href="https://github.com/oli-obk">@oli-obk</a> is spear-heading this effort.
+This also impacts RPIT edge-cases, forcing us to be careful to avoid accidental breakage.
+There are some open language design questions for TAIT, so we plan to
+stabilize associated type position <code>impl Trait</code> (ATPIT) as it avoids these language design
+questions while still closing the expressiveness gap.</p>
+<h3><a href="#a-mir-formality" aria-hidden="true" class="anchor" id="a-mir-formality"></a><code>a-mir-formality</code></h3>
+<p>We made limited progress on <a href="https://github.com/rust-lang/a-mir-formality"><code>a-mir-formality</code></a> over the last year, mostly
+because we were able to allocate less time than expected towards this work.
+We have used it as the foundation towards an intuitive approach to
+coinductive traits which are necessary for many of the remaining unsound
+issues.</p>
+<h3><a href="#fixing-soundness-issues" aria-hidden="true" class="anchor" id="fixing-soundness-issues"></a>Fixing soundness issues</h3>
+<p>We fixed multiple long-standing unsound issues, see <a href="https://github.com/rust-lang/rust/issues?q=is%3Aissue+label%3AI-unsound+label%3AT-types+-label%3Arequires-nightly+is%3Aclosed+closed%3A%3C2024-06-20+">the full list of closed issues</a>. The most most notable of which was <a href="https://github.com/rust-lang/rust/issues/80176">#80176</a>. This subtle issue caused us to accept methods in trait implementations whose function signature had outlives requirements not present in the trait definition. These requirements were then never proven when calling the trait method. As there were some crates which relied on this pattern by accident, even if it their usages didn't exploit this unsoundness, we first merged a <a href="https://github.com/rust-lang/rust/issues/105572">future-compatibility lint</a> which we then moved to a hard error after a few versions.</p>
+<p>We've also spent time on <a href="https://github.com/orgs/rust-lang/projects/44/views/1">categorizing the remaining open issues</a> and integrating
+them into our longterm planning. Most of the remaining ones are blocked on the
+next-generation trait solver as fixing them relies on coinductive trait semantics
+and improvements to implied bounds. There are some remaining issues which can be at
+least partially fixed right now, and we intend to work through them as we go.
+Finally, there are some issues for which we still haven't figured out the best
+approach and which require some further considerations.</p>
+<h2><a href="#going-forward" aria-hidden="true" class="anchor" id="going-forward"></a>Going forward</h2>
+<p>We made significant progress during the last year but we are not done! This section covers our goals for the rest of 2024. For each item we also link to the project goals that we have proposed as part of the Rust Project's <a href="https://blog.rust-lang.org/inside-rust/2024/05/07/announcing-project-goals.html">experimental new roadmap process</a>.</p>
+<h3><a href="#-znext-solver" aria-hidden="true" class="anchor" id="-znext-solver"></a><code>-Znext-solver</code></h3>
+<ul>
+<li><a href="https://rust-lang.github.io/rust-project-goals/2024h2/next-solver.html">Next-generation trait solver project goal</a></li>
+</ul>
+<p>Our biggest goal is to use the <a href="https://github.com/rust-lang/trait-system-refactor-initiative/">next-generation trait solver</a>
+everywhere by default and to fully replace the existing implementation. We are currently
+finalizing the stabilization of <a href="https://github.com/rust-lang/rust/pull/121848">its use in coherence checking</a>. This should
+already fix multiple unsound issues and fix a lot of smaller issues and inconsistencies of
+the current implementation. See the stabilization report for more details.</p>
+<p>We are also working on extracting its implementation into a separate library
+outside of the compiler itself. We would like to share the trait solver with
+rust-analyzer by the end of this year. They currently use <a href="https://github.com/rust-lang/chalk/">chalk</a> which is no longer
+actively maintained. Using the next-generation trait solver in rust-analyzer
+should result in a lot of additional testing for the solver while also improving
+the IDE experience by positively impacting performance and correctness.</p>
+<p>We intend to slowly roll out the solver in other areas of the compiler until we're able
+to fully remove the existing implementation by the end of 2025. This switch will fix
+multiple unsound issues by itself and will unblock a significant amount of future work.
+It will generally cleanup many rough edges of the type system, such as associated types
+in higher-ranked types. There are many unsound issues which can only be fixed once we exclusively
+use the new implementation.</p>
+<h3><a href="#a-mir-formality-1" aria-hidden="true" class="anchor" id="a-mir-formality-1"></a><code>a-mir-formality</code></h3>
+<ul>
+<li><a href="https://rust-lang.github.io/rust-project-goals/2024h2/a-mir-formality.html"><code>a-mir-formality</code> project goal</a></li>
+</ul>
+<p>We intend to more actively develop <code>a-mir-formality</code> this year to use it in our design process.
+Using it to model parts of the type system has already been incredibly impactful and we want
+to build on that. We are working on more effective testing of <code>a-mir-formality</code> by enabling its
+use for actual Rust code snippets and by adding fuzzing support. This will allow us to gain
+additional confidence in our model of the type system and will guide its future development.</p>
+<p>We plan to fully formalize some components of the type system this year. Coherence is fairly
+self-contained, very subtle, and soundness-critical. This has prevented us from making significant
+improvements to it in the past. We also intend to formalize coinductive trait semantics, which are
+difficult to reason about and necessary to fix many longstanding soundness issues.</p>
+<h3><a href="#language-changes-and-polonius" aria-hidden="true" class="anchor" id="language-changes-and-polonius"></a>Language changes and polonius</h3>
+<ul>
+<li><a href="https://rust-lang.github.io/rust-project-goals/2024h2/ATPIT.html">Associated Type Position Impl Trait (ATPIT) project goal</a></li>
+<li><a href="https://rust-lang.github.io/rust-project-goals/2024h2/Polonius.html">Polonius on Nightly project goal</a></li>
+</ul>
+<p>We intend to get the internal implementation of opaque types ready for the stabilization
+of TAIT and ATPIT this year. We are also hoping to land significant improvements to our
+handling of associated types in coherence checking this year.</p>
+<p>Our other goal is to get <a href="https://blog.rust-lang.org/inside-rust/2023/10/06/polonius-update.html">Polonius</a>, the next generation borrow checker, available on nightly, which would put us in a position to stabilize in 2025 once we have time to do more optimization and testing.</p>
+<p>We also intend to support the development of other language features, such as <code>async</code>-closures, which are part of the <a href="https://rust-lang.github.io/rust-project-goals/2024h2/async.html">async project goal</a>,
+and <code>dyn</code>-trait upcasting, which will hopefully get stabilized in the near future.</p>
+<h2><a href="#roadmap" aria-hidden="true" class="anchor" id="roadmap"></a>Roadmap</h2>
+<h3><a href="#eoy-2024" aria-hidden="true" class="anchor" id="eoy-2024"></a>EOY 2024</h3>
+<ul>
+<li>next-generation trait solver
+<ul>
+<li>stable in coherence</li>
+<li>used by rust-analyzer</li>
+</ul>
+</li>
+<li>ATPIT stabilized</li>
+<li>a-mir-formality
+<ul>
+<li>support for fuzzing and testing Rust snippets</li>
+<li>complete model of coherence and coinductive trait semantics</li>
+</ul>
+</li>
+<li>full polonius implementation available on nightly</li>
+</ul>
+<h3><a href="#eoy-2025" aria-hidden="true" class="anchor" id="eoy-2025"></a>EOY 2025</h3>
+<ul>
+<li>next-generation trait solver used everywhere by default</li>
+<li>TAIT stabilized</li>
+<li>polonius stabilized</li>
+</ul>
+<h2><a href="#eoy-2027" aria-hidden="true" class="anchor" id="eoy-2027"></a>EOY 2027</h2>
+<ul>
+<li>next-generation trait solver
+<ul>
+<li>support for coinduction and (implicit) where-bounds on <code>for&lt;'a&gt;</code></li>
+<li>enable perfect derive</li>
+</ul>
+</li>
+<li>a-mir-formality fully model soundness critical parts of Rust</li>
+<li>all known type system unsoundnesses fixed</li>
+</ul>
+<section class="footnotes" data-footnotes>
+<ol>
+<li id="fn-107421">
+<p>stabilized in <a href="https://github.com/rust-lang/rust/issues/107421">https://github.com/rust-lang/rust/issues/107421</a> <a href="#fnref-107421" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p>
+</li>
+<li id="fn-117703">
+<p>stabilized in <a href="https://github.com/rust-lang/rust/issues/117703">https://github.com/rust-lang/rust/issues/117703</a> <a href="#fnref-117703" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p>
+</li>
+</ol>
+</section>
+</content>
+
+ <author>
+ <name>lcnr</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Announcing Rust 1.79.0</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html" type="text/html" title="Announcing Rust 1.79.0" />
+ <published>2024-06-13T00:00:00+00:00</published>
+ <updated>2024-06-13T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html"><p>The Rust team is happy to announce a new version of Rust, 1.79.0. Rust is a programming language empowering everyone to build reliable and efficient software.</p>
+<p>If you have a previous version of Rust installed via <code>rustup</code>, you can get 1.79.0 with:</p>
+<pre><code class="language-console">$ rustup update stable
+</code></pre>
+<p>If you don't have it already, you can <a href="https://www.rust-lang.org/install.html">get <code>rustup</code></a> from the appropriate page on our website, and check out the <a href="https://doc.rust-lang.org/nightly/releases.html#version-1790-2024-06-13">detailed release notes for 1.79.0</a>.</p>
+<p>If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (<code>rustup default beta</code>) or the nightly channel (<code>rustup default nightly</code>). Please <a href="https://github.com/rust-lang/rust/issues/new/choose">report</a> any bugs you might come across!</p>
+<h2><a href="#whats-in-1790-stable" aria-hidden="true" class="anchor" id="whats-in-1790-stable"></a>What's in 1.79.0 stable</h2>
+<h3><a href="#inline-const-expressions" aria-hidden="true" class="anchor" id="inline-const-expressions"></a>Inline <code>const</code> expressions</h3>
+<p><code>const { ... }</code> blocks are now stable in expression position, permitting
+explicitly entering a const context without requiring extra declarations (e.g.,
+defining <code>const</code> items or associated constants on a trait).</p>
+<p>Unlike const items (<code>const ITEM: ... = ...</code>), inline consts are able to make
+use of in-scope generics, and have their type inferred rather than written explicitly, making them particularly useful for inline code snippets. For example, a pattern like:</p>
+<pre><code class="language-rust">const EMPTY: Option&lt;Vec&lt;u8&gt;&gt; = None;
+let foo = [EMPTY; 100];
+</code></pre>
+<p>can now be written like this:</p>
+<pre><code class="language-rust">let foo = [const { None }; 100];
+</code></pre>
+<p>Notably, this is also true of generic contexts, where previously a verbose trait declaration with an associated constant would be required:</p>
+<pre><code class="language-rust">fn create_none_array&lt;T, const N: usize&gt;() -&gt; [Option&lt;T&gt;; N] {
+ [const { None::&lt;T&gt; }; N]
+}
+</code></pre>
+<p>This makes this code much more succinct and easier to read.</p>
+<p>See the <a href="https://doc.rust-lang.org/nightly/reference/expressions/block-expr.html#const-blocks">reference documentation</a> for details.</p>
+<h3><a href="#bounds-in-associated-type-position" aria-hidden="true" class="anchor" id="bounds-in-associated-type-position"></a>Bounds in associated type position</h3>
+<p>Rust 1.79 stabilizes the associated item bounds syntax, which allows us to put
+bounds in associated type position within other bounds, i.e.
+<code>T: Trait&lt;Assoc: Bounds...&gt;</code>. This avoids the need to provide an extra,
+explicit generic type just to constrain the associated type.</p>
+<p>This feature allows specifying bounds in a few places that previously either
+were not possible or imposed extra, unnecessary constraints on usage:</p>
+<ul>
+<li><strong><code>where</code> clauses</strong> - in this position, this is equivalent to breaking up the bound into two (or more) <code>where</code> clauses. For example, <code>where T: Trait&lt;Assoc: Bound&gt;</code> is equivalent to <code>where T: Trait, &lt;T as Trait&gt;::Assoc: Bound</code>.</li>
+<li><strong>Supertraits</strong> - a bound specified via the new syntax is implied when the trait is used, unlike where clauses. Sample syntax: <code>trait CopyIterator: Iterator&lt;Item: Copy&gt; {}</code>.</li>
+<li><strong>Associated type item bounds</strong> - This allows constraining the <em>nested</em> rigid projections that are associated with a trait's associated types. e.g. <code>trait Trait { type Assoc: Trait2&lt;Assoc2: Copy&gt;; }</code>.</li>
+<li><strong>opaque type bounds (RPIT, TAIT)</strong> - This allows constraining associated types that are associated with the opaque type without having to <em>name</em> the opaque type. For example, <code>impl Iterator&lt;Item: Copy&gt;</code> defines an iterator whose item is <code>Copy</code> without having to actually name that item bound.</li>
+</ul>
+<p>See <a href="https://github.com/rust-lang/rust/pull/122055/#issue-2170532454">the stabilization report</a> for more details.</p>
+<h3><a href="#extending-automatic-temporary-lifetime-extension" aria-hidden="true" class="anchor" id="extending-automatic-temporary-lifetime-extension"></a>Extending automatic temporary lifetime extension</h3>
+<p>Temporaries which are immediately referenced in construction are now
+automatically lifetime extended in <code>match</code> and <code>if</code> constructs. This has the
+same behavior as lifetime extension for temporaries in block constructs.</p>
+<p>For example:</p>
+<pre><code class="language-rust">let a = if true {
+ ..;
+ &amp;temp() // used to error, but now gets lifetime extended
+} else {
+ ..;
+ &amp;temp() // used to error, but now gets lifetime extended
+};
+</code></pre>
+<p>and</p>
+<pre><code class="language-rust">let a = match () {
+ _ =&gt; {
+ ..;
+ &amp;temp() // used to error, but now gets lifetime extended
+ }
+};
+</code></pre>
+<p>are now consistent with prior behavior:</p>
+<pre><code class="language-rust">let a = {
+ ..;
+ &amp;temp() // lifetime is extended
+};
+</code></pre>
+<p>This behavior is backwards compatible since these programs used to fail compilation.</p>
+<h3><a href="#frame-pointers-enabled-in-standard-library-builds" aria-hidden="true" class="anchor" id="frame-pointers-enabled-in-standard-library-builds"></a>Frame pointers enabled in standard library builds</h3>
+<p>The standard library distributed by the Rust project is now compiled with
+<code>-Cforce-frame-pointers=yes</code>, enabling downstream users to more easily profile
+their programs. Note that the standard library also continues to come up with
+line-level debug info (e.g., DWARF), though that is <a href="https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html#enable-strip-in-release-profiles-by-default">stripped by default</a> in Cargo's release profiles.</p>
+<h3><a href="#stabilized-apis" aria-hidden="true" class="anchor" id="stabilized-apis"></a>Stabilized APIs</h3>
+<ul>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_add"><code>{integer}::unchecked_add</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_mul"><code>{integer}::unchecked_mul</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_sub"><code>{integer}::unchecked_sub</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_unchecked"><code>&lt;[T]&gt;::split_at_unchecked</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked"><code>&lt;[T]&gt;::split_at_mut_unchecked</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.slice.html#method.utf8_chunks"><code>&lt;[u8]&gt;::utf8_chunks</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunks.html"><code>str::Utf8Chunks</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunk.html"><code>str::Utf8Chunk</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned"><code>&lt;*const T&gt;::is_aligned</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned-1"><code>&lt;*mut T&gt;::is_aligned</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_aligned"><code>NonNull::is_aligned</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len"><code>&lt;*const [T]&gt;::len</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len-1"><code>&lt;*mut [T]&gt;::len</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty"><code>&lt;*const [T]&gt;::is_empty</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty-1"><code>&lt;*mut [T]&gt;::is_empty</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_empty"><code>NonNull::&lt;[T]&gt;::is_empty</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes"><code>CStr::count_bytes</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.downcast"><code>io::Error::downcast</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/core/num/struct.NonZero.html"><code>num::NonZero&lt;T&gt;</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/path/fn.absolute.html"><code>path::absolute</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.byte_character"><code>proc_macro::Literal::byte_character</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.c_string"><code>proc_macro::Literal::c_string</code></a></li>
+</ul>
+<p>These APIs are now stable in const contexts:</p>
+<ul>
+<li><a href="https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.into_inner"><code>Atomic*::into_inner</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.new"><code>io::Cursor::new</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_ref"><code>io::Cursor::get_ref</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.position"><code>io::Cursor::position</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/fn.empty.html"><code>io::empty</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/fn.repeat.html"><code>io::repeat</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/fn.sink.html"><code>io::sink</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.caller"><code>panic::Location::caller</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file"><code>panic::Location::file</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.line"><code>panic::Location::line</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.column"><code>panic::Location::column</code></a></li>
+</ul>
+<h3><a href="#other-changes" aria-hidden="true" class="anchor" id="other-changes"></a>Other changes</h3>
+<p>Check out everything that changed in <a href="https://github.com/rust-lang/rust/releases/tag/1.79.0">Rust</a>, <a href="https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-179-2024-06-13">Cargo</a>, and <a href="https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-179">Clippy</a>.</p>
+<h2><a href="#contributors-to-1790" aria-hidden="true" class="anchor" id="contributors-to-1790"></a>Contributors to 1.79.0</h2>
+<p>Many people came together to create Rust 1.79.0. We couldn't have done it without all of you. <a href="https://thanks.rust-lang.org/rust/1.79.0/">Thanks!</a></p>
+</content>
+
+ <author>
+ <name>The Rust Release Team</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Faster linking times on nightly on Linux using `rust-lld`</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html" type="text/html" title="Faster linking times on nightly on Linux using `rust-lld`" />
+ <published>2024-05-17T00:00:00+00:00</published>
+ <updated>2024-05-17T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html"><p>TL;DR: rustc will use <code>rust-lld</code> by default on <code>x86_64-unknown-linux-gnu</code> on nightly to
+significantly reduce linking times.</p>
+<h4><a href="#some-context" aria-hidden="true" class="anchor" id="some-context"></a>Some context</h4>
+<p>Linking time is often a big part of compilation time. When rustc needs to build a binary or a shared
+library, it will usually call the default linker installed on the system to do that (this can be
+changed on the command-line or by the target for which the code is compiled).</p>
+<p>The linkers do an important job, with concerns about stability, backwards-compatibility and so on.
+For these and other reasons, on the most popular operating systems they usually are older programs,
+designed when computers only had a single core. So, they usually tend to be slow on a modern
+machine. For example, when building ripgrep 13 in debug mode on Linux, roughly half of the time is
+actually spent in the linker.</p>
+<p>There are different linkers, however, and the usual advice to improve linking times is to use one of
+these newer and faster linkers, like LLVM's <a href="https://lld.llvm.org/"><code>lld</code></a> or Rui Ueyama's
+<a href="https://github.com/rui314/mold"><code>mold</code></a>.</p>
+<p>Some of Rust's wasm and aarch64 targets already use <code>lld</code> by default. When using rustup, rustc ships
+with a version of <code>lld</code> for this purpose. When CI builds LLVM to use in the compiler, it also builds
+the linker and packages it. It's referred to as <code>rust-lld</code> to avoid colliding with any <code>lld</code> already
+installed on the user's machine.</p>
+<p>Since improvements to linking times are substantial, it would be a good default to use in the most
+popular targets. This has been discussed for a long time, for example in issues
+<a href="https://github.com/rust-lang/rust/issues/39915">#39915</a> and
+<a href="https://github.com/rust-lang/rust/issues/71515">#71515</a>, and rustc already offers nightly flags to
+use <code>rust-lld</code>.</p>
+<p>By now, we believe we've done all the internal testing that we could, on CI, crater, and our
+benchmarking infrastructure. We would now like to expand testing and gather real-world feedback and
+use-cases. Therefore, we will enable <code>rust-lld</code> to be the linker used by default on
+<code>x86_64-unknown-linux-gnu</code> for nightly builds.</p>
+<h4><a href="#benefits" aria-hidden="true" class="anchor" id="benefits"></a>Benefits</h4>
+<p>While this also enables the compiler to use more linker features in the future, the most immediate
+benefit is much improved linking times.</p>
+<p>Here are more details from the ripgrep example mentioned above: linking is reduced 7x, resulting in
+a 40% reduction in end-to-end compilation times.</p>
+<p><img src="../../../../images/2024-05-17-enabling-rust-lld-on-linux/ripgrep-comparison.png" alt="Before/after comparison of a ripgrep debug build" /></p>
+<p>Most binaries should see some improvements here, but it's especially significant with e.g. bigger
+binaries, or when involving debuginfo. These usually see bottlenecks in the linker.</p>
+<p>Here's <a href="https://perf.rust-lang.org/compare.html?start=b3e117044c7f707293edc040edb93e7ec5f7040a&amp;end=baed03c51a68376c1789cc373581eea0daf89967&amp;stat=instructions%3Au&amp;tab=compile">a
+link</a>
+to the complete results from our benchmarks.</p>
+<p>If testing goes well, we can then stabilize using this faster linker by default for
+<code>x86_64-unknown-linux-gnu</code> users, before maybe looking at other targets.</p>
+<h4><a href="#possible-drawbacks" aria-hidden="true" class="anchor" id="possible-drawbacks"></a>Possible drawbacks</h4>
+<p>From our prior testing, we don't really expect issues to happen in practice. It is a drop-in
+replacement for the vast majority of cases, but <code>lld</code> is not <em>bug-for-bug</em> compatible with GNU ld.</p>
+<p>In any case, using <code>rust-lld</code> can be disabled if any problem occurs: use the <code>-Z linker-features=-lld</code> flag to revert to using the system's default linker.</p>
+<p>Some crates somehow relying on these differences could need additional link args. For example, we
+saw &lt;20 crates in the crater run failing to link because of a different default about <a href="https://lld.llvm.org/ELF/start-stop-gc">encapsulation
+symbols</a>: these could require
+<code>-Clink-arg=-Wl,-z,nostart-stop-gc</code> to match the legacy GNU ld behavior.</p>
+<p>Some of the big gains in performance come from parallelism, which could be undesirable in
+resource-constrained environments.</p>
+<h4><a href="#summary" aria-hidden="true" class="anchor" id="summary"></a>Summary</h4>
+<p>rustc will use <code>rust-lld</code> on <code>x86_64-unknown-linux-gnu</code> nightlies, for much improved linking times,
+starting in tomorrow's rustup nightly (<code>nightly-2024-05-18</code>).
+Let us know if you encounter problems, by <a href="https://github.com/rust-lang/rust/issues/new/choose">opening an
+issue</a> on GitHub.</p>
+<p>If that happens, you can revert to the default linker with the <code>-Z linker-features=-lld</code> flag.
+Either by adding it to the usual <code>RUSTFLAGS</code> environment variable, or to a project's
+<a href="https://doc.rust-lang.org/cargo/reference/config.html"><code>.cargo/config.toml</code></a> configuration file,
+like so:</p>
+<pre><code class="language-toml">[target.x86_64-unknown-linux-gnu]
+rustflags = [&quot;-Zlinker-features=-lld&quot;]
+</code></pre>
+</content>
+
+ <author>
+ <name>Rémy Rakic</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Rust participates in OSPP 2024</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/05/07/OSPP-2024.html" type="text/html" title="Rust participates in OSPP 2024" />
+ <published>2024-05-07T00:00:00+00:00</published>
+ <updated>2024-05-07T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/05/07/OSPP-2024.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/05/07/OSPP-2024.html"><p>Similar to our <a href="https://blog.rust-lang.org/2024/02/21/Rust-participates-in-GSoC-2024.html">previous</a> <a href="https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html">announcements</a> of the Rust Project's participation in Google Summer of Code (GSoC), we are now announcing our participation in <a href="https://summer-ospp.ac.cn/">Open Source Promotion Plan (OSPP) 2024</a>.</p>
+<p>OSPP is a program organized in large part by The Institute of Software Chinese Academy of Sciences. Its goal is to encourage college students to participate in developing and maintaining open source software. The Rust Project is <a href="https://summer-ospp.ac.cn/org/orgdetail/11769be7-d00a-4931-be95-13595ac181e4?lang=en">already registered</a> and has a number of projects available for mentorship:</p>
+<ul>
+<li><a href="https://summer-ospp.ac.cn/org/prodetail/241170274">C codegen backend for rustc</a></li>
+<li><a href="https://summer-ospp.ac.cn/org/prodetail/241170275">Extend annotate-snippets with features required by rustc</a></li>
+<li><a href="https://summer-ospp.ac.cn/org/prodetail/241170277">Improve bootstrap</a></li>
+<li><a href="https://summer-ospp.ac.cn/org/prodetail/241170528">Modernize the libc crate</a></li>
+<li><a href="https://summer-ospp.ac.cn/org/prodetail/241170529">Improve infrastructure automation tools</a></li>
+</ul>
+<p>Eligibility is limited to students and there is a <a href="https://summer-ospp.ac.cn/help/en/student/">guide</a> for potential participants. Student registration ends on the 3rd of June with the project application deadline a day later.</p>
+<p>Unlike GSoC which allows students to propose their own projects, OSPP requires that students only apply for one of the registered projects. We do have an <a href="https://rust-lang.zulipchat.com/#narrow/stream/436418-ospp">#ospp</a> Zulip stream and potential contributors are encouraged to join and discuss details about the projects and connect with mentors.</p>
+<p>After the project application window closes on June 4th, we will review and select participants, which will be announced on June 26th. From there, students will participate through to the end of September.</p>
+<p>As with GSoC, this is our first year participating in this program. We are incredibly excited for this opportunity to further expand into new open source communities and we're hopeful for a productive and educational summer.</p>
+</content>
+
+ <author>
+ <name>Amanieu d'Antras, Jack Huey, and Jakub Beránek</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Automatic checking of cfgs at compile-time</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/05/06/check-cfg.html" type="text/html" title="Automatic checking of cfgs at compile-time" />
+ <published>2024-05-06T00:00:00+00:00</published>
+ <updated>2024-05-06T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/05/06/check-cfg.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/05/06/check-cfg.html"><p>The Cargo and Compiler team are delighted to announce that starting with Rust 1.80 (or nightly-2024-05-05) every <em>reachable</em> <code>#[cfg]</code> will be <strong>automatically checked</strong> that they match the <strong>expected config names and values</strong>.</p>
+<p>This can help with verifying that the crate is correctly handling conditional compilation for different target platforms or features. It ensures that the cfg settings are consistent between what is intended and what is used, helping to catch potential bugs or errors early in the development process.</p>
+<p>This addresses a common pitfall for new and advanced users.</p>
+<p>This is another step to our commitment to provide user-focused tooling and we are eager and excited to finally see it fixed, after more than two years since the original <a href="https://github.com/rust-lang/rfcs/pull/3013">RFC 3013</a><sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup>.</p>
+<h2><a href="#a-look-at-the-feature" aria-hidden="true" class="anchor" id="a-look-at-the-feature"></a>A look at the feature</h2>
+<p>Every time a Cargo feature is declared that feature is transformed into a config that is passed to <code>rustc</code> (the Rust compiler) so it can verify with it along with <a href="https://doc.rust-lang.org/nightly/rustc/check-cfg.html#well-known-names-and-values">well known cfgs</a> if any of the <code>#[cfg]</code>, <code>#![cfg_attr]</code> and <code>cfg!</code> have unexpected configs and report a warning with the <code>unexpected_cfgs</code> lint.</p>
+<p><em><code>Cargo.toml</code></em>:</p>
+<pre><code class="language-toml">[package]
+name = &quot;foo&quot;
+
+[features]
+lasers = []
+zapping = []
+</code></pre>
+<p><em><code>src/lib.rs</code>:</em></p>
+<pre><code class="language-rust">#[cfg(feature = &quot;lasers&quot;)] // This condition is expected
+ // as &quot;lasers&quot; is an expected value
+ // of the `feature` cfg
+fn shoot_lasers() {}
+
+#[cfg(feature = &quot;monkeys&quot;)] // This condition is UNEXPECTED
+ // as &quot;monkeys&quot; is NOT an expected
+ // value of the `feature` cfg
+fn write_shakespeare() {}
+
+#[cfg(windosw)] // This condition is UNEXPECTED
+ // it's supposed to be `windows`
+fn win() {}
+</code></pre>
+<p><em><code>cargo check</code></em>:</p>
+<p><img src="../../../../images/2024-05-06-check-cfg/cargo-check.svg" alt="cargo-check" /></p>
+<h2><a href="#expecting-custom-cfgs" aria-hidden="true" class="anchor" id="expecting-custom-cfgs"></a>Expecting custom cfgs</h2>
+<p><em>UPDATE: This section was added with the release of nightly-2024-05-19.</em></p>
+<blockquote>
+<p>In Cargo point-of-view: a custom cfg is one that is neither defined by <code>rustc</code> nor by a Cargo feature. Think of <code>tokio_unstable</code>, <code>has_foo</code>, ... but not <code>feature = &quot;lasers&quot;</code>, <code>unix</code> or <code>debug_assertions</code></p>
+</blockquote>
+<p>Some crates might use custom cfgs, like <code>loom</code>, <code>fuzzing</code> or <code>tokio_unstable</code> that they expected from the environment (<code>RUSTFLAGS</code> or other means) and which are always statically known at compile time. For those cases, Cargo provides via the <code>[lints]</code> table a way to statically declare those cfgs as expected.</p>
+<p>Defining those custom cfgs as expected is done through the special <code>check-cfg</code> config under <code>[lints.rust.unexpected_cfgs]</code>:</p>
+<p><em><code>Cargo.toml</code></em></p>
+<pre><code class="language-toml">[lints.rust]
+unexpected_cfgs = { level = &quot;warn&quot;, check-cfg = ['cfg(loom)', 'cfg(fuzzing)'] }
+</code></pre>
+<h2><a href="#custom-cfgs-in-build-scripts" aria-hidden="true" class="anchor" id="custom-cfgs-in-build-scripts"></a>Custom cfgs in build scripts</h2>
+<p>On the other hand some crates use custom cfgs that are enabled by some logic in the crate <code>build.rs</code>. For those crates Cargo provides a new instruction: <a href="https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg"><code>cargo::rustc-check-cfg</code></a><sup class="footnote-ref"><a href="#fn-2" id="fnref-2" data-footnote-ref>2</a></sup> (or <code>cargo:rustc-check-cfg</code> for older Cargo version).</p>
+<p>The syntax to use is described in the <a href="https://doc.rust-lang.org/nightly/rustc/">rustc book</a> section <a href="https://doc.rust-lang.org/nightly/rustc/check-cfg.html">checking configuration</a>, but in a nutshell the basic syntax of <code>--check-cfg</code> is:</p>
+<pre><code>cfg(name, values(&quot;value1&quot;, &quot;value2&quot;, ..., &quot;valueN&quot;))
+</code></pre>
+<p>Note that every custom cfgs must always be expected, regardless if the cfg is active or not!</p>
+<h3><a href="#buildrs-example" aria-hidden="true" class="anchor" id="buildrs-example"></a><code>build.rs</code> example</h3>
+<p><code>build.rs</code>:</p>
+<pre><code class="language-rust">fn main() {
+ println!(&quot;cargo::rustc-check-cfg=cfg(has_foo)&quot;);
+ // ^^^^^^^^^^^^^^^^^^^^^^ new with Cargo 1.80
+ if has_foo() {
+ println!(&quot;cargo::rustc-cfg=has_foo&quot;);
+ }
+}
+</code></pre>
+<blockquote>
+<p>Each <code>cargo::rustc-cfg</code> should have an accompanying <strong>unconditional</strong> <code>cargo::rustc-check-cfg</code> directive to avoid warnings like this: <code>unexpected cfg condition name: has_foo</code>.</p>
+</blockquote>
+<h3><a href="#equivalence-table" aria-hidden="true" class="anchor" id="equivalence-table"></a>Equivalence table</h3>
+<table>
+<thead>
+<tr>
+<th><code>cargo::rustc-cfg</code></th>
+<th><code>cargo::rustc-check-cfg</code></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>foo</code></td>
+<td><code>cfg(foo)</code> or <code>cfg(foo, values(none()))</code></td>
+</tr>
+<tr>
+<td><code>foo=&quot;&quot;</code></td>
+<td><code>cfg(foo, values(&quot;&quot;))</code></td>
+</tr>
+<tr>
+<td><code>foo=&quot;bar&quot;</code></td>
+<td><code>cfg(foo, values(&quot;bar&quot;))</code></td>
+</tr>
+<tr>
+<td><code>foo=&quot;1&quot;</code> and <code>foo=&quot;2&quot;</code></td>
+<td><code>cfg(foo, values(&quot;1&quot;, &quot;2&quot;))</code></td>
+</tr>
+<tr>
+<td><code>foo=&quot;1&quot;</code> and <code>bar=&quot;2&quot;</code></td>
+<td><code>cfg(foo, values(&quot;1&quot;))</code> and <code>cfg(bar, values(&quot;2&quot;))</code></td>
+</tr>
+<tr>
+<td><code>foo</code> and <code>foo=&quot;bar&quot;</code></td>
+<td><code>cfg(foo, values(none(), &quot;bar&quot;))</code></td>
+</tr>
+</tbody>
+</table>
+<p>More details can be found in the <a href="https://doc.rust-lang.org/nightly/rustc/check-cfg.html"><code>rustc</code> book</a>.</p>
+<h2><a href="#frequently-asked-questions" aria-hidden="true" class="anchor" id="frequently-asked-questions"></a>Frequently asked questions</h2>
+<h3><a href="#can-it-be-disabled" aria-hidden="true" class="anchor" id="can-it-be-disabled"></a>Can it be disabled?</h3>
+<p>For Cargo users, the feature is <strong>always on</strong> and <em>cannot</em> be disabled, but like any other lints it can be controlled: <code>#![warn(unexpected_cfgs)]</code>.</p>
+<h3><a href="#does-the-lint-affect-dependencies" aria-hidden="true" class="anchor" id="does-the-lint-affect-dependencies"></a>Does the lint affect dependencies?</h3>
+<p>No, like most lints, <code>unexpected_cfgs</code> will only be reported for local packages thanks to <a href="https://doc.rust-lang.org/rustc/lints/levels.html#capping-lints">cap-lints</a>.</p>
+<h3><a href="#how-does-it-interact-with-the-rustflags-env" aria-hidden="true" class="anchor" id="how-does-it-interact-with-the-rustflags-env"></a>How does it interact with the <code>RUSTFLAGS</code> env?</h3>
+<p>You should be able to use the <code>RUSTFLAGS</code> environment variable like it was before.
+<em>Currently <code>--cfg</code> arguments are not checked, only usage in code are.</em></p>
+<p>This means that doing <code>RUSTFLAGS=&quot;--cfg tokio_unstable&quot; cargo check</code> will not report any warnings, unless <code>tokio_unstable</code> is used within your local crates, in which case crate author will need to make sure that that custom cfg is expected with <code>cargo::rustc-check-cfg</code> in the <code>build.rs</code> of that crate.</p>
+<h3><a href="#how-to-expect-custom-cfgs-without-a-buildrs" aria-hidden="true" class="anchor" id="how-to-expect-custom-cfgs-without-a-buildrs"></a>How to expect custom cfgs without a <code>build.rs</code>?</h3>
+<p><em>UPDATE: Cargo with nightly-2024-05-19 now provides the <code>[lints.rust.unexpected_cfgs.check-cfg]</code> config to address the statically known custom cfgs.</em></p>
+<p><del>There is <strong>currently no way</strong> to expect a custom cfg other than with <code>cargo::rustc-check-cfg</code> in a <code>build.rs</code>.</del></p>
+<p>Crate authors that don't want to use a <code>build.rs</code> and cannot use <code>[lints.rust.unexpected_cfgs.check-cfg]</code>, are encouraged to use Cargo features instead.</p>
+<h3><a href="#how-does-it-interact-with-other-build-systems" aria-hidden="true" class="anchor" id="how-does-it-interact-with-other-build-systems"></a>How does it interact with other build systems?</h3>
+<p>Non-Cargo based build systems are not affected by the lint by default. Build system authors that wish to have the same functionality should look at the <code>rustc</code> documentation for the <a href="https://doc.rust-lang.org/nightly/rustc/check-cfg.html"><code>--check-cfg</code></a> flag for a detailed explanation of how to achieve the same functionality.</p>
+<section class="footnotes" data-footnotes>
+<ol>
+<li id="fn-1">
+<p>The stabilized implementation and RFC 3013 diverge significantly, in particular there is only one form for <code>--check-cfg</code>: <code>cfg()</code> (instead of <code>values()</code> and <code>names()</code> being incomplete and subtlety incompatible with each other). <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p>
+</li>
+<li id="fn-2">
+<p><code>cargo::rustc-check-cfg</code> will start working in Rust 1.80 (or nightly-2024-05-05). From Rust 1.77 to Rust 1.79 <em>(inclusive)</em> it is silently ignored. In Rust 1.76 and below a warning is emitted when used without the unstable Cargo flag <code>-Zcheck-cfg</code>. <a href="#fnref-2" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p>
+</li>
+</ol>
+</section>
+</content>
+
+ <author>
+ <name>Urgau</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Announcing Rustup 1.27.1</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/05/06/Rustup-1.27.1.html" type="text/html" title="Announcing Rustup 1.27.1" />
+ <published>2024-05-06T00:00:00+00:00</published>
+ <updated>2024-05-06T00:00:01+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/05/06/Rustup-1.27.1.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/05/06/Rustup-1.27.1.html"><p>The Rustup team is happy to announce the release of Rustup version 1.27.1.
+<a href="https://rustup.rs">Rustup</a> is the recommended tool to install <a href="https://www.rust-lang.org">Rust</a>, a programming language that is empowering everyone to build reliable and efficient software.</p>
+<p>If you have a previous version of Rustup installed, getting Rustup 1.27.1 is as easy as stopping any programs which may be using Rustup (e.g. closing your IDE) and running:</p>
+<pre><code class="language-console">$ rustup self update
+</code></pre>
+<p>Rustup will also automatically update itself at the end of a normal toolchain update:</p>
+<pre><code class="language-console">$ rustup update
+</code></pre>
+<p>If you don't have it already, you can <a href="https://rustup.rs">get Rustup</a> from the appropriate page on our website.</p>
+<h2><a href="#whats-new-in-rustup-1271" aria-hidden="true" class="anchor" id="whats-new-in-rustup-1271"></a>What's new in Rustup 1.27.1</h2>
+<p>This new Rustup release involves some minor bug fixes.</p>
+<p>The headlines for this release are:</p>
+<ol>
+<li>Prebuilt Rustup binaries should be working on older macOS versions again.</li>
+<li><code>rustup-init</code> will no longer fail when <code>fish</code> is installed but <code>~/.config/fish/conf.d</code> hasn't been created.</li>
+<li>Regressions regarding symlinked <code>RUSTUP_HOME/(toolchains|downloads|tmp)</code> have been addressed.</li>
+</ol>
+<p>Full details are available in the <a href="https://github.com/rust-lang/rustup/blob/stable/CHANGELOG.md">changelog</a>!</p>
+<p>Rustup's documentation is also available in <a href="https://rust-lang.github.io/rustup/">the Rustup Book</a>.</p>
+<h2><a href="#thanks" aria-hidden="true" class="anchor" id="thanks"></a>Thanks</h2>
+<p>Thanks again to all the contributors who made Rustup 1.27.1 possible!</p>
+<ul>
+<li>Anas (0x61nas)</li>
+<li>cuiyourong (cuiyourong)</li>
+<li>Dirkjan Ochtman (djc)</li>
+<li>Eric Huss (ehuss)</li>
+<li>eth3lbert (eth3lbert)</li>
+<li>hev (heiher)</li>
+<li>klensy (klensy)</li>
+<li>Chih Wang (ongchi)</li>
+<li>Adam (pie-flavor)</li>
+<li>rami3l (rami3l)</li>
+<li>Robert (rben01)</li>
+<li>Robert Collins (rbtcollins)</li>
+<li>Sun Bin (shandongbinzhou)</li>
+<li>Samuel Moelius (smoelius)</li>
+<li>vpochapuis (vpochapuis)</li>
+<li>Renovate Bot (renovate)</li>
+</ul>
+</content>
+
+ <author>
+ <name>The Rustup Team</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Announcing Rust 1.78.0</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html" type="text/html" title="Announcing Rust 1.78.0" />
+ <published>2024-05-02T00:00:00+00:00</published>
+ <updated>2024-05-02T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html"><p>The Rust team is happy to announce a new version of Rust, 1.78.0. Rust is a programming language empowering everyone to build reliable and efficient software.</p>
+<p>If you have a previous version of Rust installed via <code>rustup</code>, you can get 1.78.0 with:</p>
+<pre><code class="language-console">$ rustup update stable
+</code></pre>
+<p>If you don't have it already, you can <a href="https://www.rust-lang.org/install.html">get <code>rustup</code></a> from the appropriate page on our website, and check out the <a href="https://doc.rust-lang.org/nightly/releases.html#version-1780-2024-05-02">detailed release notes for 1.78.0</a>.</p>
+<p>If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (<code>rustup default beta</code>) or the nightly channel (<code>rustup default nightly</code>). Please <a href="https://github.com/rust-lang/rust/issues/new/choose">report</a> any bugs you might come across!</p>
+<h2><a href="#whats-in-1780-stable" aria-hidden="true" class="anchor" id="whats-in-1780-stable"></a>What's in 1.78.0 stable</h2>
+<h3><a href="#diagnostic-attributes" aria-hidden="true" class="anchor" id="diagnostic-attributes"></a>Diagnostic attributes</h3>
+<p>Rust now supports a <code>#[diagnostic]</code> attribute namespace to influence compiler error messages. These are treated as hints which the compiler is not <em>required</em> to use, and it is also not an error to provide a diagnostic that the compiler doesn't recognize. This flexibility allows source code to provide diagnostics even when they're not supported by all compilers, whether those are different versions or entirely different implementations.</p>
+<p>With this namespace comes the first supported attribute, <code>#[diagnostic::on_unimplemented]</code>, which can be placed on a trait to customize the message when that trait is required but hasn't been implemented on a type. Consider the example given in the <a href="https://github.com/rust-lang/rust/pull/119888/">stabilization pull request</a>:</p>
+<pre><code class="language-rust">#[diagnostic::on_unimplemented(
+ message = &quot;My Message for `ImportantTrait&lt;{A}&gt;` is not implemented for `{Self}`&quot;,
+ label = &quot;My Label&quot;,
+ note = &quot;Note 1&quot;,
+ note = &quot;Note 2&quot;
+)]
+trait ImportantTrait&lt;A&gt; {}
+
+fn use_my_trait(_: impl ImportantTrait&lt;i32&gt;) {}
+
+fn main() {
+ use_my_trait(String::new());
+}
+</code></pre>
+<p>Previously, the compiler would give a builtin error like this:</p>
+<pre><code>error[E0277]: the trait bound `String: ImportantTrait&lt;i32&gt;` is not satisfied
+ --&gt; src/main.rs:12:18
+ |
+12 | use_my_trait(String::new());
+ | ------------ ^^^^^^^^^^^^^ the trait `ImportantTrait&lt;i32&gt;` is not implemented for `String`
+ | |
+ | required by a bound introduced by this call
+ |
+</code></pre>
+<p>With <code>#[diagnostic::on_unimplemented]</code>, its custom message fills the primary error line, and its custom label is placed on the source output. The original label is still written as help output, and any custom notes are written as well. (These exact details are subject to change.)</p>
+<pre><code>error[E0277]: My Message for `ImportantTrait&lt;i32&gt;` is not implemented for `String`
+ --&gt; src/main.rs:12:18
+ |
+12 | use_my_trait(String::new());
+ | ------------ ^^^^^^^^^^^^^ My Label
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `ImportantTrait&lt;i32&gt;` is not implemented for `String`
+ = note: Note 1
+ = note: Note 2
+</code></pre>
+<p>For trait authors, this kind of diagnostic is more useful if you can provide a better hint than just talking about the missing implementation itself. For example, this is an abridged sample from the standard library:</p>
+<pre><code class="language-rust">#[diagnostic::on_unimplemented(
+ message = &quot;the size for values of type `{Self}` cannot be known at compilation time&quot;,
+ label = &quot;doesn't have a size known at compile-time&quot;
+)]
+pub trait Sized {}
+</code></pre>
+<p>For more information, see the reference section on <a href="https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnostic-tool-attribute-namespace">the <code>diagnostic</code> tool attribute namespace</a>.</p>
+<h3><a href="#asserting-unsafe-preconditions" aria-hidden="true" class="anchor" id="asserting-unsafe-preconditions"></a>Asserting <code>unsafe</code> preconditions</h3>
+<p>The Rust standard library has a number of assertions for the preconditions of <code>unsafe</code> functions, but historically they have only been enabled in <code>#[cfg(debug_assertions)]</code> builds of the standard library to avoid affecting release performance. However, since the standard library is usually compiled and distributed in release mode, most Rust developers weren't ever executing these checks at all.</p>
+<p>Now, the condition for these assertions is delayed until code generation, so they will be checked depending on the user's own setting for debug assertions -- enabled by default in debug and test builds. This change helps users catch undefined behavior in their code, though the details of how much is checked are generally not stable.</p>
+<p>For example, <a href="https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html"><code>slice::from_raw_parts</code></a> requires an aligned non-null pointer. The following use of a purposely-misaligned pointer has undefined behavior, and while if you were unlucky it may have <em>appeared</em> to &quot;work&quot; in the past, the debug assertion can now catch it:</p>
+<pre><code class="language-rust">fn main() {
+ let slice: &amp;[u8] = &amp;[1, 2, 3, 4, 5];
+ let ptr = slice.as_ptr();
+
+ // Create an offset from `ptr` that will always be one off from `u16`'s correct alignment
+ let i = usize::from(ptr as usize &amp; 1 == 0);
+
+ let slice16: &amp;[u16] = unsafe { std::slice::from_raw_parts(ptr.add(i).cast::&lt;u16&gt;(), 2) };
+ dbg!(slice16);
+}
+</code></pre>
+<pre><code>thread 'main' panicked at library/core/src/panicking.rs:220:5:
+unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+thread caused non-unwinding panic. aborting.
+</code></pre>
+<h3><a href="#deterministic-realignment" aria-hidden="true" class="anchor" id="deterministic-realignment"></a>Deterministic realignment</h3>
+<p>The standard library has a few functions that change the alignment of pointers and slices, but they previously had caveats that made them difficult to rely on in practice, if you followed their documentation precisely. Those caveats primarily existed as a hedge against <code>const</code> evaluation, but they're only stable for non-<code>const</code> use anyway. They are now promised to have consistent runtime behavior according to their actual inputs.</p>
+<ul>
+<li>
+<p><a href="https://doc.rust-lang.org/std/primitive.pointer.html#method.align_offset"><code>pointer::align_offset</code></a> computes the offset needed to change a pointer to the given alignment. It returns <code>usize::MAX</code> if that is not possible, but it was previously permitted to <em>always</em> return <code>usize::MAX</code>, and now that behavior is removed.</p>
+</li>
+<li>
+<p><a href="https://doc.rust-lang.org/std/primitive.slice.html#method.align_to"><code>slice::align_to</code></a> and <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.align_to_mut"><code>slice::align_to_mut</code></a> both transmute slices to an aligned middle slice and the remaining unaligned head and tail slices. These methods now promise to return the largest possible middle part, rather than allowing the implementation to return something less optimal like returning everything as the head slice.</p>
+</li>
+</ul>
+<h3><a href="#stabilized-apis" aria-hidden="true" class="anchor" id="stabilized-apis"></a>Stabilized APIs</h3>
+<ul>
+<li><a href="https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin"><code>impl Read for &amp;Stdin</code></a></li>
+<li><a href="https://github.com/rust-lang/rust/pull/113833/">Accept non <code>'static</code> lifetimes for several <code>std::error::Error</code> related implementations</a></li>
+<li><a href="https://github.com/rust-lang/rust/pull/114655/">Make <code>impl&lt;Fd: AsFd&gt;</code> impl take <code>?Sized</code></a></li>
+<li><a href="https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error"><code>impl From&lt;TryReserveError&gt; for io::Error</code></a></li>
+</ul>
+<p>These APIs are now stable in const contexts:</p>
+<ul>
+<li><a href="https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new"><code>Barrier::new()</code></a></li>
+</ul>
+<h3><a href="#compatibility-notes" aria-hidden="true" class="anchor" id="compatibility-notes"></a>Compatibility notes</h3>
+<ul>
+<li>As <a href="https://blog.rust-lang.org/2024/02/26/Windows-7.html">previously announced</a>, Rust 1.78 has increased its minimum requirement to Windows 10 for the following targets:
+<ul>
+<li><code>x86_64-pc-windows-msvc</code></li>
+<li><code>i686-pc-windows-msvc</code></li>
+<li><code>x86_64-pc-windows-gnu</code></li>
+<li><code>i686-pc-windows-gnu</code></li>
+<li><code>x86_64-pc-windows-gnullvm</code></li>
+<li><code>i686-pc-windows-gnullvm</code></li>
+</ul>
+</li>
+<li>Rust 1.78 has upgraded its bundled LLVM to version 18, completing the announced <a href="https://blog.rust-lang.org/2024/03/30/i128-layout-update.html"><code>u128</code>/<code>i128</code> ABI change</a> for x86-32 and x86-64 targets. Distributors that use their own LLVM older than 18 may still face the calling convention bugs mentioned in that post.</li>
+</ul>
+<h3><a href="#other-changes" aria-hidden="true" class="anchor" id="other-changes"></a>Other changes</h3>
+<p>Check out everything that changed in <a href="https://github.com/rust-lang/rust/releases/tag/1.78.0">Rust</a>, <a href="https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-178-2024-05-02">Cargo</a>, and <a href="https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-178">Clippy</a>.</p>
+<h2><a href="#contributors-to-1780" aria-hidden="true" class="anchor" id="contributors-to-1780"></a>Contributors to 1.78.0</h2>
+<p>Many people came together to create Rust 1.78.0. We couldn't have done it without all of you. <a href="https://thanks.rust-lang.org/rust/1.78.0/">Thanks!</a></p>
+</content>
+
+ <author>
+ <name>The Rust Release Team</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Announcing Google Summer of Code 2024 selected projects</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html" type="text/html" title="Announcing Google Summer of Code 2024 selected projects" />
+ <published>2024-05-01T00:00:00+00:00</published>
+ <updated>2024-05-01T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html"><p>The Rust Project is <a href="https://blog.rust-lang.org/2024/02/21/Rust-participates-in-GSoC-2024.html">participating</a> in <a href="https://summerofcode.withgoogle.com">Google Summer of Code (GSoC) 2024</a>, a global program organized by Google which is designed to bring new contributors to the world of open-source.</p>
+<p>In February, we published a list of <a href="https://github.com/rust-lang/google-summer-of-code">GSoC project ideas</a>, and started discussing these projects with potential GSoC applicants on our <a href="https://rust-lang.zulipchat.com/#narrow/stream/421156-gsoc">Zulip</a>. We were pleasantly surprised by the amount of people that wanted to participate in these projects and that led to many fruitful discussions with members of various Rust teams. Some of them even immediately began contributing to various repositories of the Rust Project, even before GSoC officially started!</p>
+<p>After the initial discussions, GSoC applicants prepared and submitted their project proposals. We received 65 (!) proposals in total. We are happy to see that there was so much interest, given that this is the first time the Rust Project is participating in GSoC.</p>
+<p>A team of mentors primarily composed of Rust Project contributors then thoroughly examined the submitted proposals. GSoC required us to produce a ranked list of the best proposals, which was a challenging task in itself since Rust is a big project with many priorities! We went through many rounds of discussions and had to consider many factors, such as prior conversations with the given applicant, the quality and scope of their proposal, the importance of the proposed project for the Rust Project and its wider community, but also the availability of mentors, who are often volunteers and thus have limited time available for mentoring.</p>
+<p>In many cases, we had multiple proposals that aimed to accomplish the same goal. Therefore, we had to pick only one per project topic despite receiving several high-quality proposals from people we'd love to work with. We also often had to choose between great proposals targeting different work within the same Rust component to avoid overloading a single mentor with multiple projects.</p>
+<p>In the end, we narrowed the list down to twelve best proposals, which we felt was the maximum amount that we could realistically support with our available mentor pool. We submitted this list and eagerly awaited how many of these twelve proposals would be accepted into GSoC.</p>
+<h2><a href="#selected-projects" aria-hidden="true" class="anchor" id="selected-projects"></a>Selected projects</h2>
+<p>On the 1st of May, Google has announced the accepted projects. We are happy to announce that <code>9</code> proposals out of the twelve that we have submitted were accepted by Google, and will thus participate in Google Summer of Code 2024! Below you can find the list of accepted proposals (in alphabetical order), along with the names of their authors and the assigned mentor(s):</p>
+<ul>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/hADSyIDV">Adding lint-level configuration to cargo-semver-checks</a></strong> by Max Carr, mentored by Predrag Gruevski</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/zxxeGZMt">Implementation of a Faster Register Allocator For Cranelift</a></strong> by d-sonuga, mentored by Chris Fallin and Amanieu d'Antras</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/MeyNanKI">Improve Rust benchmark suite</a></strong> by s7tya, mentored by Jakub Beránek</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/jjnidpgn">Move cargo shell completions to Rust</a></strong> by shanmu, mentored by Ed Page</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/P5BC91Hr">Rewriting Esoteric, Error-Prone Makefile Tests Using Robust Rust Features</a></strong> by Julien Robert, mentored by Jieyou Xu</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/gHEu3vxc">Rewriting the Rewrite trait</a></strong> by SeoYoung Lee, mentored by Yacin Tmimi</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/IIHP5ozV">Rust to .NET compiler - add support for compiling &amp; running cargo tests</a></strong> by Fractal Fir, mentored by Jack Huey</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/kXG0mZoj">Sandboxed and Deterministic Proc Macro using Wasm</a></strong> by Apurva Mishra, mentored by David Lattimore</li>
+<li><strong><a href="https://summerofcode.withgoogle.com/programs/2024/projects/rk1Ey4hN">Tokio async support in Miri</a></strong> by Tiffany Pek Yuan, mentored by Oli Scherer</li>
+</ul>
+<p><strong>Congratulations to all applicants whose project was selected!</strong> The mentors are looking forward to working with you on these exciting projects to improve the Rust ecosystem. You can expect to hear from us soon, so that we can start coordinating the work on your GSoC projects.</p>
+<p>We would also like to thank all the applicants whose proposal was sadly not accepted, for their interactions with the Rust community and contributions to various Rust projects. There were some great proposals that did not make the cut, in large part because of limited review capacity. However, even if your proposal was not accepted, we would be happy if you would consider contributing to the projects that got you interested, even outside GSoC! Our <a href="https://github.com/rust-lang/google-summer-of-code">project idea list</a> is still actual, and could serve as a general entry point for contributors that would like to work on projects that would help the Rust Project maintainers and the Rust ecosystem.</p>
+<p>Assuming our involvement in GSoC 2024 is successful, there's a good chance we'll participate next year as well (though we can't promise anything yet) and we hope to receive your proposals again in the future! We also are planning to participate in similar programs in the very near future. Those announcements will come in separate blog posts, so make sure to subscribe to this blog so that you don't miss anything.</p>
+<p>The accepted GSoC projects will run for several months. After GSoC 2024 finishes (in autumn of 2024), we plan to publish a blog post in which we will summarize the outcome of the accepted projects.</p>
+</content>
+
+ <author>
+ <name>Jakub Beránek, Jack Huey and Paul Lenz</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Security advisory for the standard library (CVE-2024-24576)</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html" type="text/html" title="Security advisory for the standard library (CVE-2024-24576)" />
+ <published>2024-04-09T00:00:00+00:00</published>
+ <updated>2024-04-09T00:00:00+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html"><p>The Rust Security Response WG was notified that the Rust standard library did
+not properly escape arguments when invoking batch files (with the <code>bat</code> and
+<code>cmd</code> extensions) on Windows using the <a href="https://doc.rust-lang.org/std/process/struct.Command.html"><code>Command</code></a> API. An attacker able to
+control the arguments passed to the spawned process could execute arbitrary
+shell commands by bypassing the escaping.</p>
+<p>The severity of this vulnerability is <strong>critical</strong> if you are invoking batch
+files on Windows with untrusted arguments. No other platform or use is
+affected.</p>
+<p>This vulnerability is identified by CVE-2024-24576.</p>
+<h2><a href="#overview" aria-hidden="true" class="anchor" id="overview"></a>Overview</h2>
+<p>The <a href="https://doc.rust-lang.org/std/process/struct.Command.html#method.arg"><code>Command::arg</code></a> and <a href="https://doc.rust-lang.org/std/process/struct.Command.html#method.args"><code>Command::args</code></a> APIs state in their
+documentation that the arguments will be passed to the spawned process as-is,
+regardless of the content of the arguments, and will not be evaluated by a
+shell. This means it should be safe to pass untrusted input as an argument.</p>
+<p>On Windows, the implementation of this is more complex than other platforms,
+because the Windows API only provides a single string containing all the
+arguments to the spawned process, and it's up to the spawned process to split
+them. Most programs use the standard C run-time argv, which in practice results
+in a mostly consistent way arguments are splitted.</p>
+<p>One exception though is <code>cmd.exe</code> (used among other things to execute batch
+files), which has its own argument splitting logic. That forces the standard
+library to implement custom escaping for arguments passed to batch files.
+Unfortunately it was reported that our escaping logic was not thorough enough,
+and it was possible to pass malicious arguments that would result in arbitrary
+shell execution.</p>
+<h2><a href="#mitigations" aria-hidden="true" class="anchor" id="mitigations"></a>Mitigations</h2>
+<p>Due to the complexity of <code>cmd.exe</code>, we didn't identify a solution that would
+correctly escape arguments in all cases. To maintain our API guarantees, we
+improved the robustness of the escaping code, and changed the <code>Command</code> API to
+return an <a href="https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput"><code>InvalidInput</code></a> error when it cannot safely escape an argument.
+This error will be emitted when spawning the process.</p>
+<p>The fix will be included in Rust 1.77.2, to be released later today.</p>
+<p>If you implement the escaping yourself or only handle trusted inputs, on
+Windows you can also use the <a href="https://doc.rust-lang.org/std/os/windows/process/trait.CommandExt.html#tymethod.raw_arg"><code>CommandExt::raw_arg</code></a> method to bypass the
+standard library's escaping logic.</p>
+<h2><a href="#affected-versions" aria-hidden="true" class="anchor" id="affected-versions"></a>Affected Versions</h2>
+<p>All Rust versions before 1.77.2 on Windows are affected, if your code or one of
+your dependencies executes batch files with untrusted arguments. Other
+platforms or other uses on Windows are not affected.</p>
+<h2><a href="#acknowledgments" aria-hidden="true" class="anchor" id="acknowledgments"></a>Acknowledgments</h2>
+<p>We want to thank RyotaK for responsibly disclosing this to us according to the
+<a href="https://www.rust-lang.org/policies/security">Rust security policy</a>, and Simon Sawicki (Grub4K) for identifying some of
+the escaping rules we adopted in our fix.</p>
+<p>We also want to thank the members of the Rust project who helped us disclose
+the vulnerability: Chris Denton for developing the fix; Mara Bos for reviewing
+the fix; Pietro Albini for writing this advisory; Pietro Albini, Manish
+Goregaokar and Josh Stone for coordinating this disclosure; Amanieu d'Antras
+for advising during the disclosure.</p>
+</content>
+
+ <author>
+ <name>The Rust Security Response WG</name>
+ </author>
+ </entry>
+ <entry>
+ <title>Changes to Rust's WASI targets</title>
+ <link rel="alternate" href="https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html" type="text/html" title="Changes to Rust's WASI targets" />
+ <published>2024-04-09T00:00:00+00:00</published>
+ <updated>2024-04-09T00:00:01+00:00</updated>
+ <id>https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html</id>
+ <content type="html" xml:base="https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html"><p><a href="https://bytecodealliance.org/articles/WASI-0.2">WASI 0.2 was recently
+stabilized</a>, and Rust has begun
+implementing first-class support for it in the form of a dedicated new target.
+Rust 1.78 will introduce new <code>wasm32-wasip1</code> (tier 2) and <code>wasm32-wasip2</code> (tier
+3) targets. <code>wasm32-wasip1</code> is an effective rename of the existing <code>wasm32-wasi</code>
+target, freeing the target name up for an eventual WASI 1.0 release. <strong>Starting
+Rust 1.78 (May 2nd, 2024), users of WASI 0.1 are encouraged to begin migrating
+to the new <code>wasm32-wasip1</code> target before the existing <code>wasm32-wasi</code> target is
+removed in Rust 1.84 (January 5th, 2025).</strong></p>
+<p>In this post we'll discuss the introduction of the new targets, the motivation
+behind it, what that means for the existing WASI targets, and a detailed
+schedule for these changes. This post is about the WASI targets only; the
+existing <code>wasm32-unknown-unknown</code> and <code>wasm32-unknown-emscripten</code> targets are
+unaffected by any changes in this post.</p>
+<h2><a href="#introducing-wasm32-wasip2" aria-hidden="true" class="anchor" id="introducing-wasm32-wasip2"></a>Introducing <code>wasm32-wasip2</code></h2>
+<p>After nearly five years of work the <a href="https://wasi.dev">WASI 0.2 specification</a>
+was recently stabilized. This work builds on <a href="https://component-model.bytecodealliance.org">WebAssembly
+Components</a> (think: strongly-typed
+ABI for Wasm), providing standard interfaces for things like asynchronous IO,
+networking, and HTTP. This will finally make it possible to write asynchronous
+networked services on top of WASI, something which wasn't possible using WASI
+0.1.</p>
+<p>People interested in compiling Rust code to WASI 0.2 today are able to do so
+using the <a href="https://github.com/bytecodealliance/cargo-component">cargo-component</a>
+tool. This tool is able to take WASI 0.1 binaries, and transform them to WASI 0.2
+Components using a shim. It also provides native support for common cargo
+commands such as <code>cargo build</code>, <code>cargo test</code>, and <code>cargo run</code>. While it
+introduces some inefficiencies because of the additional translation layer, in
+practice this already works really well and people should be able to get
+started with WASI 0.2 development.</p>
+<p>We're however keen to begin making that translation layer obsolete. And for
+that reason we're happy to share that Rust has made its first steps towards
+that with the introduction of the <a href="https://doc.rust-lang.org/rustc/platform-support.html#tier-3">tier
+3</a> <code>wasm32-wasip2</code>
+target landing in Rust 1.78. <strong>This will initially miss a lot of expected</strong>
+<strong>features such as stdlib support, and we don't recommend people use this target</strong>
+<strong>quite yet.</strong> But as we fill in those missing features over the coming months, we
+aim to eventually meet the criteria to become a tier 2 target, at which
+point the <code>wasm32-wasip2</code> target would be considered ready for general use. This
+work will happen through 2024, and we expect for this to land before the end of
+the calendar year.</p>
+<h2><a href="#renaming-wasm32-wasi-to-wasm32-wasip1" aria-hidden="true" class="anchor" id="renaming-wasm32-wasi-to-wasm32-wasip1"></a>Renaming <code>wasm32-wasi</code> to <code>wasm32-wasip1</code></h2>
+<p>The original name for what we now call WASI 0.1 was &quot;WebAssembly System
+Interface, snapshot 1&quot;. Rust shipped support for this in 2019, and we did so
+knowing the target would likely undergo significant changes in the future. With
+the knowledge we have today though, we would not have chosen to introduce the
+&quot;WASI, snapshot 1&quot; target as <code>wasm32-wasi</code>. We should have instead chosen to add
+some suffix to the initial target triple so that the eventual stable WASI 1.0
+target can just be called <code>wasm32-wasi</code>.</p>
+<p>In anticipation of both an eventual WASI 1.0 target, and to preserve consistency
+between target names, we'll begin rolling out a name change to the existing WASI
+0.1 target. Starting in Rust 1.78 (May 2nd, 2024) a new <code>wasm32-wasip1</code> target
+will become available. Starting Rust 1.81 (September 5th, 2024) we will begin
+warning existing users of <code>wasm32-wasi</code> to migrate to <code>wasm32-wasip1</code>. And
+finally in Rust 1.84 (January 9th, 2025) the <code>wasm32-wasi</code> target will no longer
+be shipped on the stable release channel. This will provide an 8 month
+transition period for projects to switch to the new target name when they update
+their Rust toolchains.</p>
+<p>The name <code>wasip1</code> can be read as either &quot;WASI (zero) point one&quot; or &quot;WASI preview
+one&quot;. The official specification uses the &quot;preview&quot; moniker, however in most
+communication the form &quot;WASI 0.1&quot; is now preferred. This target triple was
+chosen because it not only maps to both terms, but also more closely resembles
+the target terminology used in <a href="https://go.dev/blog/wasi">other programming
+languages</a>. This is something the WASI Preview 2
+specification <a href="https://github.com/WebAssembly/WASI/tree/f45e72e5294e990c23d548eea32fd35c80525fd6/preview2#introduction">also makes note
+of</a>.</p>
+<h2><a href="#timeline" aria-hidden="true" class="anchor" id="timeline"></a>Timeline</h2>
+<p>This table provides the dates and cut-offs for the target rename from
+<code>wasm32-wasi</code> to <code>wasm32-wasip1</code>. The dates in this table do not apply to the
+newly-introduced <code>wasm32-wasi-preview1-threads</code> target; this will be renamed to
+<code>wasm32-wasip1-threads</code> in Rust 1.78 without going through a transition period.
+The tier 3 <code>wasm32-wasip2</code> target will also be made available in Rust 1.78.</p>
+<table>
+<thead>
+<tr>
+<th>date</th>
+<th>Rust Stable</th>
+<th>Rust Beta</th>
+<th>Rust Nightly</th>
+<th>Notes</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>2024-02-08</td>
+<td>1.76</td>
+<td>1.77</td>
+<td>1.78</td>
+<td><code>wasm32-wasip1</code> available on nightly</td>
+</tr>
+<tr>
+<td>2024-03-21</td>
+<td>1.77</td>
+<td>1.78</td>
+<td>1.79</td>
+<td><code>wasm32-wasip1</code> available on beta</td>
+</tr>
+<tr>
+<td>2024-05-02</td>
+<td>1.78</td>
+<td>1.79</td>
+<td>1.80</td>
+<td><code>wasm32-wasip1</code> available on stable</td>
+</tr>
+<tr>
+<td>2024-06-13</td>
+<td>1.79</td>
+<td>1.80</td>
+<td>1.81</td>
+<td>warn if <code>wasm32-wasi</code> is used on nightly</td>
+</tr>
+<tr>
+<td>2024-07-25</td>
+<td>1.80</td>
+<td>1.81</td>
+<td>1.82</td>
+<td>warn if <code>wasm32-wasi</code> is used on beta</td>
+</tr>
+<tr>
+<td>2024-09-05</td>
+<td>1.81</td>
+<td>1.82</td>
+<td>1.83</td>
+<td>warn if <code>wasm32-wasi</code> is used on stable</td>
+</tr>
+<tr>
+<td>2024-10-17</td>
+<td>1.82</td>
+<td>1.83</td>
+<td>1.84</td>
+<td><code>wasm32-wasi</code> unavailable on nightly</td>
+</tr>
+<tr>
+<td>2024-11-28</td>
+<td>1.83</td>
+<td>1.84</td>
+<td>1.85</td>
+<td><code>wasm32-wasi</code> unavailable on beta</td>
+</tr>
+<tr>
+<td>2025-01-09</td>
+<td>1.84</td>
+<td>1.85</td>
+<td>1.86</td>
+<td><code>wasm32-wasi</code> unavailable on stable</td>
+</tr>
+</tbody>
+</table>
+<h2><a href="#conclusion" aria-hidden="true" class="anchor" id="conclusion"></a>Conclusion</h2>
+<p>In this post we've discussed the upcoming updates to Rust's WASI targets. Come
+Rust 1.78 the <code>wasm32-wasip1</code> (tier 2) and <code>wasm32-wasip2</code> (tier 3) targets will
+be added. In Rust 1.81 we will begin warning if <code>wasm32-wasi</code> is being used. And
+in Rust 1.84, the existing <code>wasm32-wasi</code> target will be removed. This will free
+up <code>wasm32-wasi</code> to eventually be used for a WASI 1.0 target. Users will have 8
+months to switch to the new target name when they update their Rust toolchains.</p>
+<p>The <code>wasm32-wasip2</code> target marks the start of native support for WASI 0.2. In
+order to target it today from Rust, people are encouraged to use
+<a href="https://github.com/bytecodealliance/cargo-component">cargo-component</a> tool
+instead. The plan is to eventually graduate <code>wasm32-wasip2</code> to a tier-2 target,
+at which point <code>cargo-component</code> will be upgraded to support it natively instead.</p>
+<p>With WASI 0.2 finally stable, it's an exciting time for WebAssembly development.
+We're happy for Rust to begin implementing native support for WASI 0.2, and
+we're excited about what this will enable people to build.</p>
+</content>
+
+ <author>
+ <name>Yosh Wuyts</name>
+ </author>
+ </entry>
+</feed>