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

actix-web-location: Use compile_error! to generate feature-related errors #36

Open
ethowitz opened this issue Jan 26, 2022 · 0 comments

Comments

@ethowitz
Copy link
Contributor

We are currently using deprecation warnings to generate compiler messages when either both or neither of the actix-web-v3 and actix-web-v4 features are being compiled. Instead, let's use the compile_error! macro to generate compiler errors:

#[cfg(all(feature = "actix-web-v3", feature = "actix-web-v4"))]
compile_error!("Only one of actix-web-v3 and actix-web-v4 can be used at once.");

#[cfg(not(any(feature = "actix-web-v3", feature = "actix-web-v4")))]
compile_error!("Exactly one of actix-web-v3 or actix-web-v4 must be specified.");
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

No branches or pull requests

1 participant