Repository: lalrpop/lalrpop (language: rust)

Issue:
Regex version 1.8.0 breaks build 
Yesterday the regex crate updated it's version to 1.8.0. As a result lalrpop is no longer able to parse correctly. 
A issue on the regex crate has already been opened here https://github.com/rust-lang/regex/issues/982 
As noted by the author this seems to to only occur when no unicode feature flag is set on the regex-syntax dependency, which seems to be the case here, default_features = false.

Output:

```
Caused by:
  process didn't exit successfully: `<...>/build-script-build` (exit status: 1)
  --- stdout
  processing file `<...>/cel.lalrpop`
  Phase `Grammar validation` begun
  Phase `Grammar validation` completed in 0.000351976 seconds
  Phase `Grammar resolution` begun
  Phase `Grammar resolution` completed in 0.000095088 seconds
  Phase `Precedence expansion` begun
  Phase `Precedence expansion` completed in 0.000054054 seconds
  Phase `Macro expansion` begun
  Phase `Macro expansion` completed in 0.000255872 seconds
  Phase `Token check` begun
  /<...>/cel.lalrpop:8:4: 8:16 error: invalid regular expression: regex parse error:
      \s*
      ^^
  error: Unicode-aware Perl class not found (make sure the unicode-perl feature is enabled)

  --- stderr
       r"\s*" => { },
       ~~~~~~~~~~~~~
    
   
   ```


Discussion / hints:
I tried to fix this myself but i could not get the project to build on my machine. 
steps taken:

```
git clone git@github.com:lalrpop/lalrpop.git
edit `lalrpop/Cargo.toml` and `lalrpop-util/Cargo.toml` to pin the regex version to `=1.7.3`
cargo build # works fine
use the local path as the dependency
get the following errors while compiling
```

```
error[E0369]: binary operation `==` cannot be applied to type `std::result::Result<Top, lalrpop_util::ParseError<usize, Tok<'_>, tok::Error>>`
  --> lalrpop/lalrpop/src/parser/lrgrammar.rs:69:13
   |
69 |             assert_eq!(___ascent, ___parse_table);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |             |
   |             std::result::Result<Top, lalrpop_util::ParseError<usize, Tok<'_>, tok::Error>>
   |             std::result::Result<Top, lalrpop_util::ParseError<usize, Tok<'_>, tok::Error>>
   |
note: an implementation of `PartialEq` might be missing for `Top`
  --> lalrpop/lalrpop/src/parser/mod.rs:26:1
   |
26 | pub enum Top {
   | ^^^^^^^^^^^^ must implement `PartialEq`
   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Top` with `#[derive(PartialEq)]`
  --> lalrpop/lalrpop/src/parser/mod.rs:26:1
   |
26 | #[derive(PartialEq)]
   |

error[E0277]: `Top` doesn't implement `std::fmt::Debug`
  --> lalrpop/lalrpop/src/parser/lrgrammar.rs:69:13
   |
69 |             assert_eq!(___ascent, ___parse_table);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Top` cannot be formatted using `{:?}`
   |
   = help: the trait `std::fmt::Debug` is not implemented for `Top`
   = note: add `#[derive(Debug)]` to `Top` or manually `impl std::fmt::Debug for Top`
   = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Top` with `#[derive(Debug)]`
  --> lalrpop/lalrpop/src/parser/mod.rs:26:1
   |
26 | #[derive(Debug)]
   |

error[E0277]: the trait bound `Tokenizer<'_>: Clone` is not satisfied
  --> lalrpop/lalrpop/src/parser/mod.rs:42:27
   |
42 |             .parse(input, tokenizer)
   |              -----        ^^^^^^^^^ the trait `Clone` is not implemented for `Tokenizer<'_>`
   |              |
   |              required by a bound introduced by this call
...
51 |     let mut grammar = parser!(input, 0, Grammar, StartGrammar)?;
   |                       ---------------------------------------- in this macro invocation
   |
   = note: required for `std::iter::Chain<std::iter::Once<std::result::Result<(usize, Tok<'_>, usize), tok::Error>>, Tokenizer<'_>>` to implement `Clone`
note: required by a bound in `lrgrammar::___parse___Top::TopParser::parse`
  --> lalrpop/lalrpop/src/parser/lrgrammar.rs:59:24
   |
49 |         pub fn parse<
   |                ----- required by a bound in this
...
59 |             ___TOKENS: Clone,
   |                        ^^^^^ required by this bound in `TopParser::parse`
   = note: this error originates in the macro `parser` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Tokenizer<'_>` with `#[derive(Clone)]`
  --> lalrpop/lalrpop/src/tok/mod.rs:113:1
   |
113| #[derive(Clone)]
   |

error[E0277]: the trait bound `Tokenizer<'_>: Clone` is not satisfied
  --> lalrpop/lalrpop/src/parser/mod.rs:42:27
   |
42 |             .parse(input, tokenizer)
   |              -----        ^^^^^^^^^ the trait `Clone` is not implemented for `Tokenizer<'_>`
   |              |
   |              required by a bound introduced by this call
...
62 |     parser!(input, offset, Pattern, StartPattern)
   |     --------------------------------------------- in this macro invocation
   |
   = note: required for `std::iter::Chain<std::iter::Once<std::result::Result<(usize, Tok<'_>, usize), tok::Error>>, Tokenizer<'_>>` to implement `Clone`
note: required by a bound in `lrgrammar::___parse___Top::TopParser::parse`
  --> lalrpop/lalrpop/src/parser/lrgrammar.rs:59:24
   |
49 |         pub fn parse<
   |                ----- required by a bound in this
...
59 |             ___TOKENS: Clone,
   |                        ^^^^^ required by this bound in `TopParser::parse`
   = note: this error originates in the macro `parser` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Tokenizer<'_>` with `#[derive(Clone)]`
  --> lalrpop/lalrpop/src/tok/mod.rs:113:1
   |
113| #[derive(Clone)]
   |

error[E0277]: the trait bound `Tokenizer<'_>: Clone` is not satisfied
  --> lalrpop/lalrpop/src/parser/mod.rs:42:27
   |
42 |             .parse(input, tokenizer)
   |              -----        ^^^^^^^^^ the trait `Clone` is not implemented for `Tokenizer<'_>`
   |              |
   |              required by a bound introduced by this call
...
66 |     parser!(input, offset, MatchMapping, StartMatchMapping)
   |     ------------------------------------------------------- in this macro invocation
   |
   = note: required for `std::iter::Chain<std::iter::Once<std::result::Result<(usize, Tok<'_>, usize), tok::Error>>, Tokenizer<'_>>` to implement `Clone`
note: required by a bound in `lrgrammar::___parse___Top::TopParser::parse`
  --> lalrpop/lalrpop/src/parser/lrgrammar.rs:59:24
   |
49 |         pub fn parse<
   |                ----- required by a bound in this
...
59 |             ___TOKENS: Clone,
   |                        ^^^^^ required by this bound in `TopParser::parse`
   = note: this error originates in the macro `parser` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Tokenizer<'_>` with `#[derive(Clone)]`
  --> lalrpop/lalrpop/src/tok/mod.rs:113:1
   |
113| #[derive(Clone)]
   |
   ```
Judging from the issue in regex it would seem the correct way to fix this would be to add enable the 'unicode-perl' feature on regex-syntax :thinking: 
Just `unicode-perl` is not enough. Enabling only that feature results in another error:
```
  lalrpop-test/src/match_section.lalrpop:20:6: 20:18 error: invalid regular expression: regex parse error:
      (?i)[a-z]+
          ^^^^^
  error: Unicode-aware case insensitivity matching is not available (make sure the unicode-case feature is enabled)
```
Instead of finding the minimal set of necessary features, I'd just enable the `unicode` feature, which automatically enables all the unicode related sub-features.

Fix patch:
diff --git a/lalrpop/Cargo.toml b/lalrpop/Cargo.toml
index 1304683b7..387f242e4 100644
--- a/lalrpop/Cargo.toml
+++ b/lalrpop/Cargo.toml
@@ -24,7 +24,7 @@ is-terminal = "0.4.2"
 itertools = { version = "0.10", default_features = false, features = ["use_std"] }
 petgraph = { version = "0.6", default_features = false }
 regex = { version = "1", default_features = false, features = ["std"] }
-regex-syntax = { version = "0.6", default_features = false }
+regex-syntax = { version = "0.6", default_features = false, features = ["unicode"] }
 string_cache = { version = "0.8", default_features = false }
 term = { version = "0.7", default_features = false }
 tiny-keccak = { version = "2.0.2", features = ["sha3"] }


Test patch: