Stream: t-lang

Topic: const-qualified proc macros?


isHavvy (May 12 2020 at 07:55, on Zulip):

Has anybody done any thinking on eventually allowing const on the procedural macro functions as a way of telling the compiler that it doesn't need to re-run the macro on every compilation if the input of the macro hasn't changed?

Lokathor (May 12 2020 at 08:04, on Zulip):

I was told that if the tokens passed to an invocation match the previous tokens passed it already skips re-running the proc-macro.

isHavvy (May 12 2020 at 08:13, on Zulip):

If that's true, that should definitely be stated clearly in documentation. It could also be useful in the sense that a const-qualified proc macro is guaranteed not to talk to the Internet, but that's a minor benefit.

Vadim Petrochenkov (May 12 2020 at 10:29, on Zulip):

I was told that if the tokens passed to an invocation match the previous tokens passed it already skips re-running the proc-macro.

Vadim Petrochenkov (May 12 2020 at 10:30, on Zulip):

Maybe that's true for rust-analyzer or something like that, but certainly not for rustc.

nikomatsakis (May 12 2020 at 21:15, on Zulip):

That I would say is probably "the goal we're shooting for" more than the status quo :)

nikomatsakis (May 12 2020 at 21:15, on Zulip):

but I don't see any reason it wouldn't work with the query system, once we push it back far enough

Last update: Jun 05 2020 at 22:35UTC