Skip to content

Commit 8fc2c46

Browse files
committed
regionck: Use methods on RegionCtxt instead of free functions.
1 parent f8ea24e commit 8fc2c46

File tree

2 files changed

+353
-381
lines changed

2 files changed

+353
-381
lines changed

src/librustc_typeck/check/dropck.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use CrateCtxt;
12-
use check::regionck::{self, Rcx};
12+
use check::regionck::RegionCtxt;
1313

1414
use hir::def_id::DefId;
1515
use middle::free_region::FreeRegionMap;
@@ -274,7 +274,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'a, 'tcx>(
274274
/// ensuring that they do not access data nor invoke methods of
275275
/// values that have been previously dropped).
276276
///
277-
pub fn check_safety_of_destructor_if_necessary<'a, 'tcx>(rcx: &mut Rcx<'a, 'tcx>,
277+
pub fn check_safety_of_destructor_if_necessary<'a, 'tcx>(rcx: &mut RegionCtxt<'a, 'tcx>,
278278
typ: ty::Ty<'tcx>,
279279
span: Span,
280280
scope: region::CodeExtent) {
@@ -344,7 +344,7 @@ enum TypeContext {
344344
}
345345

346346
struct DropckContext<'a, 'b: 'a, 'tcx: 'b> {
347-
rcx: &'a mut Rcx<'b, 'tcx>,
347+
rcx: &'a mut RegionCtxt<'b, 'tcx>,
348348
/// types that have already been traversed
349349
breadcrumbs: FnvHashSet<Ty<'tcx>>,
350350
/// span for error reporting
@@ -416,10 +416,8 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'b, 'tcx>(
416416
(0..depth).map(|_| ' ').collect::<String>(),
417417
ty);
418418

419-
regionck::type_must_outlive(cx.rcx,
420-
infer::SubregionOrigin::SafeDestructor(cx.span),
421-
ty,
422-
ty::ReScope(cx.parent_scope));
419+
cx.rcx.type_must_outlive(infer::SubregionOrigin::SafeDestructor(cx.span),
420+
ty, ty::ReScope(cx.parent_scope));
423421

424422
return Ok(());
425423
}

0 commit comments

Comments
 (0)