Skip to content
TILens What matters today in tech v0.2.0
Theme

Topic - Edition

Rust

6 items on 01 Sep 2026
Rust

Why the `unreachable!()` can't be optimized away?

type Arg = Vec<u8>; #[unsafe(no_mangle)] fn test(this: &mut Option<Arg>, arg: Arg) { *this = Some(arg); let Some(arg) = this else { unreachable!() }; black_box(arg); } With rust v1.98.0, its assembly: test: pushq %r14…

Source: Rust Users Forum TauYip
Rust

What's wrong with this line and why?

fn main() { let name = String::from("hello"); let (name, len) = calc_len(name); println!("{name} : {len}"); } fn calc_len(name:String)->(String,usize) { (name,name.len()) // this one ???? } 7 posts - 5 participants Read…

Source: Rust Users Forum dvine
Rust

Illegal impl block

Can anyone explain why this impl is not allowed? I am trying to make it so I can call functions on my arrays and not have to iterate over it to call functions on the elements of the array. type Bufs<const N: usize> =…

Source: Rust Users Forum Directflare
Rust

Announcing rustup 1.29.1

The rustup team is happy to announce the release of rustup version 1.29.1. Rustup is the recommended tool to install Rust, a programming language that empowers everyone to build reliable and efficient software. What's…

Source: Rust Blog The Rustup Team