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