Skip to content
TILens What matters today in tech v0.4.0
Theme
Topics - Rust
Calendar · NOV 2026
‹ Nov 2026 ›
  1. JAN
  2. FEB
  3. MAR
  1. APR
  2. MAY
  3. JUN
  1. JUL
  2. AUG
  3. SEP
  1. OCT
  2. NOV
  3. DEC
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Favorites (0)

Community stream

Community

Problem with lifetimes and traits

I keep getting problems with lifetimes when I use a trait, but not when I directly use a type that implements the trait. I have recreated the problem in a few lines of code, with the inferred types shown. struct Token<'src> { slice: &'src str, } fn…

rust-users-forum

Failed to get address in while loop

Why can't I get address in the while loop? struct Foo { elem1: u32, elem2: String, } fn demo1(x: &mut Foo) { let ref_1 = &mut x.elem1; let ref_2 = &mut x.elem2; let ptr_x = x as *mut Foo; // Ok! } fn demo2(x: &mut Foo) { let ref_1 = &mut x.elem1;…

rust-users-forum

Comparison on a `Box<(dyn Valueable + 'static)>` fails

Should I use a alternative to .cmp(), if so what would be the appropiate tool. I can't seem to figure this out. Code (click for more details) Compiler output (click for more details) 8 posts - 3 participants Read full topic

rust-users-forum

#![restrict(unsafe, modules = "platform::win")] (bikesheddable)

I've recently found myself creating a library which includes some platform-specific ffi usage as well as some much higher-level functionality, which I'd really rather not split into 2 crates. This means I cannot #![forbid(unsafe)] at the top level,…

rust-internals

Borrow checker treating logically immutable reference as mutable

Is there a good reason for the following code to not compile, or is it just a limitation of the borrow checker? And if it is a limit of the borrow checker, is it feasible to un-limit it at some point or should i rely on unsafe blocks? fn main() {…

rust-users-forum

How to represent function with lifetime parameters in trait bounds?

I have a trait (we'll call it WrapFn) that is being implemented for all functions whose parameters satisfy FromValue<'a> and return types satisfy IntoValue<'a>. The point of this trait is to convert a function with complex types, e.g. // using…

rust-users-forum

Configure deny-all lint rule for cargo lints

Recently cargo-lints were stabilized. How do I configure these lints to do the same equivalent of cargo clippy -- -Dwarnings for my CI run? I have checked the lints reference which seems to list all existing lints, and the manifest docs on how to…

rust-users-forum

Is it safe to transmute `Option<MyEnum>` to `u8` and back?

I wonder if the following code is sound: use core::mem::transmute; #[derive(Debug)] #[repr(u8)] enum MyEnum { A, B, C, } const { assert!(size_of::<Option<MyEnum>>() == 1) } let a = Some(MyEnum::B); // SAFETY: ??? let t: u8 = unsafe { transmute(a) };…

rust-users-forum

Given an `impl FromIterator`, find item type

I'm trying to wrap an external generic API, which has a FromRepresentation trait implemented for most primitive types[1]. I'd like to add a way for this wrapper to collect items from this API into a collection. My first idea was "well, every…

rust-users-forum

Combining rustversion, feature, and target_arch checks in cfg_attr

I'm trying to provide a workaround for known-badly-performing Rust versions by using feature(link_llvm_intrinsics) (permitted via RUSTC_BOOTSTRAP on stable compiler builds) but only if a Cargo feature is enabled and only on x86 and x86_64. That is,…

rust-users-forum

Wgpu WriteOnly vs bytemuch vs encase

Ref: rend3-hp/rend3/src/util/scatter_copy.rs at 5480169a3dad0092b8b8da18429358177f3a0470 · John-Nagle/rend3-hp · GitHub I'm trying to update rend3-hp (my fork of abandoned rend3) to wgpu 30, from wgpu 24. There were many breaking changes. I'm down…

rust-users-forum

3 questions for c programmers using rust

why rust? not meant to be an antagonistic question. i’ve personally been messing around with both rust and zig on side projects i’d otherwise use c on what has rust actually changed about the way you write systems code? generally, is there anything…

rust-users-forum

Help trying to compile macrdp via Cargo build

So I've been trying to install macrdp, which seems to be built in Rust, on an Intel iMac. The project was last updated 6 months ago, so it can't be that out-of-date. And the iMac I'm trying to use, while older, is running Sequoia, which isn't that…

rust-users-forum

Frontend is Leptos and backend is Axum, full stack Rust

Someone on peerlist mentioned that he created a web app in Rust "Frontend is Leptos and backend is Axum, full stack Rust" - I've been in web development for over 2 decades now - What's so new and shiny in this Rust framework ? How are things…

rust-users-forum

444 items available