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

推荐订阅源

Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
量子位
腾讯CDC
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
B
Blog
S
SegmentFault 最新的问题
P
Privacy & Cybersecurity Law Blog
T
Threatpost
博客园 - 聂微东
T
Tailwind CSS Blog
The Last Watchdog
The Last Watchdog
C
Check Point Blog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
爱范儿
爱范儿
IT之家
IT之家
S
Secure Thoughts
M
MIT News - Artificial intelligence
NISL@THU
NISL@THU
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
有赞技术团队
有赞技术团队
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
Schneier on Security
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
雷峰网
雷峰网
Project Zero
Project Zero
博客园 - Franky
H
Heimdal Security Blog
A
About on SuperTechFans
Security Latest
Security Latest
Webroot Blog
Webroot Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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.35.0
The Rust Release Team · 2019-05-23 · via Rust Blog

The Rust team is happy to announce a new version of Rust, 1.35.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.35.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, and check out the detailed release notes for 1.35.0 on GitHub.

What's in 1.35.0 stable

The highlight of this release is the implementation of the FnOnce, FnMut, and Fn closure traits for Box<dyn FnOnce>, Box<dyn FnMut>, and Box<dyn Fn> respectively. Additionally, closures may now be coerced to unsafe function pointers. The dbg! macro introduced in Rust 1.32.0 can now also be called without arguments. Moreover, there were a number of standard library stabilizations. Read on for a few highlights, or see the detailed release notes for additional information.

Fn* closure traits implemented for Box<dyn Fn*>

In Rust 1.35.0, the FnOnce, FnMut, and the Fn traits are now implemented for Box<dyn FnOnce>, Box<dyn FnMut>, and Box<dyn Fn> respectively.

Previously, if you wanted to call the function stored in a boxed closure, you had to use FnBox. This was because instances of Box<dyn FnOnce> and friends did not implement the respective Fn* traits. This also meant that it was not possible to pass boxed functions to code expecting an implementor of a Fn trait, and you had to create temporary closures to pass them down.

This was ultimately due to a limitation in the compiler's ability to reason about such implementations, which has since been fixed with the introduction of unsized locals.

With this release, you can now use boxed functions in places that expect items implementing a function trait.

The following code now works:

fn foo(x: Box<dyn Fn(u8) -> u8>) -> Vec<u8> {
    vec![1, 2, 3, 4].into_iter().map(x).collect()
}

Furthermore, you can now directly call Box<dyn FnOnce> objects:

fn foo(x: Box<dyn FnOnce()>) {
    x()
}

Coercing closures to unsafe fn pointers

Since Rust 1.19.0, it has been possible to coerce closures that do not capture from their environment into function pointers. For example, you may write:

fn twice(x: u8, f: fn(u8) -> u8) -> u8 {
    f(f(x))
}

fn main() {
    assert_eq!(42, twice(0, |x| x + 21));
}

This has however not extended to unsafe function pointers. With this release of Rust, you may now do so. For example:

/// The safety invariants are those of the `unsafe fn` pointer passed.
unsafe fn call_unsafe_fn_ptr(f: unsafe fn()) {
    f()
}

fn main() {
    // SAFETY: There are no invariants.
    // The closure is statically prevented from doing unsafe things.
    unsafe {
        call_unsafe_fn_ptr(|| {
            dbg!();
        });
    }
}

Calling dbg!() with no argument

For the benefit of all the occasional and frequent "print debuggers" out there, Rust 1.32.0 saw the release of the dbg! macro. To recap, the macro allows you to quickly inspect the value of some expression with context. For example, when running:

fn main() {
    let mut x = 0;

    if dbg!(x == 1) {
        x += 1;
    }

    dbg!(x);
}

...you would see:

[src/main.rs:4] x == 1 = false
[src/main.rs:8] x = 0

As seen in the previous section, where the higher order function call_unsafe_fn_ptr is called, you may now also call dbg! without passing any arguments. This is useful when tracing what branches your application takes. For example, with:

fn main() {
    let condition = true;

    if condition {
        dbg!();
    }
}

...you would see:

[src/main.rs:5]

Library stabilizations

In 1.35.0, a number of APIs have become stable.

In addition, some implementations were added and other changes occurred as well. See the detailed release notes for more details.

Copy the sign of a floating point number onto another

With this release, new methods copysign have been added to the floating point primitive types f32 and f64:

As the name suggests, you can use these to copy the sign of one number onto another. For example:

fn main() {
    assert_eq!(3.5_f32.copysign(-0.42), -3.5);
}

Check whether a Range contains a value

Rust 1.35.0 contains a few freshly minted methods on the Range types:

With these, you can easily check whether a given value exists in a range. For example, you may write:

fn main() {
    if (0..=10).contains(&5) {
        println!("Five is included in zero to ten.");
    }
}

Map and split a borrowed RefCell value in two

With Rust 1.35.0, you can now map and split the borrowed value of a RefCell into multiple borrows for different components of the borrowed data:

Replace the value of a RefCell through a closure

This release introduces a convenience method replace_with on RefCell:

With it, you can more ergonomically map and replace the current value of the cell and get back the old value as a result.

Hash a pointer or reference by address, not value

In this release, we have introduced:

This function takes a raw pointer and hashes it. Using ptr::hash, you can avoid hashing the pointed-to value of a reference and instead hash the address.

Copy the contents of an Option<&T>

From the very beginning with Rust 1.0.0, the methods Option::cloned for Option<&T> and Option<&mut T> have allowed you to clone the contents in case of Some(_). However, cloning can sometimes be an expensive operation and the methods opt.cloned() provided no hints to that effect.

With this release of Rust, we introduced:

The functionality of opt.copied() is the same as for opt.cloned(). However, calling the method requires that T: Copy. Using this method, you can make sure that code stops compiling should T no longer implements Copy.

Changes in Clippy

In this release of Rust, Clippy (a collection of lints to catch common mistakes and improve your Rust code) added a new lint drop_bounds. This lint triggers when you add a bound T: Drop to a generic function. For example:

fn foo<T: Drop>(x: T) {}

Having a bound T: Drop is almost always a mistake as it excludes types, such as u8, which have trivial drop-glues. Moreover, T: Drop does not account for types like String not having interesting destructor behavior directly but rather as a result of embedding types, such as Vec<u8>, that do.

In addition to drop_bounds, this release of Clippy split the lintredundant_closure into redundant_closure and redundant_closure_for_method_calls.

See the detailed release notes for Clippy for more details.

Changes in Cargo

See the detailed release notes for Cargo for more details.

Contributors to 1.35.0

Many people came together to create Rust 1.35.0. We couldn't have done it without all of you. Thanks!