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

Avoid gated feature checking unconfigured expanded items #32846

Merged

Conversation

jseyfried
Copy link
Contributor

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

*sess.features.borrow_mut() = features;
})
})?;

Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor Author

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.

@nrc nrc added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Apr 12, 2016
@nrc
Copy link
Member

nrc commented Apr 12, 2016

Code looks fine, but @rust-lang/lang should discuss.

@jseyfried
Copy link
Contributor Author

cf #25544

@nikomatsakis
Copy link
Contributor

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. :)

@nrc
Copy link
Member

nrc commented Apr 28, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented Apr 28, 2016

📌 Commit 86f069d has been approved by nrc

@bors
Copy link
Contributor

bors commented Apr 28, 2016

⌛ Testing commit 86f069d with merge 8bd01ad...

@bors
Copy link
Contributor

bors commented Apr 29, 2016

💔 Test failed - auto-win-msvc-64-opt

@jseyfried
Copy link
Contributor Author

@bors retry

@bors
Copy link
Contributor

bors commented Apr 30, 2016

⌛ Testing commit 86f069d with merge c5ec369...

@bors
Copy link
Contributor

bors commented Apr 30, 2016

💔 Test failed - auto-mac-64-nopt-t

@jseyfried
Copy link
Contributor Author

@bors retry

@bors
Copy link
Contributor

bors commented Apr 30, 2016

⌛ Testing commit 86f069d with merge b0aefff...

bors added a commit that referenced this pull request Apr 30, 2016
…ems, r=nrc

Avoid gated feature checking unconfigured expanded items

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Macro-expanded unconfigured items are gated feature checked
5 participants