Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support thread locals #1311

Open
Nadrieril opened this issue Feb 14, 2025 · 0 comments
Open

Support thread locals #1311

Nadrieril opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Nadrieril
Copy link
Collaborator

This code:

thread_local!(static FOO: u32 = 0);
fn main() {}

Causes this error when translating with charon:

error[E9999]: Unexpected type `ty` for scalar `scalar`

              Context:
               - ty: Binder { value: fn(std::option::Option<&'^0.Named(std::thread::local::{impl#4}::new::'_, "'_") mut std::option::Option<u32>>) -> *const u32, bound_vars: [Region(BrNamed(std::thread::local::{impl#4}::new::'_, '_))] }
               - scalar: alloc4
  |
  = note: ⚠️ This is a bug in Hax's frontend.
          Please report this error to https://github.com/hacspec/hax/issues with some context (e.g. the current crate)!

warning: Hax panicked when translating `Body { ... }`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants