Skip to content

Commit 3ea956b

Browse files
committed
Remove a now-unused trait
1 parent 07b8bbb commit 3ea956b

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
use rustc_data_structures::frozen::Frozen;
22
use rustc_data_structures::transitive_relation::TransitiveRelation;
33
use rustc_infer::infer::canonical::QueryRegionConstraints;
4-
use rustc_infer::infer::free_regions::FreeRegionRelations;
54
use rustc_infer::infer::outlives;
65
use rustc_infer::infer::region_constraints::GenericKind;
76
use rustc_infer::infer::InferCtxt;
87
use rustc_middle::mir::ConstraintCategory;
98
use rustc_middle::traits::query::OutlivesBound;
10-
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt};
9+
use rustc_middle::ty::{self, RegionVid, Ty};
1110
use rustc_span::DUMMY_SP;
1211
use rustc_trait_selection::traits::query::type_op::{self, TypeOp};
1312
use std::rc::Rc;
1413
use type_op::TypeOpOutput;
1514

1615
use crate::{
17-
nll::ToRegionVid,
1816
type_check::constraint_conversion,
1917
type_check::{Locations, MirTypeckRegionConstraints},
2018
universal_regions::UniversalRegions,
@@ -383,21 +381,3 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
383381
}
384382
}
385383
}
386-
387-
/// This trait is used by the `impl-trait` constraint code to abstract
388-
/// over the `FreeRegionMap` from lexical regions and
389-
/// `UniversalRegions` (from NLL)`.
390-
impl<'tcx> FreeRegionRelations<'tcx> for UniversalRegionRelations<'tcx> {
391-
fn sub_free_regions(
392-
&self,
393-
_tcx: TyCtxt<'tcx>,
394-
shorter: ty::Region<'tcx>,
395-
longer: ty::Region<'tcx>,
396-
) -> bool {
397-
let shorter = shorter.to_region_vid();
398-
assert!(self.universal_regions.is_universal_region(shorter));
399-
let longer = longer.to_region_vid();
400-
assert!(self.universal_regions.is_universal_region(longer));
401-
self.outlives(longer, shorter)
402-
}
403-
}

compiler/rustc_infer/src/infer/free_regions.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ impl<'tcx> FreeRegionMap<'tcx> {
6666
/// follows. If we know that `r_b: 'static`, then this function
6767
/// will return true, even though we don't know anything that
6868
/// directly relates `r_a` and `r_b`.
69-
///
70-
/// Also available through the `FreeRegionRelations` trait below.
7169
pub fn sub_free_regions(
7270
&self,
7371
tcx: TyCtxt<'tcx>,
@@ -131,27 +129,6 @@ impl<'tcx> FreeRegionMap<'tcx> {
131129
}
132130
}
133131

134-
/// The NLL region handling code represents free region relations in a
135-
/// slightly different way; this trait allows functions to be abstract
136-
/// over which version is in use.
137-
pub trait FreeRegionRelations<'tcx> {
138-
/// Tests whether `r_a <= r_b`. Both must be free regions or
139-
/// `'static`.
140-
fn sub_free_regions(
141-
&self,
142-
tcx: TyCtxt<'tcx>,
143-
shorter: ty::Region<'tcx>,
144-
longer: ty::Region<'tcx>,
145-
) -> bool;
146-
}
147-
148-
impl<'tcx> FreeRegionRelations<'tcx> for FreeRegionMap<'tcx> {
149-
fn sub_free_regions(&self, tcx: TyCtxt<'tcx>, r_a: Region<'tcx>, r_b: Region<'tcx>) -> bool {
150-
// invoke the "inherent method"
151-
self.sub_free_regions(tcx, r_a, r_b)
152-
}
153-
}
154-
155132
impl<'a, 'tcx> Lift<'tcx> for FreeRegionMap<'a> {
156133
type Lifted = FreeRegionMap<'tcx>;
157134
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<FreeRegionMap<'tcx>> {

0 commit comments

Comments
 (0)