@@ -19,14 +19,7 @@ use syntax::symbol::kw;
19
19
use syntax_pos:: Span ;
20
20
use syntax_pos:: symbol:: Symbol ;
21
21
22
- use self :: outlives_suggestion:: OutlivesSuggestionBuilder ;
23
-
24
- pub mod outlives_suggestion;
25
-
26
- mod region_name;
27
- mod var_name;
28
-
29
- crate use self :: region_name:: { RegionName , RegionNameSource , RegionErrorNamingCtx } ;
22
+ use super :: { OutlivesSuggestionBuilder , RegionName , RegionNameSource , RegionErrorNamingCtx } ;
30
23
31
24
impl ConstraintDescription for ConstraintCategory {
32
25
fn description ( & self ) -> & ' static str {
@@ -61,36 +54,36 @@ enum Trace {
61
54
/// Various pieces of state used when reporting borrow checker errors.
62
55
pub struct ErrorReportingCtx < ' a , ' b , ' tcx > {
63
56
/// The region inference context used for borrow chekcing this MIR body.
64
- region_infcx : & ' b RegionInferenceContext < ' tcx > ,
57
+ pub ( super ) region_infcx : & ' b RegionInferenceContext < ' tcx > ,
65
58
66
59
/// The inference context used for type checking.
67
- infcx : & ' b InferCtxt < ' a , ' tcx > ,
60
+ pub ( super ) infcx : & ' b InferCtxt < ' a , ' tcx > ,
68
61
69
62
/// The MIR def we are reporting errors on.
70
- mir_def_id : DefId ,
63
+ pub ( super ) mir_def_id : DefId ,
71
64
72
65
/// The MIR body we are reporting errors on (for convenience).
73
- body : & ' b Body < ' tcx > ,
66
+ pub ( super ) body : & ' b Body < ' tcx > ,
74
67
75
68
/// User variable names for MIR locals (where applicable).
76
69
local_names : & ' b IndexVec < Local , Option < Symbol > > ,
77
70
78
71
/// Any upvars for the MIR body we have kept track of during borrow checking.
79
- upvars : & ' b [ Upvar ] ,
72
+ pub ( super ) upvars : & ' b [ Upvar ] ,
80
73
}
81
74
82
75
/// Information about the various region constraints involved in a borrow checker error.
83
76
#[ derive( Clone , Debug ) ]
84
77
pub struct ErrorConstraintInfo {
85
78
// fr: outlived_fr
86
- fr : RegionVid ,
87
- fr_is_local : bool ,
88
- outlived_fr : RegionVid ,
89
- outlived_fr_is_local : bool ,
79
+ pub ( super ) fr : RegionVid ,
80
+ pub ( super ) fr_is_local : bool ,
81
+ pub ( super ) outlived_fr : RegionVid ,
82
+ pub ( super ) outlived_fr_is_local : bool ,
90
83
91
84
// Category and span for best blame constraint
92
- category : ConstraintCategory ,
93
- span : Span ,
85
+ pub ( super ) category : ConstraintCategory ,
86
+ pub ( super ) span : Span ,
94
87
}
95
88
96
89
impl < ' tcx > RegionInferenceContext < ' tcx > {
@@ -368,7 +361,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
368
361
/// ```
369
362
///
370
363
/// Here we would be invoked with `fr = 'a` and `outlived_fr = `'b`.
371
- pub ( super ) fn report_error < ' a > (
364
+ pub ( in crate :: borrow_check ) fn report_error < ' a > (
372
365
& ' a self ,
373
366
body : & Body < ' tcx > ,
374
367
local_names : & IndexVec < Local , Option < Symbol > > ,
0 commit comments