@@ -50,7 +50,7 @@ pub struct Builder<'a> {
50
50
51
51
/// A stack of [`Step`]s to run before we can run this builder. The output
52
52
/// of steps is cached in [`Self::cache`].
53
- stack : RefCell < Vec < Box < dyn Any > > > ,
53
+ stack : RefCell < Vec < Box < dyn AnyDebug > > > ,
54
54
55
55
/// The total amount of time we spent running [`Step`]s in [`Self::stack`].
56
56
time_spent_on_dependencies : Cell < Duration > ,
@@ -69,6 +69,21 @@ impl Deref for Builder<'_> {
69
69
}
70
70
}
71
71
72
+ /// This trait is similar to `Any`, except that it also exposes the underlying
73
+ /// type's [`Debug`] implementation.
74
+ ///
75
+ /// (Trying to debug-print `dyn Any` results in the unhelpful `"Any { .. }"`.)
76
+ trait AnyDebug : Any + Debug { }
77
+ impl < T : Any + Debug > AnyDebug for T { }
78
+ impl dyn AnyDebug {
79
+ /// Equivalent to `<dyn Any>::downcast_ref`.
80
+ fn downcast_ref < T : Any > ( & self ) -> Option < & T > {
81
+ ( self as & dyn Any ) . downcast_ref ( )
82
+ }
83
+
84
+ // Feel free to add other `dyn Any` methods as necessary.
85
+ }
86
+
72
87
pub trait Step : ' static + Clone + Debug + PartialEq + Eq + Hash {
73
88
/// Result type of `Step::run`.
74
89
type Output : Clone ;
@@ -1101,6 +1116,7 @@ impl<'a> Builder<'a> {
1101
1116
run:: GenerateCompletions ,
1102
1117
run:: UnicodeTableGenerator ,
1103
1118
run:: FeaturesStatusDump ,
1119
+ run:: BootstrapStepCycle ,
1104
1120
) ,
1105
1121
Kind :: Setup => {
1106
1122
describe ! ( setup:: Profile , setup:: Hook , setup:: Link , setup:: Editor )
0 commit comments