Skip to content

Commit b350d85

Browse files
committed
Link to feature_err in stability section
1 parent 3e731b7 commit b350d85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/implementing_new_features.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ a new unstable feature:
138138

139139
If the feature gate is not set, you should either maintain
140140
the pre-feature behavior or raise an error, depending on
141-
what makes sense.
141+
what makes sense. Errors should generally use [`rustc_session::parse::feature_err`].
142142

143143
For features introducing new syntax, pre-expansion gating should be used instead.
144144
To do so, extend the [`GatedSpans`] struct, add spans to it during parsing,
@@ -160,6 +160,7 @@ a new unstable feature:
160160
implemented a feature in Rust!
161161

162162
[`GatedSpans`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/struct.GatedSpans.html
163+
[`rustc_session::parse::feature_err`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/fn.feature_err.html
163164
[`rustc_ast_passes::feature_gate::check_crate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast_passes/feature_gate/fn.check_crate.html
164165
[value the stability of Rust]: https://github.com/rust-lang/rfcs/blob/master/text/1122-language-semver.md
165166
[stability in code]: #stability-in-code

0 commit comments

Comments
 (0)