@@ -28,7 +28,7 @@ pub use unique_keys::UniqueKeys;
28
28
pub trait Analysis : ' static {
29
29
/// The type of value this analysis associates with an expression.
30
30
type Value : std:: fmt:: Debug ;
31
- /// Announce any depencies this analysis has on other analyses.
31
+ /// Announce any dependencies this analysis has on other analyses.
32
32
///
33
33
/// The method should invoke `builder.require::<Foo>()` for each other
34
34
/// analysis `Foo` this analysis depends upon.
@@ -48,7 +48,7 @@ pub trait Analysis: 'static {
48
48
/// The `index` indicates the post-order index for the expression, for use in finding
49
49
/// the corresponding information in `results` and `depends`.
50
50
///
51
- /// The return result will be associated with this expression for this analysis,
51
+ /// The returned result will be associated with this expression for this analysis,
52
52
/// and the analyses will continue.
53
53
fn derive (
54
54
& self ,
@@ -287,8 +287,7 @@ pub mod common {
287
287
// If we have not sequenced `type_id` but have a bundle, it means
288
288
// we are in the process of fulfilling its requirements: a cycle.
289
289
if self . result . analyses . contains_key ( & type_id) {
290
- // TODO: Find a better way to identify `A`.
291
- panic ! ( "Cyclic dependency detected: {:?}" , type_id) ;
290
+ panic ! ( "Cyclic dependency detected: {}" , std:: any:: type_name:: <A >( ) ) ;
292
291
}
293
292
// Insert the analysis bundle first, so that we can detect cycles.
294
293
self . result . analyses . insert (
@@ -419,6 +418,7 @@ pub mod common {
419
418
/// Analysis that starts optimistically but is only correct at a fixed point.
420
419
///
421
420
/// Will fail out to `analyse_pessimistic` if the lattice is missing, or `self.fuel` is exhausted.
421
+ /// When successful, the result indicates whether new information was produced for `exprs.last()`.
422
422
fn analyse_optimistic (
423
423
& mut self ,
424
424
exprs : & [ & MirRelationExpr ] ,
@@ -458,6 +458,8 @@ pub mod common {
458
458
}
459
459
460
460
/// Analysis that starts conservatively and can be stopped at any point.
461
+ ///
462
+ /// Result indicates whether new information was produced for `exprs.last()`.
461
463
fn analyse_pessimistic ( & mut self , exprs : & [ & MirRelationExpr ] , depends : & Derived ) -> bool {
462
464
// TODO: consider making iterative, from some `bottom()` up using `join_assign()`.
463
465
self . results . clear ( ) ;
0 commit comments