use ty::{self, Lift, TyCtxt, Region};
use rustc_data_structures::transitive_relation::TransitiveRelation;
-#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
+#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Default)]
pub struct FreeRegionMap<'tcx> {
// Stores the relation `a < b`, where `a` and `b` are regions.
//
}
impl<'tcx> FreeRegionMap<'tcx> {
- pub fn new() -> Self {
- FreeRegionMap { relation: TransitiveRelation::new() }
- }
-
pub fn is_empty(&self) -> bool {
self.relation.is_empty()
}
}
}
-fn is_free(r: Region) -> bool {
+fn is_free(r: Region<'_>) -> bool {
match *r {
ty::ReEarlyBound(_) | ty::ReFree(_) => true,
_ => false
}
}
-fn is_free_or_static(r: Region) -> bool {
+fn is_free_or_static(r: Region<'_>) -> bool {
match *r {
ty::ReStatic => true,
_ => is_free(r),