Skip to content
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

rustc warns of unused imports #212

Open
mcandre opened this issue Apr 26, 2023 · 1 comment
Open

rustc warns of unused imports #212

mcandre opened this issue Apr 26, 2023 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Apr 26, 2023

When I construct a regex in a lazy_static, then rustc often presents a spurious warning that the regex import is unused.

I tried moving use regex::Regex; into lazy_static, but that actually makes the compilation hard fail.

I also added a unit test with #[test], but that still triggers the spurious unused import warning.

What are we supposed to do to resolve that?

For context, this problem happens when using lazy_static members inside of a PEG grammar.

(I know, weird to import the regex library into a PEG grammar. But I have my reasons.)

@BurntSushi
Copy link
Member

Can you provide an example that others can reproduce please?

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

No branches or pull requests

2 participants