-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Breaking change in the header! macro not documented #490
Comments
cc @pyfisch as he is the one which added the commits mentioned above |
I'd say this was an oversight. We shouldn't have made a breaking change. A reason making it easier to miss is that all of our internal uses do include a test function. I think part of a fix so as to make sure we don't break the exported |
Sorry, I forgot to add BREAKING CHANGE warnings to the commits. The current behaviour is the intended behaviour. It is impossible (I think so) to add optional parts to a macro without duplicating the definition, since every header should have tests this is no problem for the core of hyper. I think also external headers should have tests, they have been proven useful to discover bugs in header parsing and formatting inside hyper. Using the |
@pyfisch can't the macro be written such that without the test pattern, a dummy empty one is created? macro_rules! header {
( $foo:ty $bar:ty ) => ( header! { $foo $bar test_dummy {} } )
} |
@seanmonstar yes this will probably work. |
There is one problem: you can't have multiple headers with no tests in one module, because there will be multiple |
I guess you can append the |
Joining identifiers like function or module names does not work. |
grumbles something about macros not being hygienic even though they are supposed to be |
I updated to 0.3.15 and my code is now failing due to changes in
header!
macro:This is most likely due to commits efd6c96 and a27e681 which are not listed as breaking changes.
With the new
header!
implementation It seems I must also add a dummy test function when implementing the header which is, IMHO, an unnecessary complication and makes theheader!
macro harder to use. E.g. for my example above:Is this the intended behaviour?
The text was updated successfully, but these errors were encountered: