-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Avoid gated feature checking unconfigured expanded items #32846
Avoid gated feature checking unconfigured expanded items #32846
Conversation
*sess.features.borrow_mut() = features; | ||
}) | ||
})?; | ||
|
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.
There is already a second feature gate checking pass just a bit later in the same function (“complete gated feature checking 2”). I'm not sure this first pass is necessary at all. I considered removing it as part of #32791 but then thought I'd do a separate PR.
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.
Good point, I'll remove it.
let it = expand_item_multi_modifier(Annotatable::Item(it), fld); | ||
|
||
expand_annotatable(it, fld) | ||
expand_annotatable(Annotatable::Item(it), fld) |
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.
expand_annotatable
begins with a call to expand_item_multi_modifier
, which is idempotent (cf #21052).
This is unrelated to the rest of the PR.
Code looks fine, but @rust-lang/lang should discuss. |
cf #25544 |
Finally discussed in lang-team meeting. We agree that feature-gated items which are "configured out" by should not generate warnings, whether they result from macro expansion or not. i.e., this PR seems good. :) |
@bors: r+ |
📌 Commit 86f069d has been approved by |
⌛ Testing commit 86f069d with merge 8bd01ad... |
💔 Test failed - auto-win-msvc-64-opt |
@bors retry |
⌛ Testing commit 86f069d with merge c5ec369... |
💔 Test failed - auto-mac-64-nopt-t |
@bors retry |
Avoid gated feature checking unconfigured macro-expanded items (fixes #32840).
Unconfigured items that are not macro-expanded are already not gated feature checked.
r? @nrc