]> git.lizzy.rs Git - rust.git/commitdiff
move `check` to the top of the file, where I would expect to find it
authorNiko Matsakis <niko@alum.mit.edu>
Mon, 20 Mar 2017 20:43:54 +0000 (16:43 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 23 Mar 2017 17:25:45 +0000 (13:25 -0400)
Top-down, top-down!

src/librustc_typeck/coherence/inherent.rs

index e3b4ba9eb1b9e3fc89da9b826cacc3d8579d2b90..9abf233de1f9ee637a8c9d682d56302d52b53e45 100644 (file)
 use syntax::ast;
 use syntax_pos::Span;
 
+pub fn check<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
+    tcx.visit_all_item_likes_in_krate(DepNode::CoherenceCheckImpl,
+                                      &mut InherentCollect { tcx });
+    tcx.visit_all_item_likes_in_krate(DepNode::CoherenceOverlapCheckSpecial,
+                                      &mut InherentOverlapChecker { tcx });
+}
+
 struct InherentCollect<'a, 'tcx: 'a> {
     tcx: TyCtxt<'a, 'tcx, 'tcx>
 }
@@ -348,9 +355,3 @@ fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem) {
     }
 }
 
-pub fn check<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
-    tcx.visit_all_item_likes_in_krate(DepNode::CoherenceCheckImpl,
-                                      &mut InherentCollect { tcx });
-    tcx.visit_all_item_likes_in_krate(DepNode::CoherenceOverlapCheckSpecial,
-                                      &mut InherentOverlapChecker { tcx });
-}