Skip to content

Cargo build error: required because of the requirements on the impl of Pattern<'a> for regex::Regex #834

Answered by BurntSushi
nicolaslazo asked this question in Q&A
Discussion options

You must be logged in to vote

One user in the StackOverflow thread said that

Well hang on. In the SO post you linked, the code there is quite a bit different than the code you posted here. So the fact that it worked for the user on SO doesn't mean anything here, right?

All right, so the code you gave has oodles of compilation errors beyond the one we're looking at. One of the main problems here is that the compiler error you're getting is inscrutable. I don't even understand it. So my next step is to go back to first principles. The problem has something to do with MatchIndices and the fact that Regex isn't working in MatchIndices<'a, Regex>. If you look at its definition, its type parameter P must implement the Pat…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@nicolaslazo
Comment options

@nicolaslazo
Comment options

Comment options

You must be logged in to vote
2 replies
@nicolaslazo
Comment options

@BurntSushi
Comment options

Answer selected by nicolaslazo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants