2
2
3
3
// tidy-alphabetical-start
4
4
#![ allow( internal_features) ]
5
+ #![ deny( unreachable_pub) ]
5
6
#![ doc( rust_logo) ]
6
7
#![ feature( assert_matches) ]
7
8
#![ feature( box_patterns) ]
@@ -2444,7 +2445,7 @@ mod diags {
2444
2445
}
2445
2446
}
2446
2447
2447
- pub struct BorrowckDiags < ' infcx , ' tcx > {
2448
+ pub ( crate ) struct BorrowckDiags < ' infcx , ' tcx > {
2448
2449
/// This field keeps track of move errors that are to be reported for given move indices.
2449
2450
///
2450
2451
/// There are situations where many errors can be reported for a single move out (see
@@ -2468,33 +2469,33 @@ mod diags {
2468
2469
}
2469
2470
2470
2471
impl < ' infcx , ' tcx > BorrowckDiags < ' infcx , ' tcx > {
2471
- pub fn new ( ) -> Self {
2472
+ pub ( crate ) fn new ( ) -> Self {
2472
2473
BorrowckDiags {
2473
2474
buffered_move_errors : BTreeMap :: new ( ) ,
2474
2475
buffered_mut_errors : Default :: default ( ) ,
2475
2476
buffered_diags : Default :: default ( ) ,
2476
2477
}
2477
2478
}
2478
2479
2479
- pub fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
2480
+ pub ( crate ) fn buffer_error ( & mut self , diag : Diag < ' infcx > ) {
2480
2481
self . buffered_diags . push ( BufferedDiag :: Error ( diag) ) ;
2481
2482
}
2482
2483
2483
- pub fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2484
+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2484
2485
self . buffered_diags . push ( BufferedDiag :: NonError ( diag) ) ;
2485
2486
}
2486
2487
}
2487
2488
2488
2489
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 > ) {
2490
2491
self . diags . buffer_error ( diag) ;
2491
2492
}
2492
2493
2493
- pub fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2494
+ pub ( crate ) fn buffer_non_error ( & mut self , diag : Diag < ' infcx , ( ) > ) {
2494
2495
self . diags . buffer_non_error ( diag) ;
2495
2496
}
2496
2497
2497
- pub fn buffer_move_error (
2498
+ pub ( crate ) fn buffer_move_error (
2498
2499
& mut self ,
2499
2500
move_out_indices : Vec < MoveOutIndex > ,
2500
2501
place_and_err : ( PlaceRef < ' tcx > , Diag < ' infcx > ) ,
@@ -2510,16 +2511,19 @@ mod diags {
2510
2511
}
2511
2512
}
2512
2513
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 ) > {
2514
2518
// FIXME(#120456) - is `swap_remove` correct?
2515
2519
self . diags . buffered_mut_errors . swap_remove ( & span)
2516
2520
}
2517
2521
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 ) {
2519
2523
self . diags . buffered_mut_errors . insert ( span, ( diag, count) ) ;
2520
2524
}
2521
2525
2522
- pub fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2526
+ pub ( crate ) fn emit_errors ( & mut self ) -> Option < ErrorGuaranteed > {
2523
2527
let mut res = None ;
2524
2528
2525
2529
// Buffer any move errors that we collected and de-duplicated.
@@ -2553,7 +2557,7 @@ mod diags {
2553
2557
self . diags . buffered_diags . is_empty ( )
2554
2558
}
2555
2559
2556
- pub fn has_move_error (
2560
+ pub ( crate ) fn has_move_error (
2557
2561
& self ,
2558
2562
move_out_indices : & [ MoveOutIndex ] ,
2559
2563
) -> Option < & ( PlaceRef < ' tcx > , Diag < ' infcx > ) > {
0 commit comments