Skip to content

Commit

Permalink
Remove dead code.
Browse files Browse the repository at this point in the history
We don't do member constraint checks in regionck anymore.
All member constraint checks are done in mir borrowck.
  • Loading branch information
oli-obk committed Oct 28, 2021
1 parent f2707fe commit f1a2f20
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
12 changes: 1 addition & 11 deletions compiler/rustc_trait_selection/src/opaque_types.rs
Expand Up @@ -23,8 +23,6 @@ pub trait InferCtxtExt<'tcx> {
value_span: Span,
) -> InferOk<'tcx, T>;

fn constrain_opaque_types(&self);

fn constrain_opaque_type(
&self,
opaque_type_key: OpaqueTypeKey<'tcx>,
Expand Down Expand Up @@ -254,14 +252,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
/// - `opaque_types` -- the map produced by `instantiate_opaque_types`
/// - `free_region_relations` -- something that can be used to relate
/// the free regions (`'a`) that appear in the impl trait.
fn constrain_opaque_types(&self) {
let opaque_types = self.inner.borrow().opaque_types.clone();
for (opaque_type_key, opaque_defn) in opaque_types {
self.constrain_opaque_type(opaque_type_key, &opaque_defn);
}
}

/// See `constrain_opaque_types` for documentation.
#[instrument(level = "debug", skip(self))]
fn constrain_opaque_type(
&self,
Expand Down Expand Up @@ -363,7 +353,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
/// purpose of this function is to do that translation.
///
/// (*) C1 and C2 were introduced in the comments on
/// `constrain_opaque_types`. Read that comment for more context.
/// `constrain_opaque_type`. Read that comment for more context.
///
/// # Parameters
///
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_typeck/src/check/regionck.rs
Expand Up @@ -88,7 +88,6 @@ use rustc_middle::hir::place::{PlaceBase, PlaceWithHirId};
use rustc_middle::ty::adjustment;
use rustc_middle::ty::{self, Ty};
use rustc_span::Span;
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
use std::ops::Deref;

// a variation on try that just returns unit
Expand Down Expand Up @@ -340,8 +339,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
self.link_fn_params(body.params);
self.visit_body(body);
self.visit_region_obligations(body_id.hir_id);

self.constrain_opaque_types();
}

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

0 comments on commit f1a2f20

Please sign in to comment.