File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
compiler/rustc_privacy/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1423,8 +1423,6 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
14231423 } ;
14241424
14251425 let vis = self . tcx . local_visibility ( local_def_id) ;
1426- let span = self . tcx . def_span ( self . item_def_id . to_def_id ( ) ) ;
1427- let vis_span = self . tcx . def_span ( def_id) ;
14281426 if self . in_assoc_ty && !vis. is_at_least ( self . required_visibility , self . tcx ) {
14291427 let vis_descr = match vis {
14301428 ty:: Visibility :: Public => "public" ,
@@ -1441,6 +1439,8 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
14411439 }
14421440 } ;
14431441
1442+ let span = self . tcx . def_span ( self . item_def_id . to_def_id ( ) ) ;
1443+ let vis_span = self . tcx . def_span ( def_id) ;
14441444 self . tcx . dcx ( ) . emit_err ( InPublicInterface {
14451445 span,
14461446 vis_descr,
@@ -1463,6 +1463,8 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
14631463 } else {
14641464 lint:: builtin:: PRIVATE_BOUNDS
14651465 } ;
1466+ let span = self . tcx . def_span ( self . item_def_id . to_def_id ( ) ) ;
1467+ let vis_span = self . tcx . def_span ( def_id) ;
14661468 self . tcx . emit_node_span_lint (
14671469 lint,
14681470 self . tcx . local_def_id_to_hir_id ( self . item_def_id ) ,
You can’t perform that action at this time.
0 commit comments