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;
26
26
use std:: mem:: replace;
27
27
use std:: num:: NonZeroU32 ;
28
28
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
+
29
43
#[ derive( PartialEq ) ]
30
44
enum AnnotationKind {
31
45
// Annotation is required if not inherited from unstable parents.
You can’t perform that action at this time.
0 commit comments