Record instances in lint from launch calls.

This commit is contained in:
Sergio Benitez 2017-02-04 13:52:23 -08:00
parent 8b39b88e46
commit ecd72f686e
1 changed files with 6 additions and 0 deletions

View File

@ -179,6 +179,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RocketLint {
.insert(def_id, expr.span);
}
}
if let Some((recvr, _)) = rocket_method_call("launch", cx, expr) {
let instance = recvr.and_then(|r| instance_for(self, r));
self.instances.entry(instance)
.or_insert_with(|| InstanceInfo::default());
}
}
// We collect all of the names and defids for the info structures that