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

libfmt_macros should be renamed to have a rustc_ prefix or moved into librustc_builtin_macros. #71177

Closed
eddyb opened this issue Apr 15, 2020 · 3 comments · Fixed by #72927
Closed
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Apr 15, 2020

For historical reasons we have a crate that looks like it would be part of the standard library, but it's really just a parser for the implementation of format_args!.

cc @petrochenkov

@eddyb eddyb added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 15, 2020
@Mark-Simulacrum
Copy link
Member

❤️ I would also deeply appreciate the removal/merge of this crate. It's what I always hit when trying to find the "real" formatting piece of the compiler, and it's essentially never what I want.

@petrochenkov
Copy link
Contributor

or moved into librustc_builtin_macros

Unfortunately, fmt_macros is also used from rustc_trait_selection due to implementation of the #[on_unimplemented] attribute, and it's undesirable to introduce the dependency rustc_builtin_macros -> rustc_trait_selection.

Possible solutions:

  • Keep it as a separate crate, rename to rustc_parse_format.
  • Merge it into rustc_parse if it doesn't add extra dependencies (need to check).
  • Turn #[rustc_on_unimplemented] into an built-in attribute macro so it does formatting during expansion and trait selection works with some lowered form of it, #[rustc_on_unimplemented_impl] or whatever. Then the crate can be merged into rustc_builtin_macros.

@eddyb
Copy link
Member Author

eddyb commented May 31, 2020

  • Keep it as a separate crate, rename to rustc_parse_format.
  • Merge it into rustc_parse if it doesn't add extra dependencies (need to check).

Either of these seem fine with me, anything else would be overkill, IMO.

@bors bors closed this as completed in 118b505 Jun 6, 2020
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jun 7, 2020
Rename all remaining compiler crates to use the `rustc_foo` pattern

libarena -> librustc_arena
libfmt_macros -> librustc_parse_format
libgraphviz -> librustc_graphviz
libserialize -> librustc_serialize

Closes rust-lang/rust#71177 in particular.
spikespaz pushed a commit to spikespaz/dotwalk-rs that referenced this issue Aug 29, 2024
Rename all remaining compiler crates to use the `rustc_foo` pattern

libarena -> librustc_arena
libfmt_macros -> librustc_parse_format
libgraphviz -> librustc_graphviz
libserialize -> librustc_serialize

Closes rust-lang/rust#71177 in particular.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants