Skip to content

regex!("...") should generate a const instead of a static #18427

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
aochagavia opened this issue Oct 29, 2014 · 2 comments
Closed

regex!("...") should generate a const instead of a static #18427

aochagavia opened this issue Oct 29, 2014 · 2 comments

Comments

@aochagavia
Copy link
Contributor

I am not completely sure about this, but it was strange to get a compiler error when trying to do:

const re: Regex = regex!("42");

The error message is (copied from the plapen):

<anon>:8:19: 8:32 error: constants cannot refer to other statics, insert an intermediate constant instead
<anon>:8 const re: Regex = regex!("42");
                           ^~~~~~~~~~~~~
<anon>:1:1: 12:1 note: in expansion of regex!
<anon>:8:19: 8:32 note: expansion site
error: aborting due to previous error

Shouldn't this work?

@frewsxcv
Copy link
Member

In-tree regex was removed in #21458 . This should probably be moved to https://github.com/rust-lang/regex

@aochagavia
Copy link
Contributor Author

You are right! Thanks!

lnicola pushed a commit to lnicola/rust that referenced this issue Nov 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants