Why is this unaligned?!
I have a struct of two u64's, and the code that tries ref_from_bytes, crashes, even though alignment is 8, and the slice is a multiple of 8. Even if I try a slice multiple of 16 (336..352 instead of 328..344), it still…
Daily edition · Rust
TILens turns technical updates into a focused daily brief: official releases, trusted reporting, and practitioner analysis, deduplicated and organized by topic.
12 articles · 5 sources ·
I have a struct of two u64's, and the code that tries ref_from_bytes, crashes, even though alignment is 8, and the slice is a multiple of 8. Even if I try a slice multiple of 16 (336..352 instead of 328..344), it still…
Sorry for the noob question. But I need to use &str, but can't find a way to concatenate it to return a value. I don't know how to implement the as_str() or just & here as instructed here. (click for more details)…
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…
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)…
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…
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…
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…
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…
We are excited to welcome Dongpo Liu and Ross Sullivan to the Cargo team! Dongpo has contributed to the Rust Project for years across different teams. He has been an important bridge between Cargo and other Rust teams…