@@ -14,18 +14,21 @@ use rustc_errors::{Applicability, DiagnosticBuilder};
1414use syntax_pos:: Span ;
1515use syntax:: source_map:: DesugaringKind ;
1616
17- use super :: nll:: explain_borrow:: BorrowExplanation ;
18- use super :: nll:: region_infer:: { RegionName , RegionNameSource } ;
19- use super :: prefixes:: IsPrefixOf ;
20- use super :: WriteKind ;
21- use super :: borrow_set:: BorrowData ;
22- use super :: MirBorrowckCtxt ;
23- use super :: { InitializationRequiringAction , PrefixSet } ;
24- use super :: error_reporting:: { IncludingDowncast , UseSpans } ;
2517use crate :: dataflow:: drop_flag_effects;
2618use crate :: dataflow:: indexes:: { MovePathIndex , MoveOutIndex } ;
2719use crate :: util:: borrowck_errors;
2820
21+ use crate :: borrow_check:: {
22+ nll:: explain_borrow:: BorrowExplanation ,
23+ nll:: region_infer:: { RegionName , RegionNameSource } ,
24+ prefixes:: IsPrefixOf ,
25+ WriteKind ,
26+ borrow_set:: BorrowData ,
27+ MirBorrowckCtxt , InitializationRequiringAction , PrefixSet
28+ } ;
29+
30+ use super :: { IncludingDowncast , UseSpans } ;
31+
2932#[ derive( Debug ) ]
3033struct MoveSite {
3134 /// Index of the "move out" that we found. The `MoveData` can
@@ -46,7 +49,7 @@ enum StorageDeadOrDrop<'tcx> {
4649}
4750
4851impl < ' cx , ' tcx > MirBorrowckCtxt < ' cx , ' tcx > {
49- pub ( super ) fn report_use_of_moved_or_uninitialized (
52+ pub ( in crate :: borrow_check ) fn report_use_of_moved_or_uninitialized (
5053 & mut self ,
5154 location : Location ,
5255 desired_action : InitializationRequiringAction ,
@@ -269,7 +272,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
269272 }
270273 }
271274
272- pub ( super ) fn report_move_out_while_borrowed (
275+ pub ( in crate :: borrow_check ) fn report_move_out_while_borrowed (
273276 & mut self ,
274277 location : Location ,
275278 ( place, span) : ( & Place < ' tcx > , Span ) ,
@@ -326,7 +329,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
326329 err. buffer ( & mut self . errors_buffer ) ;
327330 }
328331
329- pub ( super ) fn report_use_while_mutably_borrowed (
332+ pub ( in crate :: borrow_check ) fn report_use_while_mutably_borrowed (
330333 & mut self ,
331334 location : Location ,
332335 ( place, _span) : ( & Place < ' tcx > , Span ) ,
@@ -368,7 +371,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
368371 err
369372 }
370373
371- pub ( super ) fn report_conflicting_borrow (
374+ pub ( in crate :: borrow_check ) fn report_conflicting_borrow (
372375 & mut self ,
373376 location : Location ,
374377 ( place, span) : ( & Place < ' tcx > , Span ) ,
@@ -614,7 +617,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
614617 ///
615618 /// > cannot borrow `a.u` (via `a.u.z.c`) as immutable because it is also borrowed as
616619 /// > mutable (via `a.u.s.b`) [E0502]
617- pub ( super ) fn describe_place_for_conflicting_borrow (
620+ pub ( in crate :: borrow_check ) fn describe_place_for_conflicting_borrow (
618621 & self ,
619622 first_borrowed_place : & Place < ' tcx > ,
620623 second_borrowed_place : & Place < ' tcx > ,
@@ -722,7 +725,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
722725 /// short a lifetime. (But sometimes it is more useful to report
723726 /// it as a more direct conflict between the execution of a
724727 /// `Drop::drop` with an aliasing borrow.)
725- pub ( super ) fn report_borrowed_value_does_not_live_long_enough (
728+ pub ( in crate :: borrow_check ) fn report_borrowed_value_does_not_live_long_enough (
726729 & mut self ,
727730 location : Location ,
728731 borrow : & BorrowData < ' tcx > ,
@@ -1478,7 +1481,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14781481 result
14791482 }
14801483
1481- pub ( super ) fn report_illegal_mutation_of_borrowed (
1484+ pub ( in crate :: borrow_check ) fn report_illegal_mutation_of_borrowed (
14821485 & mut self ,
14831486 location : Location ,
14841487 ( place, span) : ( & Place < ' tcx > , Span ) ,
@@ -1537,7 +1540,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15371540 /// assigned; `err_place` is a place providing a reason why
15381541 /// `place` is not mutable (e.g., the non-`mut` local `x` in an
15391542 /// assignment to `x.f`).
1540- pub ( super ) fn report_illegal_reassignment (
1543+ pub ( in crate :: borrow_check ) fn report_illegal_reassignment (
15411544 & mut self ,
15421545 _location : Location ,
15431546 ( place, span) : ( & Place < ' tcx > , Span ) ,
@@ -2080,7 +2083,7 @@ enum AnnotatedBorrowFnSignature<'tcx> {
20802083impl < ' tcx > AnnotatedBorrowFnSignature < ' tcx > {
20812084 /// Annotate the provided diagnostic with information about borrow from the fn signature that
20822085 /// helps explain.
2083- pub ( super ) fn emit (
2086+ pub ( in crate :: borrow_check ) fn emit (
20842087 & self ,
20852088 cx : & mut MirBorrowckCtxt < ' _ , ' tcx > ,
20862089 diag : & mut DiagnosticBuilder < ' _ > ,
0 commit comments