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

gen keyword is reserved in Rust 2024 #306

Closed
azat opened this issue Jul 23, 2024 · 2 comments · Fixed by #323
Closed

gen keyword is reserved in Rust 2024 #306

azat opened this issue Jul 23, 2024 · 2 comments · Fixed by #323

Comments

@azat
Copy link

azat commented Jul 23, 2024

There are couple of issues with schemars and rust 2024:

  • usage of schemars::gen::SchemaGenerator requires ugly syntax schemars::r#gen::SchemaGenerator
  • the derive macro generates gen inside, so it is unusable in 2024

I guess it is better to rename the gen module? Objections?

@GREsau
Copy link
Owner

GREsau commented Aug 12, 2024

I think my preferred fix to this would be to make SchemaSettings available from the crate root (SchemaGenerator is already available from the crate root) so that it can be imported as use schemars::SchemaSettings.

And obviously schemars_derive would need updating to not use the gen module (or any variables called gen)

@GREsau
Copy link
Owner

GREsau commented Aug 21, 2024

This is fixed in 1.0.0-alpha.8 - the gen module is now replaced by the generate module. For now, gen is still available as as a deprecated alias for the sake of backward-compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants