diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-10-27 18:29:31 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-10-27 18:30:46 -0400 |
| commit | d0a84e05009047bb1801360510b2eae2c4a0aa90 (patch) | |
| tree | 7a24c8fb119f9063826c3e5bf4be128afff7e8ad | |
| parent | a1e2a5538a33577f5845fc8bf56d06c452513245 (diff) | |
Add some debug printouts to librustc_privacy
| -rw-r--r-- | src/librustc_privacy/lib.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index ed8ec27705a..bae963c7701 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -389,6 +389,7 @@ struct PrivacyVisitor<'a, 'tcx: 'a> { external_exports: ExternalExports, } +#[derive(Debug)] enum PrivacyResult { Allowable, ExternallyDenied, @@ -645,9 +646,17 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> { /// Guarantee that a particular definition is public. Returns a CheckResult /// which contains any errors found. These can be reported using `report_error`. /// If the result is `None`, no errors were found. - fn ensure_public(&self, span: Span, to_check: DefId, - source_did: Option<DefId>, msg: &str) -> CheckResult { - let id = match self.def_privacy(to_check) { + fn ensure_public(&self, + span: Span, + to_check: DefId, + source_did: Option<DefId>, + msg: &str) + -> CheckResult { + debug!("ensure_public(span={:?}, to_check={:?}, source_did={:?}, msg={:?})", + span, to_check, source_did, msg); + let def_privacy = self.def_privacy(to_check); + debug!("ensure_public: def_privacy={:?}", def_privacy); + let id = match def_privacy { ExternallyDenied => { return Some((span, format!("{} is private", msg), None)) } |
