Instrumentation in effort to understand treatment of allow_internal_unstable.

It is all `debug!` instrumentation so it should not impose a cost on
non-debug builds.
This commit is contained in:
Felix S. Klock II 2015-06-05 18:53:17 +02:00
parent 07afe91fda
commit 9ca1c61879
2 changed files with 16 additions and 2 deletions

View file

@ -543,9 +543,19 @@ pub fn check_pat(tcx: &ty::ctxt, pat: &ast::Pat,
fn maybe_do_stability_check(tcx: &ty::ctxt, id: ast::DefId, span: Span,
cb: &mut FnMut(ast::DefId, Span, &Option<&Stability>)) {
if !is_staged_api(tcx, id) { return }
if is_internal(tcx, span) { return }
if !is_staged_api(tcx, id) {
debug!("maybe_do_stability_check: \
skipping id={:?} since it is not staged_api", id);
return;
}
if is_internal(tcx, span) {
debug!("maybe_do_stability_check: \
skipping span={:?} since it is internal", span);
return;
}
let ref stability = lookup(tcx, id);
debug!("maybe_do_stability_check: \
inspecting id={:?} span={:?} of stability={:?}", id, span, stability);
cb(id, span, stability);
}