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) ]
@@ -2441,7 +2442,7 @@ mod diags {
24412442 }
24422443 }
24432444
2444- pub struct BorrowckDiags < ' infcx , ' tcx > {
2445+ pub ( crate ) struct BorrowckDiags < ' infcx , ' tcx > {
24452446 /// This field keeps track of move errors that are to be reported for given move indices.
24462447 ///
24472448 /// There are situations where many errors can be reported for a single move out (see
@@ -2465,33 +2466,33 @@ mod diags {
24652466 }
24662467
24672468 impl < ' infcx , ' tcx > BorrowckDiags < ' infcx , ' tcx > {
2468- pub fn new ( ) -> Self {
2469+ pub ( crate ) fn new ( ) -> Self {
24692470 BorrowckDiags {
24702471 buffered_move_errors : BTreeMap :: new ( ) ,
24712472 buffered_mut_errors : Default :: default ( ) ,
24722473 buffered_diags : Default :: default ( ) ,
24732474 }
24742475 }
24752476
2476- pub fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
2477+ pub ( crate ) fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
24772478 self . buffered_diags . push ( BufferedDiag :: Error ( diag) ) ;
24782479 }
24792480
2480- pub fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2481+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
24812482 self . buffered_diags . push ( BufferedDiag :: NonError ( diag) ) ;
24822483 }
24832484 }
24842485
24852486 impl < ' infcx , ' tcx > MirBorrowckCtxt < ' _ , ' _ , ' infcx , ' tcx > {
2486- pub fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
2487+ pub ( crate ) fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
24872488 self . diags . buffer_error ( diag) ;
24882489 }
24892490
2490- pub fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2491+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
24912492 self . diags . buffer_non_error ( diag) ;
24922493 }
24932494
2494- pub fn buffer_move_error (
2495+ pub ( crate ) fn buffer_move_error (
24952496 & mut self ,
24962497 move_out_indices : Vec < MoveOutIndex > ,
24972498 place_and_err : ( PlaceRef < ' tcx > , Diag < ' infcx > ) ,
@@ -2507,16 +2508,19 @@ mod diags {
25072508 }
25082509 }
25092510
2510- pub fn get_buffered_mut_error ( & mut self , span : Span ) -> Option < ( Diag < ' infcx > , usize ) > {
2511+ pub ( crate ) fn get_buffered_mut_error (
2512+ & mut self ,
2513+ span : Span ,
2514+ ) -> Option < ( Diag < ' infcx > , usize ) > {
25112515 // FIXME(#120456) - is `swap_remove` correct?
25122516 self . diags . buffered_mut_errors . swap_remove ( & span)
25132517 }
25142518
2515- pub fn buffer_mut_error ( & mut self , span : Span , diag : Diag < ' infcx > , count : usize ) {
2519+ pub ( crate ) fn buffer_mut_error ( & mut self , span : Span , diag : Diag < ' infcx > , count : usize ) {
25162520 self . diags . buffered_mut_errors . insert ( span, ( diag, count) ) ;
25172521 }
25182522
2519- pub fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2523+ pub ( crate ) fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
25202524 let mut res = None ;
25212525
25222526 // Buffer any move errors that we collected and de-duplicated.
@@ -2550,7 +2554,7 @@ mod diags {
25502554 self . diags . buffered_diags . is_empty ( )
25512555 }
25522556
2553- pub fn has_move_error (
2557+ pub ( crate ) fn has_move_error (
25542558 & self ,
25552559 move_out_indices : & [ MoveOutIndex ] ,
25562560 ) -> Option < & ( PlaceRef < ' tcx > , Diag < ' infcx > ) > {
0 commit comments