From 7ebe4ae02d09a333e67cd7afd550cb4109afd4fe Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 18 Jul 2018 09:14:26 -0400 Subject: [PATCH] syntax: update docs to reflect behavior This updates the documentation on `allow_invalid_utf8` to reflect the current behavior of the translator. The old documentation was describing the behavior of regex-syntax 0.5, but it was changed in regex-syntax 0.6. --- regex-syntax/src/hir/translate.rs | 8 ++++---- regex-syntax/src/parser.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/regex-syntax/src/hir/translate.rs b/regex-syntax/src/hir/translate.rs index 7939ab59ad..8fea00b164 100644 --- a/regex-syntax/src/hir/translate.rs +++ b/regex-syntax/src/hir/translate.rs @@ -59,10 +59,10 @@ impl TranslatorBuilder { /// an expression that will only ever match valid UTF-8 (otherwise, the /// translator will return an error). /// - /// Note that currently, even when invalid UTF-8 is banned, the translator - /// will permit a negated ASCII word boundary (i.e., `(?-u:\B)`) even - /// though it can actually match at invalid UTF-8 boundaries. This bug - /// will be fixed on the next semver release. + /// Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII + /// word boundary (uttered as `(?-u:\B)` in the concrete syntax) will cause + /// the parser to return an error. Namely, a negated ASCII word boundary + /// can result in matching positions that aren't valid UTF-8 boundaries. pub fn allow_invalid_utf8( &mut self, yes: bool, diff --git a/regex-syntax/src/parser.rs b/regex-syntax/src/parser.rs index 5b82e3049f..9788ad5573 100644 --- a/regex-syntax/src/parser.rs +++ b/regex-syntax/src/parser.rs @@ -88,10 +88,10 @@ impl ParserBuilder { /// an expression that will only ever match valid UTF-8 (otherwise, the /// parser will return an error). /// - /// Note that currently, even when invalid UTF-8 is banned, the parser - /// will permit a negated ASCII word boundary (i.e., `(?-u:\B)`) even - /// though it can actually match at invalid UTF-8 boundaries. This bug - /// will be fixed on the next semver release. + /// Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII + /// word boundary (uttered as `(?-u:\B)` in the concrete syntax) will cause + /// the parser to return an error. Namely, a negated ASCII word boundary + /// can result in matching positions that aren't valid UTF-8 boundaries. pub fn allow_invalid_utf8(&mut self, yes: bool) -> &mut ParserBuilder { self.hir.allow_invalid_utf8(yes); self