You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current version is not actually important - the important version is when you are *stabilizing* a feature.
115
+
The current version is not actually important – the important version is when you are *stabilizing* a feature.
115
116
4. Prevent usage of the new feature unless the feature gate is set.
116
117
You can check it in most places in the compiler using the expression
117
118
```
118
-
tcx.sess.features.borrow().$feature_name
119
+
tcx.sess.features().borrow().$feature_name
119
120
```
120
121
121
122
If the feature gate is not set, you should either maintain the pre-feature behavior or raise an error, depending on what makes sense.
122
-
5. Add a test that the feature can't be used without a feature gate, under `src/test/compile-fail/feature-gate-$feature_name.rs`.
123
+
5. Add a test to ensure the feature cannot be used without a feature gate, by creating `feature-gate-$feature_name.rs` and `feature-gate-$feature_name.stderr` fiels under the `src/test/ui/feature-gates` directory.
123
124
6. Add a section to the unstable book, in `src/doc/unstable-book/src/language-features/$feature_name.md`.
124
125
7. Write a lots of tests for the new feature. PRs without tests will not be accepted!
125
126
8. Get your PR reviewed and land it. You have now successfully implemented a feature in Rust!
0 commit comments