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

Topic - Edition

Rust

3 items on 04 Oct 2026
Rust

Type erasure and dyn lifetime in a NonNull/Box struct field

I'm new to Rust, and I am trying to understand dyn object lifetimes when inside a Box or NonNull. My goal is to write an adapter for a C API. I have a few C struct types: #[repr(C)] struct ConcreteA { // generated by…

Source: Rust Users Forum rhansen
Rust

Arena's and alignment

Hi rustaceans! I wanted to build an arena allocator as a little exercise for myself and I came up with this: use std::{alloc::{Layout, alloc, dealloc, handle_alloc_error}, ptr::NonNull}; use std::cell::Cell; pub struct…

Source: Rust Users Forum cheese_space