Fixing invalid_regex with invalid UTF8. Also, adding more test cases
This commit is contained in:
parent
dc17e7317b
commit
ffc2bc83b0
3 changed files with 26 additions and 13 deletions
|
|
@ -177,7 +177,7 @@ fn check_set<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, utf8: bool) {
|
|||
}
|
||||
|
||||
fn check_regex<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, utf8: bool) {
|
||||
let mut parser = regex_syntax::ParserBuilder::new().unicode(true).utf8(!utf8).build();
|
||||
let mut parser = regex_syntax::ParserBuilder::new().unicode(true).utf8(utf8).build();
|
||||
|
||||
if let ExprKind::Lit(lit) = expr.kind {
|
||||
if let LitKind::Str(ref r, style) = lit.node {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue