Skip to content

Commit 6409515

Browse files
committed
make util fns private to nice_region_error
1 parent bc9b8f2 commit 6409515

File tree

1 file changed

+8
-8
lines changed
  • src/librustc/infer/error_reporting/nice_region_error

1 file changed

+8
-8
lines changed

src/librustc/infer/error_reporting/nice_region_error/util.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ macro_rules! or_false {
3232
// The struct contains the information about the anonymous region
3333
// we are searching for.
3434
#[derive(Debug)]
35-
pub struct AnonymousArgInfo<'tcx> {
35+
pub(super) struct AnonymousArgInfo<'tcx> {
3636
// the argument corresponding to the anonymous region
3737
pub arg: &'tcx hir::Arg,
3838
// the type corresponding to the anonymopus region argument
@@ -47,7 +47,7 @@ pub struct AnonymousArgInfo<'tcx> {
4747
// This struct contains information regarding the
4848
// Refree((FreeRegion) corresponding to lifetime conflict
4949
#[derive(Debug)]
50-
pub struct FreeRegionInfo {
50+
pub(super) struct FreeRegionInfo {
5151
// def id corresponding to FreeRegion
5252
pub def_id: DefId,
5353
// the bound region corresponding to FreeRegion
@@ -68,7 +68,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
6868
// i32, which is the type of y but with the anonymous region replaced
6969
// with 'a, the corresponding bound region and is_first which is true if
7070
// 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,
7272
anon_region: Region<'tcx>,
7373
replace_region: Region<'tcx>)
7474
-> Option<AnonymousArgInfo> {
@@ -126,7 +126,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
126126
}
127127

128128
// 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> {
130130

131131
let (suitable_region_binding_scope, bound_region) = match *region {
132132
ty::ReFree(ref free_region) => (free_region.scope, free_region.bound_region),
@@ -162,7 +162,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
162162
// Here, we check for the case where the anonymous region
163163
// is in the return type.
164164
// 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,
166166
scope_def_id: DefId,
167167
br: ty::BoundRegion,
168168
decl: &hir::FnDecl)
@@ -185,15 +185,15 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
185185
// corresponds to self and if yes, we display E0312.
186186
// FIXME(#42700) - Need to format self properly to
187187
// 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 {
189189
is_first &&
190190
self.tcx
191191
.opt_associated_item(scope_def_id)
192192
.map(|i| i.method_has_self_argument) == Some(true)
193193
}
194194

195195
// 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 {
197197
let container_id = self.tcx
198198
.associated_item(suitable_region_binding_scope)
199199
.container
@@ -211,7 +211,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
211211
}
212212

213213
// 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 {
215215
match *region {
216216
ty::ReFree(ref free_region) => {
217217
match free_region.bound_region {

0 commit comments

Comments
 (0)