Skip to content

Commit 2141e73

Browse files
committed
---
yaml --- r: 272819 b: refs/heads/beta c: d908ff1 h: refs/heads/master i: 272817: 1c1ab59 272815: a7c7dbb
1 parent 1b29f93 commit 2141e73

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 32f251cc1c1ff8721b68b4afe5f86a6bb33c6822
26+
refs/heads/beta: d908ff1759bf27a8a8a99f113a246b8abc61f425
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_privacy/lib.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -615,16 +615,10 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
615615
// decision solely based on the privacy of the method
616616
// invocation.
617617
Some(ast_map::NodeImplItem(ii)) => {
618-
match ii.node {
619-
hir::ImplItemKind::Const(..) |
620-
hir::ImplItemKind::Method(..) => {
621-
let imp = self.tcx.map.get_parent_did(node_id);
622-
match self.tcx.impl_trait_ref(imp) {
623-
Some(..) => hir::Public,
624-
_ => ii.vis
625-
}
626-
}
627-
hir::ImplItemKind::Type(_) => hir::Public,
618+
let imp = self.tcx.map.get_parent_did(node_id);
619+
match self.tcx.impl_trait_ref(imp) {
620+
Some(..) => hir::Public,
621+
_ => ii.vis,
628622
}
629623
}
630624
Some(ast_map::NodeTraitItem(_)) => hir::Public,
@@ -804,8 +798,8 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
804798
// Trait methods are always all public. The only controlling factor
805799
// is whether the trait itself is accessible or not.
806800
ty::TraitContainer(trait_def_id) => {
807-
self.report_error(self.ensure_public(span, trait_def_id,
808-
None, "source trait"));
801+
let msg = format!("source trait `{}`", self.tcx.item_path_str(trait_def_id));
802+
self.report_error(self.ensure_public(span, trait_def_id, None, &msg));
809803
}
810804
}
811805
}

branches/beta/src/test/compile-fail/trait-not-accessible.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct S;
2020
impl m::Pub for S {}
2121

2222
fn g<T: m::Pub>(arg: T) {
23-
arg.f(); //~ ERROR: source trait is private
23+
arg.f(); //~ ERROR: source trait `m::Priv` is private
2424
}
2525

2626
fn main() {

0 commit comments

Comments
 (0)