move check to the top of the file, where I would expect to find it

Top-down, top-down!
This commit is contained in:
Niko Matsakis 2017-03-20 16:43:54 -04:00
parent 1a87fc2635
commit 8e6b10a6cb

View file

@ -19,6 +19,13 @@ use rustc::ty::{self, TyCtxt};
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 @@ impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for InherentOverlapChecker<'a, 'tcx> {
}
}
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 });
}