Skip to content

Conversation

@meithecatte
Copy link

Hello. A crater run for rust-lang/rust#150681 has found that your lrlex crate will stop compiling with cfg(test) with the rustc changes being considered. This PR preemptively fixes the issue to minimize disruption.

Let me know if you have any questions.

@ratmice
Copy link
Collaborator

ratmice commented Jan 20, 2026

I don't see why (for future variants added to LexerKind) any reason we would need new variants that aren't Copy, but I'm assuming a different fix could also be to change inspect_lexerkind_cb to take a &LexerKind?

@meithecatte
Copy link
Author

Yup, that would also be a good fix.

@ratmice
Copy link
Collaborator

ratmice commented Jan 20, 2026

I might lean towards future flexibility (Changing the callback function), the only thing I could think of where we might need it was if some variation of a LRStreamingLexer needs a user provided buffer. I don't think it's likely but perhaps the planets align and whatever streaming regex library it uses needs some working space, this might be the right place to put that, and we wouldn't want to be cloning/copying that buffer.

I Might be overthinking it, either way I'm happy with whatever @ltratt thinks.

@ratmice ratmice requested a review from ltratt January 20, 2026 08:54
@ltratt
Copy link
Member

ltratt commented Jan 20, 2026

I've just looked into this -- I admit it took me a while to work out how the current code could work, so I think the rustc fix is a good one! -- and I agree that & is the right fix here.

@ltratt
Copy link
Member

ltratt commented Jan 20, 2026

I will raise a PR for this and make a new release shortly after.

@ltratt
Copy link
Member

ltratt commented Jan 20, 2026

Closed in favour of #621.

@ltratt ltratt closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants