Skip to content

docs: clarify unsupported Anchored::Pattern searches#1362

Merged
BurntSushi merged 3 commits into
rust-lang:masterfrom
marko1olo:docs-unsupported-anchored-starts
Jun 6, 2026
Merged

docs: clarify unsupported Anchored::Pattern searches#1362
BurntSushi merged 3 commits into
rust-lang:masterfrom
marko1olo:docs-unsupported-anchored-starts

Conversation

@marko1olo

Copy link
Copy Markdown
Contributor

Closes #1262.

This expands the MatchErrorKind::UnsupportedAnchored rustdoc with the common Anchored::Pattern failure mode for DFA engines built without per-pattern anchored start states, and points readers at starts_for_each_pattern.

Validation:

  • git show --check --oneline HEAD
  • Static search for starts_for_each_pattern / Anchored::Pattern terminology in
    egex-automata

Not run locally:

  • cargo fmt --check
  • RUSTDOCFLAGS='-D warnings' cargo doc -p regex-automata --no-deps

Reason: this Windows environment does not currently have cargo on PATH. The change is rustdoc-only and limited to
egex-automata/src/util/search.rs.

@BurntSushi BurntSushi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread regex-automata/src/util/search.rs Outdated
/// When this error occurs with [`Anchored::Pattern`], then one common
/// cause is that the underlying regex engine was built without support
/// for anchored starting states for each pattern. For DFA engines, this
/// typically means enabling the `starts_for_each_pattern` configuration

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you turn starts_for_each_pattern into links for hybrid::dfa::Config::starts_for_each_pattern and dfa::dense::Config::starts_for_each_pattern? The visible text should include that path too for each, so that it isn't ambiguous when reading it.

Comment thread regex-automata/src/util/search.rs Outdated
@BurntSushi BurntSushi merged commit 2c7b172 into rust-lang:master Jun 6, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add hint about starts_for_each_pattern to regex_automata::MatchErrorKind::UnsupportedAnchored documentation

2 participants