-
Notifications
You must be signed in to change notification settings - Fork 239
Fix some unexpected_cfg lint warnings #5052
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
Conversation
36ee2e1 to
1f2abd0
Compare
1f2abd0 to
1d5a03a
Compare
Gonna make this change in this PR to try and get CI passing again. We can figure out a longer term macro solution later: this is extremely hacky and works in an unintuitive way. |
| options: skip, | ||
| error: DataError, | ||
| #[cfg(skip)] | ||
| #[cfg(not(all()))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: these cfg(skip)s in the invocations of gen_any_buffer_data_constructors! could be better modeled by changing the macro itself to not emit these functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I said in the comments, but I didn't want to figure that out whilst fixing nightly CI.
It appears we are required to include the lint level. Hm. |
|
Can the level be "notice" or "ignore" or something? |
|
We definitely want the lint for unknown directives. The suppression is only for the few we include intentionally. (I don't know why the issue closed and reopened) |
|
@sffc I don't understand, I had previously set the lint to "warn" and you didn't want that, what is the difference between "warn" and what you mean by "notice"? |
This reverts commit 0fce3c8.
|
This fixes all but one case, and that needs to be fixed by improving the macro first. I'm working on that as a separate PR for now. |
| segmenter_lstm = { tagged = "_segmenter_lstm_tag_" } | ||
|
|
||
| [lints.rust] | ||
| unexpected_cfgs = { level = "warn", check-cfg = ['cfg(icu4x_custom_data)'] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is emitted by the build script, why do we need to suppress it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be unconditionally emitted with a "this cfg exists" directive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed now?
| unexpected_cfgs = { level = "warn", check-cfg = ['cfg(icu4x_custom_data)'] } | ||
|
|
||
| [dependencies] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
|
I resolved the comments but I also undid the cfg(skip) changes when fixing merge conflicts since that's going to conflict more. |
Latest Rust has a bunch of warnings around unexpected
cfgkeys, to avoid mistakes and encourage use of features. This can be worked around by documenting deliberate CFG keys in Cargo.toml (or by emitting them from the build script, which I'd rather not introduce).This doesn't fix all of them, we have a ton of
cfg(skip)that we should fix. Perhapscfg(not(any()))for now, though really we should tweak the ctor macros to not need this, the cfg is a hack.