Skip to content

Commit bd8e94a

Browse files
authored
Link to feature_err in stability section (#1022)
1 parent a090b28 commit bd8e94a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/implementing_new_features.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ 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`].
142+
For an example of adding an error, see [#81015].
142143

143144
For features introducing new syntax, pre-expansion gating should be used instead.
144145
To do so, extend the [`GatedSpans`] struct, add spans to it during parsing,
@@ -160,6 +161,8 @@ a new unstable feature:
160161
implemented a feature in Rust!
161162

162163
[`GatedSpans`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/struct.GatedSpans.html
164+
[#81015]: https://github.com/rust-lang/rust/pull/81015
165+
[`rustc_session::parse::feature_err`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/parse/fn.feature_err.html
163166
[`rustc_ast_passes::feature_gate::check_crate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast_passes/feature_gate/fn.check_crate.html
164167
[value the stability of Rust]: https://github.com/rust-lang/rfcs/blob/master/text/1122-language-semver.md
165168
[stability in code]: #stability-in-code

0 commit comments

Comments
 (0)