@@ -32,7 +32,7 @@ macro_rules! or_false {
32
32
// The struct contains the information about the anonymous region
33
33
// we are searching for.
34
34
#[ derive( Debug ) ]
35
- pub struct AnonymousArgInfo < ' tcx > {
35
+ pub ( super ) struct AnonymousArgInfo < ' tcx > {
36
36
// the argument corresponding to the anonymous region
37
37
pub arg : & ' tcx hir:: Arg ,
38
38
// the type corresponding to the anonymopus region argument
@@ -47,7 +47,7 @@ pub struct AnonymousArgInfo<'tcx> {
47
47
// This struct contains information regarding the
48
48
// Refree((FreeRegion) corresponding to lifetime conflict
49
49
#[ derive( Debug ) ]
50
- pub struct FreeRegionInfo {
50
+ pub ( super ) struct FreeRegionInfo {
51
51
// def id corresponding to FreeRegion
52
52
pub def_id : DefId ,
53
53
// the bound region corresponding to FreeRegion
@@ -68,7 +68,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
68
68
// i32, which is the type of y but with the anonymous region replaced
69
69
// with 'a, the corresponding bound region and is_first which is true if
70
70
// the hir::Arg is the first argument in the function declaration.
71
- pub fn find_arg_with_region ( & self ,
71
+ pub ( super ) fn find_arg_with_region ( & self ,
72
72
anon_region : Region < ' tcx > ,
73
73
replace_region : Region < ' tcx > )
74
74
-> Option < AnonymousArgInfo > {
@@ -126,7 +126,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
126
126
}
127
127
128
128
// This method returns the DefId and the BoundRegion corresponding to the given region.
129
- pub fn is_suitable_region ( & self , region : Region < ' tcx > ) -> Option < FreeRegionInfo > {
129
+ pub ( super ) fn is_suitable_region ( & self , region : Region < ' tcx > ) -> Option < FreeRegionInfo > {
130
130
131
131
let ( suitable_region_binding_scope, bound_region) = match * region {
132
132
ty:: ReFree ( ref free_region) => ( free_region. scope , free_region. bound_region ) ,
@@ -162,7 +162,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
162
162
// Here, we check for the case where the anonymous region
163
163
// is in the return type.
164
164
// FIXME(#42703) - Need to handle certain cases here.
165
- pub fn is_return_type_anon ( & self ,
165
+ pub ( super ) fn is_return_type_anon ( & self ,
166
166
scope_def_id : DefId ,
167
167
br : ty:: BoundRegion ,
168
168
decl : & hir:: FnDecl )
@@ -185,15 +185,15 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
185
185
// corresponds to self and if yes, we display E0312.
186
186
// FIXME(#42700) - Need to format self properly to
187
187
// enable E0621 for it.
188
- pub fn is_self_anon ( & self , is_first : bool , scope_def_id : DefId ) -> bool {
188
+ pub ( super ) fn is_self_anon ( & self , is_first : bool , scope_def_id : DefId ) -> bool {
189
189
is_first &&
190
190
self . tcx
191
191
. opt_associated_item ( scope_def_id)
192
192
. map ( |i| i. method_has_self_argument ) == Some ( true )
193
193
}
194
194
195
195
// Here we check if the bound region is in Impl Item.
196
- pub fn is_bound_region_in_impl_item ( & self , suitable_region_binding_scope : DefId ) -> bool {
196
+ pub ( super ) fn is_bound_region_in_impl_item ( & self , suitable_region_binding_scope : DefId ) -> bool {
197
197
let container_id = self . tcx
198
198
. associated_item ( suitable_region_binding_scope)
199
199
. container
@@ -211,7 +211,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
211
211
}
212
212
213
213
// This method returns whether the given Region is Named
214
- pub fn is_named_region ( & self , region : Region < ' tcx > ) -> bool {
214
+ pub ( super ) fn is_named_region ( & self , region : Region < ' tcx > ) -> bool {
215
215
match * region {
216
216
ty:: ReFree ( ref free_region) => {
217
217
match free_region. bound_region {
0 commit comments