Dante Broggi

Results 8 comments of Dante Broggi

The `NonZeroU8` is to demonstrate that, if Rust uses a 'size' of 4 for both structs, when compiling `foo`, it would believe that the 4th byte is padding, and thus...

One thing of note is that there is a definite difference between "the Swift calling convention" and `swiftcc`, as mentioned in [this llvm thread](https://groups.google.com/g/llvm-dev/c/epDd2w93kZ0/m/_3YeO380BgAJ), in particular `swiftcc` uses the llvm...

@aciidb0mb3r commented that this should be fixed. If it has, this should be closed.

It seems I forgot to test with the current nix MSRV, as it compiles fine with cargo 1.67.0. I'll push a fix.

Considered relevant during sync: https://stackoverflow.com/questions/9116951/what-is-the-meaning-of-restrict-in-pthread-create

The same problem also occurs with `&=`. c2rust also generates invalid code when casting bool directly to a pointer type (because `boolean as *mut T` is invalid). https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=44a0720a276e962309baf54ba59f759b

The UB is indeed independent of `__thread` but the fix of using `Cell` requires it.

As Prior Art, this could reference Swift's ABI [attributes](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes). In particular, [`@frozen`](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes#frozen) seems equivalent to `#[export] #[repr(Swift)]` on structs (for the appropriate definition of `#[repr(Swift)]`. [`@usableFromInline`](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes#usableFromInline) seems equivalent to `#[export]`...