Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Support Rust edition 2024 #8638

wants to merge 4 commits into from

Conversation

aleb
Copy link

@aleb aleb commented Jul 11, 2025

Fixes #8614

@github-actions github-actions bot added c++ codegen Involving generating code from schema documentation Documentation rust labels Jul 11, 2025
aleb added 4 commits July 11, 2025 14:19
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`
@fliiiix
Copy link
Contributor

fliiiix commented Jul 21, 2025

@aardappel I just tested this (and it looks ok to me) and it would be great if Flatbuffers could also support the 2024 edition

@aardappel
Copy link
Collaborator

I don't know much about Rust, but would it not be possible to put unsafe inside these functions it is now wrapping instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema documentation Documentation rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rust] Address lint unsafe_op_in_unsafe_fn since it is now warn by default in 2024 edition
3 participants