-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Regex: Inform user about slow regex! macro #595
Comments
I have built the lint, but I still have to stop it from matching all parts of the macro expansion. @BurntSushi is there an expression that all |
@llogiq Hmm, good question! That's actually pretty tricky to answer. The code is here. I think for the forseeable future, if you find a type with the letters |
Oh, I can already check if an expression is part of the macro expansion. Unfortunately, the lint matches multiple times per |
@llogiq Ah, so you need a uniquely identifying expression? Can you use a type definition? e.g., struct Nfa<'t> |
Hmmm... I think I'll try to use the outer block then (and a Visitor to skip walking when found). |
I have a regex_macro branch with my current code. Even using blocks doesn't keep it from being run multiple times. Either I'll have to go crate-(or at least module-) wide instead of function wide and keep the matched positions in some kind of set to remove the duplicate warnings, or someone finds a better solution. cc @Manishearth |
As discussed in #587, the
regex!
compiler plugin is currently slower than the runtime basedRegex::new
. We should inform the user about that.The text was updated successfully, but these errors were encountered: