Remove dead code.

We don't do member constraint checks in regionck anymore.
All member constraint checks are done in mir borrowck.
This commit is contained in:
Oli Scherer 2021-10-28 13:38:41 +00:00
parent f2707fec04
commit f1a2f2098f
2 changed files with 1 additions and 14 deletions

View File

@ -23,8 +23,6 @@ fn instantiate_opaque_types<T: TypeFoldable<'tcx>>(
value_span: Span,
) -> InferOk<'tcx, T>;
fn constrain_opaque_types(&self);
fn constrain_opaque_type(
&self,
opaque_type_key: OpaqueTypeKey<'tcx>,
@ -254,14 +252,6 @@ fn instantiate_opaque_types<T: TypeFoldable<'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,
@ -363,7 +353,7 @@ fn generate_member_constraint(
/// 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
///

View File

@ -88,7 +88,6 @@
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
@ -340,8 +339,6 @@ fn visit_fn_body(
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) {