Uh oh!
There was an error while loading. Please reload this page.
proc_macro: Fix expand_expr expansion of bool literals - #98463
Conversation
Previously, the expand_expr method would expand bool literals as a `Literal` token containing a `LitKind::Bool`, rather than as an `Ident`. This is not a valid token, and the `LitKind::Bool` case needs to be handled seperately. Tests were added to more deeply compare the streams in the expand-expr test suite to catch mistakes like this in the future.
rust-highfive
commented
Jun 24, 2022
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
mystor
commented
Jun 25, 2022
Oops, I did not mean to open this as a draft. |
wesleywiser
commented
Jul 6, 2022
This looks ok to me but I know very little about proc macros. @mystor are there any compatibility issues with this change that you are aware of? Specifically, I'm imagining something like a proc macro that expects to get a token tree of |
mystor
commented
Jul 7, 2022
I highly doubt that there are any major crates which are using this API, given that it was fairly recently introduced (last november, #87264), and hasn't even been exposed as an unstable API from It appears that only 2 crates even enable the unstable feature (thanks @m-ou-se for helping me search!): https://crates.io/crates/nyar-macro, and https://crates.io/crates/include-transformed. |
eddyb
commented
Jul 9, 2022
@bors r+ |
bors
commented
Jul 9, 2022
bors
commented
Jul 10, 2022
bors
commented
Jul 10, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Jul 10, 2022
Finished benchmarking commit (29554c0): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Previously, the expand_expr method would expand bool literals as a
Literaltoken containing aLitKind::Bool, rather than as anIdent.This is not a valid token, and the
LitKind::Boolcase needs to behandled seperately.
Tests were added to more deeply compare the streams in the expand-expr
test suite to catch mistakes like this in the future.