File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
compiler/rustc_privacy/src Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1463,14 +1463,15 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
14631463 } ;
14641464
14651465 let vis = self . tcx . local_visibility ( local_def_id) ;
1466- let hir_id = self . tcx . hir ( ) . local_def_id_to_hir_id ( local_def_id) ;
14671466 let span = self . tcx . def_span ( self . item_def_id . to_def_id ( ) ) ;
14681467 let vis_span = self . tcx . def_span ( def_id) ;
14691468 if self . in_assoc_ty && !vis. is_at_least ( self . required_visibility , self . tcx ) {
14701469 let vis_descr = match vis {
14711470 ty:: Visibility :: Public => "public" ,
14721471 ty:: Visibility :: Restricted ( vis_def_id) => {
1473- if vis_def_id == self . tcx . parent_module ( hir_id) . to_local_def_id ( ) {
1472+ if vis_def_id
1473+ == self . tcx . parent_module_from_def_id ( local_def_id) . to_local_def_id ( )
1474+ {
14741475 "private"
14751476 } else if vis_def_id. is_top_level_module ( ) {
14761477 "crate-private"
@@ -1504,7 +1505,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
15041505 } ;
15051506 self . tcx . emit_spanned_lint (
15061507 lint,
1507- hir_id ,
1508+ self . tcx . hir ( ) . local_def_id_to_hir_id ( self . item_def_id ) ,
15081509 span,
15091510 PrivateInterfacesOrBoundsLint {
15101511 item_span : span,
Original file line number Diff line number Diff line change 1+ // check-pass
2+ // compile-flags: --crate-type=lib
3+
4+ #[ allow( private_bounds) ]
5+ pub trait Foo : FooImpl { }
6+
7+ trait FooImpl { }
You can’t perform that action at this time.
0 commit comments