1
1
//! This query borrow-checks the MIR to (further) ensure it is not broken.
2
2
3
3
#![ allow( internal_features) ]
4
+ #![ deny( unreachable_pub) ]
4
5
#![ feature( rustdoc_internals) ]
5
6
#![ doc( rust_logo) ]
6
7
#![ feature( assert_matches) ]
@@ -2433,7 +2434,7 @@ mod diags {
2433
2434
}
2434
2435
}
2435
2436
2436
- pub struct BorrowckDiags < ' tcx > {
2437
+ pub ( crate ) struct BorrowckDiags < ' tcx > {
2437
2438
/// This field keeps track of move errors that are to be reported for given move indices.
2438
2439
///
2439
2440
/// There are situations where many errors can be reported for a single move out (see
@@ -2457,33 +2458,33 @@ mod diags {
2457
2458
}
2458
2459
2459
2460
impl < ' tcx > BorrowckDiags < ' tcx > {
2460
- pub fn new ( ) -> Self {
2461
+ pub ( crate ) fn new ( ) -> Self {
2461
2462
BorrowckDiags {
2462
2463
buffered_move_errors : BTreeMap :: new ( ) ,
2463
2464
buffered_mut_errors : Default :: default ( ) ,
2464
2465
buffered_diags : Default :: default ( ) ,
2465
2466
}
2466
2467
}
2467
2468
2468
- pub fn buffer_error ( & mut self , diag : Diag < ' tcx > ) {
2469
+ fn buffer_error ( & mut self , diag : Diag < ' tcx > ) {
2469
2470
self . buffered_diags . push ( BufferedDiag :: Error ( diag) ) ;
2470
2471
}
2471
2472
2472
- pub fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
2473
+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
2473
2474
self . buffered_diags . push ( BufferedDiag :: NonError ( diag) ) ;
2474
2475
}
2475
2476
}
2476
2477
2477
2478
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 > ) {
2479
2480
self . diags . buffer_error ( diag) ;
2480
2481
}
2481
2482
2482
- pub fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
2483
+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' tcx , ( ) > ) {
2483
2484
self . diags . buffer_non_error ( diag) ;
2484
2485
}
2485
2486
2486
- pub fn buffer_move_error (
2487
+ pub ( crate ) fn buffer_move_error (
2487
2488
& mut self ,
2488
2489
move_out_indices : Vec < MoveOutIndex > ,
2489
2490
place_and_err : ( PlaceRef < ' tcx > , Diag < ' tcx > ) ,
@@ -2499,16 +2500,16 @@ mod diags {
2499
2500
}
2500
2501
}
2501
2502
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 ) > {
2503
2504
// FIXME(#120456) - is `swap_remove` correct?
2504
2505
self . diags . buffered_mut_errors . swap_remove ( & span)
2505
2506
}
2506
2507
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 ) {
2508
2509
self . diags . buffered_mut_errors . insert ( span, ( diag, count) ) ;
2509
2510
}
2510
2511
2511
- pub fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2512
+ pub ( crate ) fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2512
2513
let mut res = None ;
2513
2514
2514
2515
// Buffer any move errors that we collected and de-duplicated.
@@ -2542,7 +2543,7 @@ mod diags {
2542
2543
self . diags . buffered_diags . is_empty ( )
2543
2544
}
2544
2545
2545
- pub fn has_move_error (
2546
+ pub ( crate ) fn has_move_error (
2546
2547
& self ,
2547
2548
move_out_indices : & [ MoveOutIndex ] ,
2548
2549
) -> Option < & ( PlaceRef < ' tcx > , Diag < ' tcx > ) > {
0 commit comments