Make Region::as_var
infallible.
It's what all the call sites require.
This commit is contained in:
parent
9693b178fc
commit
c802694bda
3 changed files with 7 additions and 18 deletions
|
@ -1772,10 +1772,10 @@ impl<'tcx> Region<'tcx> {
|
|||
matches!(self.kind(), ty::ReVar(_))
|
||||
}
|
||||
|
||||
pub fn as_var(self) -> Option<RegionVid> {
|
||||
pub fn as_var(self) -> RegionVid {
|
||||
match self.kind() {
|
||||
ty::ReVar(vid) => Some(vid),
|
||||
_ => None,
|
||||
ty::ReVar(vid) => vid,
|
||||
_ => bug!("expected region {:?} to be of kind ReVar", self),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue