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

Tracking issue for proc_macro conversion #693

Closed
10 of 11 tasks
jebrosen opened this issue Jul 9, 2018 · 1 comment
Closed
10 of 11 tasks

Tracking issue for proc_macro conversion #693

jebrosen opened this issue Jul 9, 2018 · 1 comment
Labels
nightly breakage Breakage on the nightly channel only
Milestone

Comments

@jebrosen
Copy link
Collaborator

jebrosen commented Jul 9, 2018

Motivation

rocket_codegen currently uses Rust's plugin system, which is slated for future removal and is a leading cause of breakage on nightly Rust. Rocket should move to implementing its code generation through proc_macro and related features for better stability guarantees.

Related issues

Questions/Concerns

  • Forward compatibility, including everything to do with possible changes to feature gates, hygiene, and editions.
  • Hygiene

Progress

Attribute macros:

  • route and its variants (get, put, post, delete, head, patch, options)
  • catch

Custom derives:

  • derive(FromForm)
  • derive(FromFormValue)
  • derive(Responder)
  • derive(UriDisplay)

Bang macros:

Upstream:

Required rustc Features

These unstable features will need to be used by Rocket's proc_macro crate.

  • proc_macro_diagnostic, proc_macro_span. Allows Rocket to provide useful error messages from macros.

These unstable features will need to be used by application crates that use Rocket's macros.

  • proc_macro_hygiene. For macros that expand to non-items or macro definitions, including routes!, catchers!, and uri!, and #[route].
  • decl_macro, for #[route].

Testing

  • All existing tests for attribute syntax, etc.
  • Verify that macros work via all applicable import mechanisms: macro_use (#[macro_use] extern crate rocket;), use_extern_macros (use rocket::macro), and proc_macro_path_invoc (#[derive(rocket::macro)], #[rocket::macro], or rocket::macro!()), and any others missing from this list. Ensure these cases are enough to cover compatibility with consumer crates that target the 2018 edition as well.
@SergioBenitez
Copy link
Member

Note: rust-lang/rust#43081 (comment) is still an issue, and will surely lead to confusion. Also, Rocket is still using private APIs to work around not having an implementation for rust-lang/rust#54373 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nightly breakage Breakage on the nightly channel only
Projects
None yet
Development

No branches or pull requests

2 participants