File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
branches/snap-stage3/src/librustc/middle/typeck Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 2a44a1bd97cbd072646f98eb60db6de08f679f1b
4
+ refs/heads/snap-stage3: d7163985b8c8daccc34cc6213fb621657f1bc50a
5
5
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -653,13 +653,20 @@ pub fn convert_methods(ccx: &CrateCtxt,
653
653
& method_generics. lifetimes ,
654
654
untransformed_rcvr_ty,
655
655
m. self_ty , & m. decl ) ;
656
+
657
+ // if the method specifies a visibility, use that, otherwise
658
+ // inherit the visibility from the impl (so `foo` in `pub impl
659
+ // { fn foo(); }` is public, but private in `priv impl { fn
660
+ // foo(); }`).
661
+ let method_vis = m. vis . inherit_from ( rcvr_visibility) ;
662
+
656
663
ty:: method {
657
664
ident : m. ident ,
658
665
generics : ty_generics ( ccx, None , & m. generics ) ,
659
666
transformed_self_ty : transformed_self_ty,
660
667
fty : fty,
661
668
self_ty : m. self_ty . node ,
662
- vis : m . vis . inherit_from ( rcvr_visibility ) ,
669
+ vis : method_vis ,
663
670
def_id : local_def ( m. id )
664
671
}
665
672
}
You can’t perform that action at this time.
0 commit comments