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

Fix failed compilation with --no-default-features #69

Conversation

alexrutar
Copy link
Contributor

@alexrutar alexrutar commented Dec 13, 2024

Currently nucleo_matcher does not compile with --no-default-features because the default values for some enums do not exist with --no-default-features. It is quite surprising to me that this has not been caught before!

I couldn't figure out how to make attribute macros work with conditional compilation so I just wrote out the implementations manually.

It seems that this is not caught in CI because of a cargo bug (maybe rust-lang/cargo#7160 ?) so I guess CI should be fixed too. I don't want to touch the CI file myself though. I had to run

cargo check --package nucleo-matcher --no-default-features

to get the error message. Maybe there is a better way to do this.

@alexrutar
Copy link
Contributor Author

Well, clippy is unhappy about the situation since it wants me to use #[default]; not sure what is best here; I guess just disable the clippy lint locally?

@alexrutar alexrutar force-pushed the fix-no-default-features-compilation branch 2 times, most recently from 447cd60 to b2e1068 Compare December 13, 2024 23:44
@pascalkuthe
Copy link
Member

Ypu can use cfg-attr on the default attribute to appease clippy

@alexrutar alexrutar force-pushed the fix-no-default-features-compilation branch from b2e1068 to c00fdf2 Compare December 14, 2024 08:59
@alexrutar alexrutar changed the title Manually implement Default to fix failed compilation with --no-default-features Fix failed compilation with --no-default-features Dec 14, 2024
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

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

Thanks!

@pascalkuthe pascalkuthe merged commit c36c355 into helix-editor:master Dec 14, 2024
5 checks passed
@alexrutar alexrutar deleted the fix-no-default-features-compilation branch December 16, 2024 11:33
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.

2 participants