-
Notifications
You must be signed in to change notification settings - Fork 13.6k
mbe: Use concrete type for get_unused_rule
#144292
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
mbe: Use concrete type for get_unused_rule
#144292
Conversation
Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
I think this also eliminates the need in |
…-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? `@petrochenkov`
…-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? ``@petrochenkov``
…-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? ```@petrochenkov```
…-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? ````@petrochenkov````
…-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? `````@petrochenkov`````
Rollup of 10 pull requests Successful merges: - #144173 (Remove tidy checks for `tests/ui/issues/`) - #144234 (Fix broken TLS destructors on 32-bit win7) - #144239 (Clean `rustc/parse/src/lexer` to improve maintainability) - #144247 (coretests/num: use ldexp instead of hard-coding a power of 2) - #144256 (Don't ICE on non-TypeId metadata within TypeId) - #144290 (update tests/ui/SUMMARY.md) - #144292 (mbe: Use concrete type for `get_unused_rule`) - #144298 (coverage: Enlarge empty spans during MIR instrumentation, not codegen) - #144311 (Add powerpc64le-unknown-linux-musl to CI rustc targets) - #144315 (bootstrap: add package.json and package-lock.json to dist tarball) r? `@ghost` `@rustbot` modify labels: rollup
…-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? ``````@petrochenkov``````
Rollup of 10 pull requests Successful merges: - #144173 (Remove tidy checks for `tests/ui/issues/`) - #144234 (Fix broken TLS destructors on 32-bit win7) - #144239 (Clean `rustc/parse/src/lexer` to improve maintainability) - #144247 (coretests/num: use ldexp instead of hard-coding a power of 2) - #144256 (Don't ICE on non-TypeId metadata within TypeId) - #144290 (update tests/ui/SUMMARY.md) - #144292 (mbe: Use concrete type for `get_unused_rule`) - #144298 (coverage: Enlarge empty spans during MIR instrumentation, not codegen) - #144311 (Add powerpc64le-unknown-linux-musl to CI rustc targets) - #144315 (bootstrap: add package.json and package-lock.json to dist tarball) r? `@ghost` `@rustbot` modify labels: rollup try-job: x86_64-gnu-aux
Insofar as we can get that data by downcasting to the concrete type and calling a method, as well? Perhaps. One design question there: when introducing But the
I'd be happy to write the PR for that too, if I can get some feedback on the above design question. |
I'm only saying that it is redundant right now. |
Rollup of 9 pull requests Successful merges: - #144173 (Remove tidy checks for `tests/ui/issues/`) - #144234 (Fix broken TLS destructors on 32-bit win7) - #144239 (Clean `rustc/parse/src/lexer` to improve maintainability) - #144256 (Don't ICE on non-TypeId metadata within TypeId) - #144290 (update tests/ui/SUMMARY.md) - #144292 (mbe: Use concrete type for `get_unused_rule`) - #144298 (coverage: Enlarge empty spans during MIR instrumentation, not codegen) - #144311 (Add powerpc64le-unknown-linux-musl to CI rustc targets) - #144315 (bootstrap: add package.json and package-lock.json to dist tarball) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #144292 - joshtriplett:mbe-use-concrete-type-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? ```````@petrochenkov```````
Rather than adding
get_unused_rule
to theTTMacroExpander
trait, putit on the concrete
MacroRulesMacroExpander
, and downcast to that typevia
Any
in order to call it.Suggested-by: Vadim Petrochenkov vadim.petrochenkov@gmail.com
r? @petrochenkov