Skip to content

remove #[derive(TryFromU32)] #145495

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 1 commit into
base: master
Choose a base branch
from

Conversation

fee1-dead
Copy link
Member

seems like it could just be replaced with a declarative macro

cc @Zalathar

@rustbot
Copy link
Collaborator

rustbot commented Aug 16, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 16, 2025

Some changes occurred in coverage instrumentation.

cc @Zalathar

@rust-log-analyzer

This comment has been minimized.

seems like it could just be replaced with a declarative macro
@jieyouxu
Copy link
Member

r? @Zalathar

@rustbot rustbot assigned Zalathar and unassigned jieyouxu Aug 16, 2025
@Zalathar
Copy link
Contributor

Is there some reason to do this? I don’t understand the motivation for wanting to make these enums considerably harder to maintain.

@fee1-dead
Copy link
Member Author

fee1-dead commented Aug 16, 2025

procedural macros hurt build times because it feeds tokens to a parser for each procedural macro called for each type. There's no point in using a procedural macro for something this trivial.

There are alternatives to this, if you don't like maintaining two lists (is that really hard? just two lists, and you get compiler errors if one doesn't match the other).

One is to wrap the whole thing in the declarative macro, doable but I don't like how it looks.

The other is to use the upcoming macro-attr to write attributes as declarative macros. That will have to wait until beta bumps and it's an item in my todo list.

On the other hand, one additional procedural macro in rustc_macro, with ui-fulldeps tests seem like a lot of weight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants