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

Topic - Edition

Rust

27 items on 30 Sep 2026
Rust

Trait with associated type with covariant lifetime parameter

trait SomeTrait { type AssociatedType<'a>; } fn shorten<'short, 'long: 'short, T: SomeTrait>(value: T::AssociatedType<'long>) -> T::AssociatedType<'short> { value } This doesn't compile, because the lifetime parameter…

Source: Rust Users Forum vincent-sparks
Rust

How to think about deallocation when you have graph + slotmap?

I have some code that uses a tree of widgets stored in a slotmap. Well, it's technically a graph, not a tree, because I can walk up to parent: Option<WidgetId> or down to children: Vec<WidgetId>. These properties are…

Source: Rust Users Forum RobertN
Rust

Pre-RFC: Anonymous Trait Impls

Hey there, I was just talking briefly in the Rust discord about ideas for an anonymous trait impl concept, here's what we have so far. Sample syntaxes actively in-debate: fn create_trait(id: u32) -> impl Trait { return…

Source: Rust Internals Forum RealRTTV

27 items available