Fixes #46983. Fixes bad error message when converting anonymous lifetime to 'static
This commit is contained in:
parent
ee43e6d6c9
commit
cad7b4f450
@ -118,4 +118,17 @@ pub(super) fn try_report_named_anon_conflict(&self) -> Option<ErrorReported> {
|
||||
.emit();
|
||||
return Some(ErrorReported);
|
||||
}
|
||||
|
||||
// This method returns whether the given Region is Named
|
||||
pub(super) fn is_named_region(&self, region: ty::Region<'tcx>) -> bool {
|
||||
match *region {
|
||||
ty::ReStatic => true,
|
||||
ty::ReFree(ref free_region) => match free_region.bound_region {
|
||||
ty::BrNamed(..) => true,
|
||||
_ => false,
|
||||
},
|
||||
ty::ReEarlyBound(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,16 +198,4 @@ pub(super) fn is_bound_region_in_impl_item(
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
// This method returns whether the given Region is Named
|
||||
pub(super) fn is_named_region(&self, region: Region<'tcx>) -> bool {
|
||||
match *region {
|
||||
ty::ReFree(ref free_region) => match free_region.bound_region {
|
||||
ty::BrNamed(..) => true,
|
||||
_ => false,
|
||||
},
|
||||
ty::ReEarlyBound(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user