22
33// tidy-alphabetical-start
44#![ allow( internal_features) ]
5+ #![ deny( unreachable_pub) ]
56#![ doc( rust_logo) ]
67#![ feature( assert_matches) ]
78#![ feature( box_patterns) ]
@@ -2444,7 +2445,7 @@ mod diags {
24442445 }
24452446 }
24462447
2447- pub struct BorrowckDiags < ' infcx , ' tcx > {
2448+ pub ( crate ) struct BorrowckDiags < ' infcx , ' tcx > {
24482449 /// This field keeps track of move errors that are to be reported for given move indices.
24492450 ///
24502451 /// There are situations where many errors can be reported for a single move out (see
@@ -2468,33 +2469,33 @@ mod diags {
24682469 }
24692470
24702471 impl < ' infcx , ' tcx > BorrowckDiags < ' infcx , ' tcx > {
2471- pub fn new ( ) -> Self {
2472+ pub ( crate ) fn new ( ) -> Self {
24722473 BorrowckDiags {
24732474 buffered_move_errors : BTreeMap :: new ( ) ,
24742475 buffered_mut_errors : Default :: default ( ) ,
24752476 buffered_diags : Default :: default ( ) ,
24762477 }
24772478 }
24782479
2479- pub fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
2480+ pub ( crate ) fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
24802481 self . buffered_diags . push ( BufferedDiag :: Error ( diag) ) ;
24812482 }
24822483
2483- pub fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2484+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
24842485 self . buffered_diags . push ( BufferedDiag :: NonError ( diag) ) ;
24852486 }
24862487 }
24872488
24882489 impl < ' infcx , ' tcx > MirBorrowckCtxt < ' _ , ' _ , ' infcx , ' tcx > {
2489- pub fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
2490+ pub ( crate ) fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
24902491 self . diags . buffer_error ( diag) ;
24912492 }
24922493
2493- pub fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2494+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
24942495 self . diags . buffer_non_error ( diag) ;
24952496 }
24962497
2497- pub fn buffer_move_error (
2498+ pub ( crate ) fn buffer_move_error (
24982499 & mut self ,
24992500 move_out_indices : Vec < MoveOutIndex > ,
25002501 place_and_err : ( PlaceRef < ' tcx > , Diag < ' infcx > ) ,
@@ -2510,16 +2511,19 @@ mod diags {
25102511 }
25112512 }
25122513
2513- pub fn get_buffered_mut_error ( & mut self , span : Span ) -> Option < ( Diag < ' infcx > , usize ) > {
2514+ pub ( crate ) fn get_buffered_mut_error (
2515+ & mut self ,
2516+ span : Span ,
2517+ ) -> Option < ( Diag < ' infcx > , usize ) > {
25142518 // FIXME(#120456) - is `swap_remove` correct?
25152519 self . diags . buffered_mut_errors . swap_remove ( & span)
25162520 }
25172521
2518- pub fn buffer_mut_error ( & mut self , span : Span , diag : Diag < ' infcx > , count : usize ) {
2522+ pub ( crate ) fn buffer_mut_error ( & mut self , span : Span , diag : Diag < ' infcx > , count : usize ) {
25192523 self . diags . buffered_mut_errors . insert ( span, ( diag, count) ) ;
25202524 }
25212525
2522- pub fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2526+ pub ( crate ) fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
25232527 let mut res = None ;
25242528
25252529 // Buffer any move errors that we collected and de-duplicated.
@@ -2553,7 +2557,7 @@ mod diags {
25532557 self . diags . buffered_diags . is_empty ( )
25542558 }
25552559
2556- pub fn has_move_error (
2560+ pub ( crate ) fn has_move_error (
25572561 & self ,
25582562 move_out_indices : & [ MoveOutIndex ] ,
25592563 ) -> Option < & ( PlaceRef < ' tcx > , Diag < ' infcx > ) > {
0 commit comments