Document feature gate checking#2750
Conversation
|
|
||
| ### Checking `GatedSpans` | ||
|
|
||
| `check_crate` iterates over `sess.psess.gated_spans`: |
There was a problem hiding this comment.
this make it seem like it's not a continuation of line 65... maybe line 65 could have a link to this, or that the content of this section should be added under line 65
There was a problem hiding this comment.
Oh, that's right, I changed the location of the section and added a link just in case
src/feature-gate-ck.md
Outdated
| - [`rustc_attr_parsing/src/attributes/cfg.rs`] defines | ||
| `find_gated_cfg`/`gate_cfg` to reject gated `cfg`s. |
There was a problem hiding this comment.
I see find_gated_cfg is defined elsewhere
There was a problem hiding this comment.
Ah, I changed it to rustc_feature::find_gated_cfg. Thank you.
src/feature-gate-ck.md
Outdated
| - **Accepted** features are recorded but do not require nightly. On | ||
| stable/beta they trigger the "already stabilized" diagnostic. |
There was a problem hiding this comment.
how do I follow the logic to verify that the diagnostic only happens on stable/beta
|
I would add a date-check and also change the filename, perhaps |
reddevilmidzy
left a comment
There was a problem hiding this comment.
thank you for the review
src/feature-gate-ck.md
Outdated
| - [`rustc_attr_parsing/src/attributes/cfg.rs`] defines | ||
| `find_gated_cfg`/`gate_cfg` to reject gated `cfg`s. |
There was a problem hiding this comment.
Ah, I changed it to rustc_feature::find_gated_cfg. Thank you.
|
|
||
| ### Checking `GatedSpans` | ||
|
|
||
| `check_crate` iterates over `sess.psess.gated_spans`: |
There was a problem hiding this comment.
Oh, that's right, I changed the location of the section and added a link just in case
src/feature-gate-ck.md
Outdated
| - **Accepted** features are recorded but do not require nightly. On | ||
| stable/beta they trigger the "already stabilized" diagnostic. |
|
thanks... learned a lot reviewing this just needs a git conflict fix |
Co-authored-by: Tshepang Mbambo <hopsi@tuta.io>
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Resolved the conflict by rebasing, I learned a lot while documenting it too. 😃 |
|
There is another chapter on feature gates, as well as other mentions of feature gates in the book. I wonder how we can harmonize them, because they, at the moment, mostly don't know about each other. |
I was thinking about that early in the process, but I seem to have forgotten about it 😅 These two topics are related to feature gates, but they cover different topics. So, I'll keep the current document location and add sentences and links to connect them! |
close: #1158
I tried to document it by looking at the code, and I welcome any feedback 😀
r? rustc-dev-guide