zachs18
zachs18
> There is a guarantee that the [representation](https://doc.rust-lang.org/stable/std/option/index.html#representation) of `Option` will be the same size as the underlying integer. > > That plus the fact that there is only one...
This appears to have started happening with LLVM 16. cargo bisect-rustc result ```rs searched toolchains nightly-2022-09-17 through nightly-2024-04-28 ******************************************************************************** Regression in nightly-2023-06-15 ******************************************************************************** fetching https://static.rust-lang.org/dist/2023-06-14/channel-rust-nightly-git-commit-hash.txt nightly manifest 2023-06-14: 40 B...
Changing `_mem: [()]` to `_mem: [UnsafeCell]` in `BitSlice` seems to fix the possible miscompilation, but makes Miri mad under Stacked Borrows.
I was going to post the following as an issue on rust-lang/rust, but now I think this is probably not a miscompilation but UB because `bitvec::BitSlice` has only non-interior-mutable fields,...
Here is a mostly-one-to-one C11 translation of the program in the OP that reproduces a segfault on my machine (Ubuntu 24.04, gcc 13.2.0-23ubuntu4, glibc 2.39-0ubuntu8.2), if someone wants to use...
@orlp > How I see it is that you were always using library UB, and the order of the elements being unspecified was just a clarification on what this could...
> wouldn't aliasable boxes mean you could have two boxes pointing to the same memory, then unsoundly get a mutable reference to both at the same time? If I understand...
The by-value `bytemuck::cast` could probably be made const (under a feature gate), like [`bytemuck::must_cast`](https://docs.rs/bytemuck/latest/bytemuck/fn.must_cast.html), though this would AFAICT require changing how the panic message is made for `cast`[^2]. The by-immutable-ref...
Yes, derive macros can emit arbitrary items, essentially. (IIRC this is already used in `bytemuck_derive`, where some derive macros emit some `const _: () = { some static assertion stuff...
```rs use the_macros::*; fn main() { { #[derive(PrintTokens)] #[add_fields({y: u32})] struct Foo { x: u32, } print_tokens() } { #[add_fields({y: u32})] #[derive(PrintTokens)] struct Foo { x: u32, } print_tokens() }...