Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Some combinations of features fail to build #769

Closed
Jess3Jane opened this issue May 1, 2021 · 3 comments · Fixed by #771
Closed

Some combinations of features fail to build #769

Jess3Jane opened this issue May 1, 2021 · 3 comments · Fixed by #771

Comments

@Jess3Jane
Copy link

What version of regex are you using?

1.5.2, or with regex-syntax 0.6.24 with rust version rustc 1.53.0-nightly (42816d61e 2021-04-24

Describe the bug at a high level.

With default features disabled some feature combinations fail to compile.

What are the steps to reproduce the behavior?

For your Cargo.toml:

[package]
name="test"
version = "0.1.0"
edition = "2018"

[dependencies]
regex-syntax = { version = "0.6.24", default-features = false, features = ["unicode-perl"] }

This will also occur if you select the same feature set through regex:

[package]
name="test"
version = "0.1.0"
edition = "2018"

[dependencies]
regex = { version = "1.5.2", default-features = false, features = ["std", "unicode-perl"] }

What is the actual behavior?

  Compiling regex-syntax v0.6.24
error[E0433]: failed to resolve: use of undeclared crate or module `unicode_tables`
   --> /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.24/src/unicode.rs:351:13
    |
351 |         use unicode_tables::perl_space::WHITE_SPACE;
    |             ^^^^^^^^^^^^^^ use of undeclared crate or module `unicode_tables`

error[E0433]: failed to resolve: use of undeclared crate or module `unicode_tables`
   --> /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.24/src/unicode.rs:375:13
    |
375 |         use unicode_tables::perl_decimal::DECIMAL_NUMBER;
    |             ^^^^^^^^^^^^^^ use of undeclared crate or module `unicode_tables`

error[E0425]: cannot find value `WHITE_SPACE` in this scope
   --> /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.24/src/unicode.rs:352:22
    |
352 |         Ok(hir_class(WHITE_SPACE))
    |                      ^^^^^^^^^^^ not found in this scope
    |
help: consider importing this constant
    |
1   | use crate::unicode_tables::perl_space::WHITE_SPACE;
    |

error[E0425]: cannot find value `DECIMAL_NUMBER` in this scope
   --> /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.24/src/unicode.rs:376:22
    |
376 |         Ok(hir_class(DECIMAL_NUMBER))
    |                      ^^^^^^^^^^^^^^ not found in this scope
    |
help: consider importing this constant
    |
1   | use crate::unicode_tables::perl_decimal::DECIMAL_NUMBER;
    |

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0425, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `regex-syntax`

What is the expected behavior?

The program should compile.

@BurntSushi
Copy link
Member

Ug. Thanks for the report. In my migration to Rust 2018, it has become apparent to me that cargo fix doesn't actually apply to all of the code. On top of that, my understanding is that CI is specifically testing the case you've reported here, so on top of cargo fix not doing what I thought it would do, I also appear to have a false confidence in CI coverage. :-/

I'll get this fixed ASAP.

@BurntSushi
Copy link
Member

Arrgh. Turns out, CI did catch these errors, but the test script doesn't have set -x enabled, so it doesn't actually failed the build.

BurntSushi added a commit that referenced this issue May 1, 2021
When only the unicode-perl feature is enabled, regex-syntax would fail
to build. It turns out that 'cargo fix' doesn't actually fix all
imports. It looks like it only fixes things that it can build in the
current configuration.

Fixes #769, Fixes #770
BurntSushi added a commit that referenced this issue May 1, 2021
When only the unicode-perl feature is enabled, regex-syntax would fail
to build. It turns out that 'cargo fix' doesn't actually fix all
imports. It looks like it only fixes things that it can build in the
current configuration.

Fixes #769, Fixes #770
BurntSushi added a commit that referenced this issue May 1, 2021
When only the unicode-perl feature is enabled, regex-syntax would fail
to build. It turns out that 'cargo fix' doesn't actually fix all
imports. It looks like it only fixes things that it can build in the
current configuration.

Fixes #769, Fixes #770
@BurntSushi
Copy link
Member

This is fixed in regex 1.5.3 on crates.io.

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 a pull request may close this issue.

2 participants