summaryrefslogtreecommitdiffstats
path: root/vendor/regex-syntax/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/regex-syntax/src
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/regex-syntax/src')
-rw-r--r--vendor/regex-syntax/src/hir/mod.rs16
-rw-r--r--vendor/regex-syntax/src/lib.rs2
2 files changed, 13 insertions, 5 deletions
diff --git a/vendor/regex-syntax/src/hir/mod.rs b/vendor/regex-syntax/src/hir/mod.rs
index e5ea3701b..062d4dcab 100644
--- a/vendor/regex-syntax/src/hir/mod.rs
+++ b/vendor/regex-syntax/src/hir/mod.rs
@@ -2481,16 +2481,24 @@ impl Properties {
props.literal = props.literal && p.is_literal();
props.alternation_literal =
props.alternation_literal && p.is_alternation_literal();
- if let Some(ref mut minimum_len) = props.minimum_len {
+ if let Some(minimum_len) = props.minimum_len {
match p.minimum_len() {
None => props.minimum_len = None,
- Some(len) => *minimum_len += len,
+ Some(len) => {
+ // We use saturating arithmetic here because the
+ // minimum is just a lower bound. We can't go any
+ // higher than what our number types permit.
+ props.minimum_len =
+ Some(minimum_len.saturating_add(len));
+ }
}
}
- if let Some(ref mut maximum_len) = props.maximum_len {
+ if let Some(maximum_len) = props.maximum_len {
match p.maximum_len() {
None => props.maximum_len = None,
- Some(len) => *maximum_len += len,
+ Some(len) => {
+ props.maximum_len = maximum_len.checked_add(len)
+ }
}
}
}
diff --git a/vendor/regex-syntax/src/lib.rs b/vendor/regex-syntax/src/lib.rs
index 4953641d7..754858900 100644
--- a/vendor/regex-syntax/src/lib.rs
+++ b/vendor/regex-syntax/src/lib.rs
@@ -138,7 +138,7 @@ The following features are available:
[Unicode's "simple loose matches" specification](https://www.unicode.org/reports/tr18/#Simple_Loose_Matches).
* **unicode-gencat** -
Provide the data for
- [Uncode general categories](https://www.unicode.org/reports/tr44/tr44-24.html#General_Category_Values).
+ [Unicode general categories](https://www.unicode.org/reports/tr44/tr44-24.html#General_Category_Values).
This includes, but is not limited to, `Decimal_Number`, `Letter`,
`Math_Symbol`, `Number` and `Punctuation`.
* **unicode-perl** -