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

推荐订阅源

G
GRAHAM CLULEY
V
V2EX
WordPress大学
WordPress大学
博客园 - Franky
Last Week in AI
Last Week in AI
博客园 - 司徒正美
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
V
Visual Studio Blog
C
CERT Recently Published Vulnerability Notes
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
腾讯CDC
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
A
Arctic Wolf
量子位
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News and Events Feed by Topic
雷峰网
雷峰网
博客园_首页
Google Online Security Blog
Google Online Security Blog
Spread Privacy
Spread Privacy
罗磊的独立博客
H
Hacker News: Front Page
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
IT之家
IT之家
The Cloudflare Blog
爱范儿
爱范儿
博客园 - 叶小钗
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell

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 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.26 The Rust Team All Hands in Berlin: a Recap Increasing Rust’s Reach 2018 Announcing Rust 1.25 Rust's 2018 roadmap Announcing Rust 1.24.1 Announcing Rust 1.24 The 2018 Rust Event Lineup Announcing Rust 1.23 New Year's Rust: A Call for Community Blogposts Rust in 2017: what we achieved Announcing Rust 1.22 (and 1.22.1) Fearless Concurrency in Firefox Quantum Announcing Rust 1.21 impl Future for Rust Rust 2017 Survey Results Announcing Rust 1.20 Announcing Rust 1.19 The 2017 Rust Conference Lineup Rust's 2017 roadmap, six months in Increasing Rust’s Reach Announcing Rust 1.18 Two years of Rust The Rust Libz Blitz Launching the 2017 State of Rust Survey Announcing Rust 1.17 Announcing Rust 1.16 Rust's language ergonomics initiative Announcing Rust 1.15.1 Rust's 2017 roadmap Announcing Rust 1.15 Announcing Rust 1.14 Announcing the First Underhanded Rust Contest Announcing Rust 1.13 Announcing Rust 1.12.1 Announcing Rust 1.12 Incremental Compilation Announcing Rust 1.11 Shape of errors to come The 2016 Rust Conference Lineup Announcing Rust 1.10 State of Rust Survey 2016 Announcing Rust 1.9 One year of Rust Taking Rust everywhere with rustup Launching the 2016 State of Rust Survey Cargo: predictable dependency management Introducing MIR Announcing Rust 1.8 Announcing Rust 1.7 Announcing Rust 1.6 Announcing Rust 1.5 Announcing Rust 1.4 Announcing Rust 1.3 Rust in 2016 Announcing Rust 1.2 Rust 1.1 stable, the Community Subteam, and RustCamp Announcing Rust 1.0 Abstraction without overhead: traits in Rust Rust Once, Run Everywhere Mixing matching, mutation, and moves in Rust Fearless Concurrency with Rust Announcing Rust 1.0 Beta Announcing Rust 1.0.0.alpha.2 Rust 1.0: status report and final timeline Announcing Rust 1.0 Alpha Rust 1.0: Scheduling the trains Yehuda Katz and Steve Klabnik are joining the Rust Core Team Cargo: Rust's community crate host Stability as a Deliverable Road to Rust 1.0
Announcing Rust 1.34.0
The Rust Release Team · 2019-04-11 · via Rust Blog

The Rust team is happy to announce a new version of Rust, 1.34.0. Rust is a programming language that is empowering everyone to build reliable and efficient software.

If you have a previous version of Rust installed via rustup, getting Rust 1.34.0 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.

What's in 1.34.0 stable

The largest feature in this release is the introduction of alternative cargo registries. The release also includes support for ? in documentation tests, some improvements for #[attribute(..)]s, as well as the stabilization of TryFrom. Read on for a few highlights, or see the detailed release notes for additional information.

Alternative cargo registries

Since before 1.0, Rust has had a public crate registry, crates.io. People publish crates with cargo publish and it's easy to include these crates in the [dependencies] section of your Cargo.toml.

However, not everyone wants to publish their crates to crates.io. People maintaining proprietary/closed-source code cannot use crates.io, and instead are forced to use git or path dependencies. This is usually fine for small projects, but if you have a lot of closed-source crates within a large organization, you lose the benefit of the versioning support that crates.io has.

With this release, Cargo gains support for alternate registries. These registries coexist with crates.io, so you can write software that depends on crates from both crates.io and your custom registry. Crates on crates.io cannot however depend on external registries.

To use an alternate registry, you must add these lines to your .cargo/config. This file can be in your home directory (~/.cargo/config) or relative to the package directory.

