File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,20 @@ use std::cmp::Ordering;
2626use std:: mem:: replace;
2727use std:: num:: NonZeroU32 ;
2828
29+ /// *** Adding stability attributes to a new kind of node ***
30+ ///
31+ /// 1. In `<Annotator as Visitor>`, visit the node and call `self.annotate` to record the new
32+ /// stability attribute. This will also do some validity checking for the attributes.
33+ /// 2. If stability attributes should be required, visit the node in
34+ /// `<MissingStabilityAnnotations as Visitor>` and call `self.check_missing_stability`.
35+ /// 3. If using `check_missing_stability`, you'll also need to make sure the node is reachable. In
36+ /// `ReachableContext::propagate_node` in `src/librustc_passes/reachable.rs`, make sure the node
37+ /// is handled. Then, in `<EmbargoVisitor as Visitor>` in `src/librustc_privacy`, visit the node
38+ /// and call `self.reach`.
39+ /// 4. Finally, we need to make sure that stability information is recorded in crate metadata. In
40+ /// `src/librustc_metadata/rmeta/encoder.rs`, make sure that `self.encode_stability(def_id)` is
41+ /// called in the relevant `encode_info_for_[your node]` method.
42+
2943#[ derive( PartialEq ) ]
3044enum AnnotationKind {
3145 // Annotation is required if not inherited from unstable parents.
You can’t perform that action at this time.
0 commit comments