Rust ranged patterns can now use exclusive endpoints, written a..b or ..b similar to the Range and RangeTo expression types.Rust ranged patterns can now use exclusive endpoints, written a..b or ..b similar to the Range and RangeTo expression types.

Rust 1.80.0: Exclusive Ranges in Patterns, Stabilized APIs, and More

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

\ If you have a previous version of Rust installed via rustup, you can get 1.80.0 with:

$ 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.80.0.

\ If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (rustup default beta) or the nightly channel (rustup default nightly). Please report any bugs you might come across!

What's in 1.80.0 stable

LazyCell and LazyLock

These "lazy" types delay the initialization of their data until first access. They are similar to the OnceCell and OnceLock types stabilized in 1.70, but with the initialization function included in the cell. This completes the stabilization of functionality adopted into the standard library from the popular lazy_static and once_cell crates.

\ LazyLock is the thread-safe option, making it suitable for places like static values. For example, both the spawn thread and the main scope will see the exact same duration below, since LAZY_TIME will be initialized once, by whichever ends up accessing the static first. Neither use has to know how to initialize it, unlike they would with OnceLock::get_or_init().

use std::sync::LazyLock; use std::time::Instant;  static LAZY_TIME: LazyLock<Instant> = LazyLock::new(Instant::now);  fn main() {     let start = Instant::now();     std::thread::scope(|s| {         s.spawn(|| {             println!("Thread lazy time is {:?}", LAZY_TIME.duration_since(start));         });         println!("Main lazy time is {:?}", LAZY_TIME.duration_since(start));     }); } 

LazyCell does the same thing without thread synchronization, so it doesn't implement Sync, which is needed for static, but it can still be used in thread_local! statics (with distinct initialization per thread). Either type can also be used in other data structures as well, depending on thread-safety needs, so lazy initialization is available everywhere!

Checked cfg names and values

In 1.79, rustc stabilized a --check-cfg flag, and now Cargo 1.80 is enabling those checks for all cfg names and values that it knows (in addition to the well known names and values from rustc). This includes feature names from Cargo.toml as well as new cargo::rustc-check-cfg output from build scripts.

\ Unexpected cfgs are reported by the warn-by-default unexpected_cfgs lint, which is meant to catch typos or other misconfiguration. For example, in a project with an optional rayon dependency, this code is configured for the wrong feature value:

fn main() {     println!("Hello, world!");      #[cfg(feature = "crayon")]     rayon::join(         || println!("Hello, Thing One!"),         || println!("Hello, Thing Two!"),     ); }   warning: unexpected `cfg` condition value: `crayon`  --> src/main.rs:4:11   | 4 |     #[cfg(feature = "crayon")]   |           ^^^^^^^^^^--------   |                     |   |                     help: there is a expected value with a similar name: `"rayon"`   |   = note: expected values for `feature` are: `rayon`   = help: consider adding `crayon` as a feature in `Cargo.toml`   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration   = note: `#[warn(unexpected_cfgs)]` on by default 

The same warning is reported regardless of whether the actual rayon feature is enabled or not.

\ The [lints] table in the Cargo.toml manifest can also be used to extend the list of known names and values for custom cfg. rustc automatically provides the syntax to use in the warning.

[lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(foo, values("bar"))'] } 

\ You can read more about this feature in a previous blog post announcing the availability of the feature on nightly.

Exclusive ranges in patterns

Rust ranged patterns can now use exclusive endpoints, written a..b or ..b similar to the Range and RangeTo expression types. For example, the following patterns can now use the same constants for the end of one pattern and the start of the next:

pub fn size_prefix(n: u32) -> &'static str {     const K: u32 = 10u32.pow(3);     const M: u32 = 10u32.pow(6);     const G: u32 = 10u32.pow(9);     match n {         ..K => "",         K..M => "k",         M..G => "M",         G.. => "G",     } } 

\ Previously, only inclusive (a..=b or ..=b) or open (a..) ranges were allowed in patterns, so code like this would require separate constants for inclusive endpoints like K - 1.

\ Exclusive ranges have been implemented as an unstable feature for a long time, but the blocking concern was that they might add confusion and increase the chance of off-by-one errors in patterns. To that end, exhaustiveness checking has been enhanced to better detect gaps in pattern matching, and new lints non_contiguous_range_endpoints and overlapping_range_endpoints will help detect cases where you might want to switch exclusive patterns to inclusive, or vice versa.

Stabilized APIs

  • impl Default for Rc<CStr>
  • impl Default for Rc<str>
  • impl Default for Rc<[T]>
  • impl Default for Arc<str>
  • impl Default for Arc<CStr>
  • impl Default for Arc<[T]>
  • impl IntoIterator for Box<[T]>
  • impl FromIterator<String> for Box<str>
  • impl FromIterator<char> for Box<str>
  • LazyCell
  • LazyLock
  • Duration::div_duration_f32
  • Duration::div_duration_f64
  • Option::take_if
  • Seek::seek_relative
  • BinaryHeap::as_slice
  • NonNull::offset
  • NonNull::byte_offset
  • NonNull::add
  • NonNull::byte_add
  • NonNull::sub
  • NonNull::byte_sub
  • NonNull::offset_from
  • NonNull::byte_offset_from
  • NonNull::read
  • NonNull::read_volatile
  • NonNull::read_unaligned
  • NonNull::write
  • NonNull::write_volatile
  • NonNull::write_unaligned
  • NonNull::write_bytes
  • NonNull::copy_to
  • NonNull::copy_to_nonoverlapping
  • NonNull::copy_from
  • NonNull::copy_from_nonoverlapping
  • NonNull::replace
  • NonNull::swap
  • NonNull::drop_in_place
  • NonNull::align_offset
  • <[T]>::split_at_checked
  • <[T]>::split_at_mut_checked
  • str::split_at_checked
  • str::split_at_mut_checked
  • str::trim_ascii
  • str::trim_ascii_start
  • str::trim_ascii_end
  • <[u8]>::trim_ascii
  • <[u8]>::trim_ascii_start
  • <[u8]>::trim_ascii_end
  • Ipv4Addr::BITS
  • Ipv4Addr::to_bits
  • Ipv4Addr::from_bits
  • Ipv6Addr::BITS
  • Ipv6Addr::to_bits
  • Ipv6Addr::from_bits
  • Vec::<[T; N]>::into_flattened
  • <[[T; N]]>::as_flattened
  • <[[T; N]]>::as_flattened_mut

These APIs are now stable in const contexts:

  • <[T]>::last_chunk
  • BinaryHeap::new

Other changes

Check out everything that changed in Rust, Cargo, and Clippy.

Contributors to 1.80.0

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


The Rust Release Team

\ Also published here

\ Photo by Lay Naik on Unsplash

Market Opportunity
1 Logo
1 Price(1)
$0.005751
$0.005751$0.005751
+0.66%
USD
1 (1) Live Price Chart
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

IP Hits $11.75, HYPE Climbs to $55, BlockDAG Surpasses Both with $407M Presale Surge!

IP Hits $11.75, HYPE Climbs to $55, BlockDAG Surpasses Both with $407M Presale Surge!

The post IP Hits $11.75, HYPE Climbs to $55, BlockDAG Surpasses Both with $407M Presale Surge! appeared on BitcoinEthereumNews.com. Crypto News 17 September 2025 | 18:00 Discover why BlockDAG’s upcoming Awakening Testnet launch makes it the best crypto to buy today as Story (IP) price jumps to $11.75 and Hyperliquid hits new highs. Recent crypto market numbers show strength but also some limits. The Story (IP) price jump has been sharp, fueled by big buybacks and speculation, yet critics point out that revenue still lags far behind its valuation. The Hyperliquid (HYPE) price looks solid around the mid-$50s after a new all-time high, but questions remain about sustainability once the hype around USDH proposals cools down. So the obvious question is: why chase coins that are either stretched thin or at risk of retracing when you could back a network that’s already proving itself on the ground? That’s where BlockDAG comes in. While other chains are stuck dealing with validator congestion or outages, BlockDAG’s upcoming Awakening Testnet will be stress-testing its EVM-compatible smart chain with real miners before listing. For anyone looking for the best crypto coin to buy, the choice between waiting on fixes or joining live progress feels like an easy one. BlockDAG: Smart Chain Running Before Launch Ethereum continues to wrestle with gas congestion, and Solana is still known for network freezes, yet BlockDAG is already showing a different picture. Its upcoming Awakening Testnet, set to launch on September 25, isn’t just a demo; it’s a live rollout where the chain’s base protocols are being stress-tested with miners connected globally. EVM compatibility is active, account abstraction is built in, and tools like updated vesting contracts and Stratum integration are already functional. Instead of waiting for fixes like other networks, BlockDAG is proving its infrastructure in real time. What makes this even more important is that the technology is operational before the coin even hits exchanges. That…
Share
BitcoinEthereumNews2025/09/18 00:32
Why IPO Genie ($IPO) Is Being Called a Top Crypto Presale by Analysts

Why IPO Genie ($IPO) Is Being Called a Top Crypto Presale by Analysts

IPO Genie ($IPO) is being called a top crypto presale by analysts, offering AI-driven market insights, robust tokenomics, and data-backed investor growth.
Share
Blockchainreporter2025/12/18 22:00
Headwind Helps Best Wallet Token

Headwind Helps Best Wallet Token

The post Headwind Helps Best Wallet Token appeared on BitcoinEthereumNews.com. Google has announced the launch of a new open-source protocol called Agent Payments Protocol (AP2) in partnership with Coinbase, the Ethereum Foundation, and 60 other organizations. This allows AI agents to make payments on behalf of users using various methods such as real-time bank transfers, credit and debit cards, and, most importantly, stablecoins. Let’s explore in detail what this could mean for the broader cryptocurrency markets, and also highlight a presale crypto (Best Wallet Token) that could explode as a result of this development. Google’s Push for Stablecoins Agent Payments Protocol (AP2) uses digital contracts known as ‘Intent Mandates’ and ‘Verifiable Credentials’ to ensure that AI agents undertake only those payments authorized by the user. Mandates, by the way, are cryptographically signed, tamper-proof digital contracts that act as verifiable proof of a user’s instruction. For example, let’s say you instruct an AI agent to never spend more than $200 in a single transaction. This instruction is written into an Intent Mandate, which serves as a digital contract. Now, whenever the AI agent tries to make a payment, it must present this mandate as proof of authorization, which will then be verified via the AP2 protocol. Alongside this, Google has also launched the A2A x402 extension to accelerate support for the Web3 ecosystem. This production-ready solution enables agent-based crypto payments and will help reshape the growth of cryptocurrency integration within the AP2 protocol. Google’s inclusion of stablecoins in AP2 is a massive vote of confidence in dollar-pegged cryptocurrencies and a huge step toward making them a mainstream payment option. This widens stablecoin usage beyond trading and speculation, positioning them at the center of the consumption economy. The recent enactment of the GENIUS Act in the U.S. gives stablecoins more structure and legal support. Imagine paying for things like data crawls, per-task…
Share
BitcoinEthereumNews2025/09/18 01:27