[registries]
my-registry = { index = "https://my-intranet:8080/git/index" }

Depending on a crate from an alternate registry is easy. When specifying dependencies in your Cargo.toml, use the registry key to let Cargo know that you wish to fetch the crate from the alternate registry:

[dependencies]
other-crate = { version = "1.0", registry = "my-registry" }

As a crate author, if you wish to publish your crate to an alternate registry, you first need to save the authentication token into ~/.cargo/credentials with the cargo login command:

cargo login --registry=my-registry

You can then use the --registry flag to indicate which registry to use when publishing:

cargo publish --registry=my-registry

There is documentation on how to run your own registry.

? in documentation tests

RFC 1937 proposed adding support for using the ? operator in fn main(), #[test] functions, and doctests, allowing them to return Option<T> or Result<T, E>, with error values causing a nonzero exit code in the case of fn main(), and a test failure in the case of the tests.

Support in fn main() and #[test] was implemented many releases ago. However, the support within documentation tests was limited to doctests that have an explicit fn main().

In this release, full support for ? in doctests has been added. Now, you can write this in your documentation tests:

/// ```rust
/// use std::io;
/// let mut input = String::new();
/// io::stdin().read_line(&mut input)?;
/// # Ok::<(), io::Error>(())
/// ```
fn my_func() {}

You still have to specify the error type being used at the bottom of the documentation test.

Custom attributes accept arbitrary token streams

Procedural macros in Rust can define custom attributes that they consume. Until now, such attributes were restricted to being trees of paths and literals according to a specific syntax, like:

#[foo(bar)]
#[foo = "bar"]
#[foo = 0]
#[foo(bar = true)]
#[foo(bar, baz(quux, foo = "bar"))]

Unlike procedural macros, these helper attributes could not accept arbitrary token streams in delimiters, so you could not write #[range(0..10)] or #[bound(T: MyTrait)]. Procedural macro crates would instead use strings for specifying syntaxes like this, e.g. #[range("0..10")]

With this Rust release, custom attributes #[attr($tokens)] now accept arbitrary token streams in $tokens, bringing them on par with macros. If you're the author of a procedural macro crate, please check if your custom attributes have unnecessary strings in their syntax and if they can be better expressed with token streams.

TryFrom and TryInto

The TryFrom and TryInto traits were stabilized to allow fallible type conversions.

For example, the from_be_bytes and related methods on integer types take arrays, but data is often read in via slices. Converting between slices and arrays is tedious to do manually. With the new traits, it can be done inline with .try_into().

let num = u32::from_be_bytes(slice.try_into()?);

For conversions that cannot fail, such as u8 to u32, the Infallible type was added. This also permits a blanket implementation of TryFrom for all existing From implementations. In the future, we hope to turn Infallible into an alias for the ! (never) type.

fn before_exec deprecated in favor of unsafe fn pre_exec

On Unix-like systems, the function CommandExt::before_exec allows you to schedule a closure to be run before exec is invoked.

The closure provided will be run in the context of the child process after a fork. This means that resources, such as file descriptors and memory-mapped regions, may get duplicated. In other words, you can now copy a value of a non-Copy type into a different process while retaining the original in the parent. This makes it possible to cause undefined behavior and break libraries assuming non-duplication.

The function before_exec should therefore have been marked as unsafe. In this release of Rust, we have deprecated fn before_exec in favor of the unsafe fn pre_exec. When calling CommandExt::pre_exec, it is your responsibility to make sure that the closure does not violate library invariants by making invalid use of these duplicates. If you provide a library that is in a similar situation as before_exec, consider deprecating and providing an unsafe alternative as well.

Library stabilizations

In 1.34.0, the set of stable atomic integer types was expanded, with signed and unsigned variants from 8 (AtomicU8) to 64 bits now available.

Previously, non-zero unsigned integer types, e.g. NonZeroU8, were stabilized. This gave Option<NonZeroU8> the same size as u8. With this Rust release, signed versions, e.g. NonZeroI8, have been stabilized.

The functions iter::from_fn and iter::successors have been stabilized. The former allows you to construct an iterator from FnMut() -> Option<T>. To pop elements from a vector iteratively, you can now write from_fn(|| vec.pop()). Meanwhile, the latter creates a new iterator where each successive item is computed based on the preceding one.

Additionally, these APIs have become stable:

See the detailed release notes for more details.