11//! This query borrow-checks the MIR to (further) ensure it is not broken.
22
33#![ allow( internal_features) ]
4+ #![ deny( unreachable_pub) ]
45#![ feature( rustdoc_internals) ]
56#![ doc( rust_logo) ]
67#![ feature( assert_matches) ]
@@ -2433,7 +2434,7 @@ mod diags {
24332434 }
24342435 }
24352436
2436- pub struct BorrowckDiags < ' tcx > {
2437+ pub ( crate ) struct BorrowckDiags < ' tcx > {
24372438 /// This field keeps track of move errors that are to be reported for given move indices.
24382439 ///
24392440 /// There are situations where many errors can be reported for a single move out (see
@@ -2457,33 +2458,33 @@ mod diags {
24572458 }
24582459
24592460 impl < ' tcx > BorrowckDiags < ' tcx > {
2460- pub fn new ( ) -> Self {
2461+ pub ( crate ) fn new ( ) -> Self {
24612462 BorrowckDiags {
24622463 buffered_move_errors : BTreeMap :: new ( ) ,
24632464 buffered_mut_errors : Default :: default ( ) ,
24642465 buffered_diags : Default :: default ( ) ,
24652466 }
24662467 }
24672468
2468- pub fn buffer_error ( & mut self , diag : Diag < ' tcx > ) {
2469+ fn buffer_error ( & mut self , diag : Diag < ' tcx > ) {
24692470 self . buffered_diags . push ( BufferedDiag :: Error ( diag) ) ;
24702471 }
24712472
2472- pub fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
2473+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
24732474 self . buffered_diags . push ( BufferedDiag :: NonError ( diag) ) ;
24742475 }
24752476 }
24762477
24772478 impl < ' cx , ' tcx > MirBorrowckCtxt < ' cx , ' tcx > {
2478- pub fn buffer_error ( & mut self , diag : Diag < ' tcx > ) {
2479+ pub ( crate ) fn buffer_error ( & mut self , diag : Diag < ' tcx > ) {
24792480 self . diags . buffer_error ( diag) ;
24802481 }
24812482
2482- pub fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
2483+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
24832484 self . diags . buffer_non_error ( diag) ;
24842485 }
24852486
2486- pub fn buffer_move_error (
2487+ pub ( crate ) fn buffer_move_error (
24872488 & mut self ,
24882489 move_out_indices : Vec < MoveOutIndex > ,
24892490 place_and_err : ( PlaceRef < ' tcx > , Diag < ' tcx > ) ,
@@ -2499,16 +2500,16 @@ mod diags {
24992500 }
25002501 }
25012502
2502- pub fn get_buffered_mut_error ( & mut self , span : Span ) -> Option < ( Diag < ' tcx > , usize ) > {
2503+ pub ( crate ) fn get_buffered_mut_error ( & mut self , span : Span ) -> Option < ( Diag < ' tcx > , usize ) > {
25032504 // FIXME(#120456) - is `swap_remove` correct?
25042505 self . diags . buffered_mut_errors . swap_remove ( & span)
25052506 }
25062507
2507- pub fn buffer_mut_error ( & mut self , span : Span , diag : Diag < ' tcx > , count : usize ) {
2508+ pub ( crate ) fn buffer_mut_error ( & mut self , span : Span , diag : Diag < ' tcx > , count : usize ) {
25082509 self . diags . buffered_mut_errors . insert ( span, ( diag, count) ) ;
25092510 }
25102511
2511- pub fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2512+ pub ( crate ) fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
25122513 let mut res = None ;
25132514
25142515 // Buffer any move errors that we collected and de-duplicated.
@@ -2542,7 +2543,7 @@ mod diags {
25422543 self . diags . buffered_diags . is_empty ( )
25432544 }
25442545
2545- pub fn has_move_error (
2546+ pub ( crate ) fn has_move_error (
25462547 & self ,
25472548 move_out_indices : & [ MoveOutIndex ] ,
25482549 ) -> Option < & ( PlaceRef < ' tcx > , Diag < ' tcx > ) > {
0 commit comments