diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-06-05 18:53:17 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-07-22 15:34:00 +0200 |
| commit | 9ca1c618794b3da0603ffedff488cd42a32c4eb6 (patch) | |
| tree | c6fe2bded54dc421dca17017d444d28e19a4b98b | |
| parent | 07afe91fda3df8e3b7bbb14006a64d136627f33c (diff) | |
| download | rust-9ca1c618794b3da0603ffedff488cd42a32c4eb6.tar.gz rust-9ca1c618794b3da0603ffedff488cd42a32c4eb6.zip | |
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.
| -rw-r--r-- | src/librustc/middle/stability.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 30553d62719..6d3bc7fb68c 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -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); } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index e6bc3218897..17e6b2c2e12 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -980,6 +980,10 @@ impl CodeMap { mac_span.lo <= span.lo && span.hi <= mac_span.hi }); + debug!("span_allows_unstable: span: {:?} call_site: {:?} callee: {:?}", + (span.lo, span.hi), + (info.call_site.lo, info.call_site.hi), + info.callee.span.map(|x| (x.lo, x.hi))); debug!("span_allows_unstable: from this expansion? {}, allows unstable? {}", span_comes_from_this_expansion, info.callee.allow_internal_unstable); |
