Pass LexerKind by reference.#621
Conversation
At the moment the code happens to work only because of an oversight in rustc: that oversight is likely to be fixed soon (rust-lang/rust#150681).
|
I'm happy to approve. I was able to reproduce the error from the crater log in #620 on current rustc by adding a second variant to Edit: The test worked as expected (failed on the master branch, and worked with this one) |
|
@ratmice Cool, and thanks! So we're confident with this PR merged, we won't trigger the upcoming-rustc change? |
|
If my understanding of the problem is right, adding another variant it should behave the same on both the new and old compilers, since the change seems to be making single variant #[non_exhaustive]` behave as they had multiple variants on the new compiler. I'd still wait for feedback from @meithecatte before release, in case they can conveniently test on the new compiler though, or my understanding is flawed. |
|
I can confirm that with this PR, the tests compile and pass with the compiler changes in question. FWIW, considering that the error only happens under |
|
@meithecatte Thanks for confirming! You're right that it's not super important to release in this case, but at least then we know that no-one who clones the last release will get a surprise when rustc updates. |
At the moment the code happens to work only because of an oversight in rustc: that oversight is likely to be fixed soon (rust-lang/rust#150681).
@meithecatte If you're able to do so, I'd be grateful if you can confirm this addresses the rustc issue properly. If so, I will then make a new release shortly after so that we're not blocking the rustc PR.