Skip to content

Commit d0a84e0

Browse files
committed
Add some debug printouts to librustc_privacy
1 parent a1e2a55 commit d0a84e0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/librustc_privacy/lib.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ struct PrivacyVisitor<'a, 'tcx: 'a> {
389389
external_exports: ExternalExports,
390390
}
391391

392+
#[derive(Debug)]
392393
enum PrivacyResult {
393394
Allowable,
394395
ExternallyDenied,
@@ -645,9 +646,17 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
645646
/// Guarantee that a particular definition is public. Returns a CheckResult
646647
/// which contains any errors found. These can be reported using `report_error`.
647648
/// If the result is `None`, no errors were found.
648-
fn ensure_public(&self, span: Span, to_check: DefId,
649-
source_did: Option<DefId>, msg: &str) -> CheckResult {
650-
let id = match self.def_privacy(to_check) {
649+
fn ensure_public(&self,
650+
span: Span,
651+
to_check: DefId,
652+
source_did: Option<DefId>,
653+
msg: &str)
654+
-> CheckResult {
655+
debug!("ensure_public(span={:?}, to_check={:?}, source_did={:?}, msg={:?})",
656+
span, to_check, source_did, msg);
657+
let def_privacy = self.def_privacy(to_check);
658+
debug!("ensure_public: def_privacy={:?}", def_privacy);
659+
let id = match def_privacy {
651660
ExternallyDenied => {
652661
return Some((span, format!("{} is private", msg), None))
653662
}

0 commit comments

Comments
 (0)