Rust Devblog 261 Apr 2026

Temporarily building an older crate that declares rust-version = "1.80" while you’re on 1.75 .

#!/usr/bin/env cargo-script //! ```cargo //! [dependencies] //! regex = "1.10" //! anyhow = "1.0" //! ``` use regex::Regex; use anyhow::Result; rust devblog 261

// In your proc macro #[proc_macro] pub fn my_macro(input: TokenStream) -> TokenStream let diag = Diagnostic::new(Severity::Error, "This usage is invalid") .help("Try using `foo` instead of `bar`") .emit(); // ... [dependencies] //

let x = 42u32; assert!(x.is_multiple_of(7)); assert!(!x.is_multiple_of(5)); Avoids division by zero — it’s a panic (same as % ). 5. Cargo: --ignore-rust-version flag What’s new: Build crates even if they require a newer Rust version than your current toolchain. ``` use regex::Regex; use anyhow::Result; // In your

if n.is_multiple_of(7) ...

error: This usage is invalid --> src/main.rs:3:1 | 3 | my_macro!(bar); | ^^^^^^^^^^^^^^ help: Try using `foo` instead of `bar` Use span methods to point exactly at the problematic token. 2. Lint stability: #[stable] for lints What’s new: Lints can now be marked stable, meaning they won’t change behavior without an edition bump.