Skip to content

Commit f1a2f20

Browse files
committed
Remove dead code.
We don't do member constraint checks in regionck anymore. All member constraint checks are done in mir borrowck.
1 parent f2707fe commit f1a2f20

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

compiler/rustc_trait_selection/src/opaque_types.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ pub trait InferCtxtExt<'tcx> {
2323
value_span: Span,
2424
) -> InferOk<'tcx, T>;
2525

26-
fn constrain_opaque_types(&self);
27-
2826
fn constrain_opaque_type(
2927
&self,
3028
opaque_type_key: OpaqueTypeKey<'tcx>,
@@ -254,14 +252,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
254252
/// - `opaque_types` -- the map produced by `instantiate_opaque_types`
255253
/// - `free_region_relations` -- something that can be used to relate
256254
/// the free regions (`'a`) that appear in the impl trait.
257-
fn constrain_opaque_types(&self) {
258-
let opaque_types = self.inner.borrow().opaque_types.clone();
259-
for (opaque_type_key, opaque_defn) in opaque_types {
260-
self.constrain_opaque_type(opaque_type_key, &opaque_defn);
261-
}
262-
}
263-
264-
/// See `constrain_opaque_types` for documentation.
265255
#[instrument(level = "debug", skip(self))]
266256
fn constrain_opaque_type(
267257
&self,
@@ -363,7 +353,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
363353
/// purpose of this function is to do that translation.
364354
///
365355
/// (*) C1 and C2 were introduced in the comments on
366-
/// `constrain_opaque_types`. Read that comment for more context.
356+
/// `constrain_opaque_type`. Read that comment for more context.
367357
///
368358
/// # Parameters
369359
///

compiler/rustc_typeck/src/check/regionck.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ use rustc_middle::hir::place::{PlaceBase, PlaceWithHirId};
8888
use rustc_middle::ty::adjustment;
8989
use rustc_middle::ty::{self, Ty};
9090
use rustc_span::Span;
91-
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
9291
use std::ops::Deref;
9392

9493
// a variation on try that just returns unit
@@ -340,8 +339,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
340339
self.link_fn_params(body.params);
341340
self.visit_body(body);
342341
self.visit_region_obligations(body_id.hir_id);
343-
344-
self.constrain_opaque_types();
345342
}
346343

347344
fn visit_region_obligations(&mut self, hir_id: hir::HirId) {

0 commit comments

Comments
 (0)