-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Support Rust edition 2024 #8638
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
Conversation
@aardappel I just tested this (and it looks ok to me) and it would be great if Flatbuffers could also support the 2024 edition |
I don't know much about Rust, but would it not be possible to put |
I also do not have a lot experience in rust tbh. But from reading the error message in #8614 and the docs https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html it is now required to wrap the unsafe calls in a unsafe function see: ![]() And this is what this MR does i guess |
The errors look like: ``` warning[E0133]: call to unsafe function `fbs::flatbuffers::emplace_scalar` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `fbs::flatbuffers::follow_cast_ref` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `fbs::flatbuffers::Follow::follow` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `fbs::flatbuffers::read_scalar_at` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `fbs::flatbuffers::root_unchecked` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `fbs::flatbuffers::size_prefixed_root_unchecked` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `fbs::flatbuffers::Table::<'a>::new` is unsafe and requires unsafe block warning[E0133]: call to unsafe function `std::slice::from_raw_parts` is unsafe and requires unsafe block ```
Ran `goldens/generate_goldens.py`
Ran `scripts/generate_code.py`
Ok, thanks for the clarification! There's unrelated changes in here to the Otherwise LGTM. |
It depends on where we are comfortable to declare unsafe things as safe-enough. To me it looks ok at the moment. Thanks for merging! |
Hmm, looking again at the changes, I see the |
Fixes #8614