File tree 2 files changed +11
-3
lines changed
compiler/rustc_privacy/src
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1463,14 +1463,15 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
1463
1463
} ;
1464
1464
1465
1465
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) ;
1467
1466
let span = self . tcx . def_span ( self . item_def_id . to_def_id ( ) ) ;
1468
1467
let vis_span = self . tcx . def_span ( def_id) ;
1469
1468
if self . in_assoc_ty && !vis. is_at_least ( self . required_visibility , self . tcx ) {
1470
1469
let vis_descr = match vis {
1471
1470
ty:: Visibility :: Public => "public" ,
1472
1471
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
+ {
1474
1475
"private"
1475
1476
} else if vis_def_id. is_top_level_module ( ) {
1476
1477
"crate-private"
@@ -1504,7 +1505,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
1504
1505
} ;
1505
1506
self . tcx . emit_spanned_lint (
1506
1507
lint,
1507
- hir_id ,
1508
+ self . tcx . hir ( ) . local_def_id_to_hir_id ( self . item_def_id ) ,
1508
1509
span,
1509
1510
PrivateInterfacesOrBoundsLint {
1510
1511
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