惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
WordPress大学
WordPress大学
罗磊的独立博客
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
S
SegmentFault 最新的问题
C
Check Point Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
D
DataBreaches.Net
雷峰网
雷峰网
GbyAI
GbyAI
宝玉的分享
宝玉的分享

Rust Blog

Security Advisory for Cargo (CVE-2026-5223) | Rust Blog Security Advisory for Cargo (CVE-2026-5222) | Rust Blog Project goals update — April 2026 (end of 2025H2) | Rust Blog Rust is participating in Outreachy | Rust Blog Raising the baseline for the `nvptx64-nvidia-cuda` target | Rust Blog Announcing Google Summer of Code 2026 selected projects | Rust Blog Announcing Rust 1.95.0 | Rust Blog docs.rs: building fewer targets by default | Rust Blog Changes to WebAssembly targets and handling undefined symbols | Rust Blog Announcing Rust 1.94.1 | Rust Blog Security advisory for Cargo | Rust Blog What we heard about Rust's challenges | Rust Blog Call for Testing: Build Dir Layout v2 | Rust Blog Announcing rustup 1.29.0 | Rust Blog Announcing Rust 1.94.0 | Rust Blog 2025 State of Rust Survey Results | Rust Blog Rust debugging survey 2026 | Rust Blog Update on the October 15, 2018 incident on crates.io Announcing Rust 1.29.2 Announcing Rust 1.29 Launching the 2018 State of Rust Survey Announcing Rust 1.28 What is Rust 2018? Announcing Rust 1.27.2 Announcing Rust 1.27.1 Security Advisory for rustdoc Announcing Rust 1.27 Announcing Rust 1.26.2 Announcing Rust 1.26.1 Rust turns three
Announcing Rust 1.22 (and 1.22.1)
The Rust Core Team · 2017-11-22 · via Rust Blog

The Rust team is happy to announce two new versions of Rust, 1.22.0 and 1.22.1. Rust is a systems programming language focused on safety, speed, and concurrency.

Wait, two versions? At the last moment, we discovered a late-breaking issue with the new macOS High Sierra in 1.22.0, and for various reasons, decided to release 1.22.0 as usual, but also put out a 1.22.1 with the patch. The bug is actually in Cargo, not rustc, and only affects users on macOS High Sierra.

If you have a previous version of Rust installed via rustup, getting Rust 1.22.1 is as easy as:

$ rustup update stable

If you don't have it already, you can get rustup from the appropriate page on our website, and check out the detailed release notes for 1.22.0 and 1.22.1 on GitHub.

What's in 1.22.0 and 1.22.1 stable

The headline feature for this release is one many have been anticipating for a long time: you can now use ? with Option<T>! About a year ago, in Rust 1.13, we introduced the ? operator for working with Result<T, E>. Ever since then, there's been discussion about how far ? should go: should it stay only for results? Should it be user-extensible? Should it be usable with Option<T>?

In Rust 1.22, basic usage of ? with Option<T> is now stable. This code will now compile:

fn add_one_to_first(list: &[u8]) -> Option<u8> {
    // get first element, if exists
    // return None if it doesn't
    let first = list.get(0)?;
    Some(first + 1)
}

assert_eq!(add_one_to_first(&[10, 20, 30]), Some(11));
assert_eq!(add_one_to_first(&[]), None);

However, this functionality is still a bit limited; you cannot yet write code that mixes results and options with ? in the same function, for example. This will be possible in the future, and already is in nightly Rust; expect to hear more about this in a future release.

Types that implement Drop are now allowed in const and static items. Like this:

struct Foo {
    a: u32,
}

impl Drop for Foo {
    fn drop(&mut self) {}
}

const F: Foo = Foo { a: 0 };
static S: Foo = Foo { a: 0 };

This change doesn't bring much on its own, but as we improve our ability to compute things at compile-time, more and more will be possible in const and static.

Additionally, some small quality-of-life improvements:

Two recent compiler changes should speed up compiles in debug mode. We don't have any specific numbers to commit to with these changes, but as always, compile times are very important to us, and we're continuing to work on improving them.

T op= &T now works for primitive types, which is a fancy way of saying:

let mut x = 2;
let y = &8;

// this didn't work, but now does
x += y;

Previously, you'd have needed to write x += *y in order to de-reference, so this solves a small papercut.

Backtraces are improved on MacOS.

You can now create compile-fail tests in Rustdoc, like this:

/// ```compile_fail
/// let x = 5;
/// x += 2; // shouldn't compile!
/// ```

Please note that these kinds of tests can be more fragile than others, as additions to Rust may cause code to compile when it previously would not. Consider the first announcement with ?, for example: that code would fail to compile on Rust 1.21, but compile successfully on Rust 1.22, causing your test suite to start failing.

Finally, we removed support for the le32-unknown-nacl target. Google itself has deprecated PNaCl, instead throwing its support behind WebAssembly. You can already compile Rust code to WebAssembly today, and you can expect to hear more developments regarding this in future releases.

See the detailed release notes for more.

Library stabilizations

A few new APIs were stabilized this release:

See the detailed release notes for more.

Cargo features

If you have a big example to show your users, Cargo has grown the ability to build multi-file examples by creating a subdirectory inside examples that contains a main.rs.

Cargo now has the ability to vendor git repositories.

See the detailed release notes for more.

Contributors to 1.22.0 and 1.22.1

Many people came together to create Rust 1.22. We couldn't have done it without all of you. Thanks! (and Thanks again!)