Walter Smuts

Results 51 comments of Walter Smuts

Nice work! :) Think your `primal-check` change may be incorrect: ``` error[E0599]: no method named `powf` found for type `f64` in the current scope --> /home/walter/.cargo/git/checkouts/primal-4a737820cfafafb5/53d0fdf/src/perfect_power.rs:47:25 | 47 | let...

Interesting. Haven't thought about the case of the `out_of_place` output. That's true, it does apply for it as well. > Forcing all users to do this would be a large...

> Is it allowed to cheat with unsafe? AFAIK the answer is no. The documentation provides two invariants that need to hold: > [Safety](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#safety-2) > * new_len must be less...

Went down a bit of a rabbit hole to find out **WHY** these rules around UB are so strict. The above was enough to convince me that the spec says...

Have a look at that blog post. It outlines situations where you don't necessarily need to read from uninitialised variables for UB to occur. The compiler can do optimisations that...

> The problem I see is that any reasonable implementation of your suggestion would essentially need to do the same. I think the crucial difference is that the rust compiler...

> Is there a way to use MaybeUninit for the output of an out-of-place transform which doesn't require callers to use unsafe code to extract the result? Yes, I showed...

> Will the caller have to call assume_init() themselves in order to make use of RustFFT's output? Nope. This logic can be inside the `process_outofplace_with_scratch_uninit` function. > Or am I...

> If you then want to reuse the output buffer, what do you do then? You can just wrap the output buffer in the `MaybeUninit` again. Something like `let buffer...

> I guess you'd just let the returned output buffer go out of scope, which would release the borrow of the MaybeUninit version of the buffer Notice my suggestion doesn't...