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:
parent
f2707fec04
commit
f1a2f2098f
2 changed files with 1 additions and 14 deletions
|
@ -23,8 +23,6 @@ pub trait InferCtxtExt<'tcx> {
|
||||||
value_span: Span,
|
value_span: Span,
|
||||||
) -> InferOk<'tcx, T>;
|
) -> InferOk<'tcx, T>;
|
||||||
|
|
||||||
fn constrain_opaque_types(&self);
|
|
||||||
|
|
||||||
fn constrain_opaque_type(
|
fn constrain_opaque_type(
|
||||||
&self,
|
&self,
|
||||||
opaque_type_key: OpaqueTypeKey<'tcx>,
|
opaque_type_key: OpaqueTypeKey<'tcx>,
|
||||||
|
@ -254,14 +252,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
/// - `opaque_types` -- the map produced by `instantiate_opaque_types`
|
/// - `opaque_types` -- the map produced by `instantiate_opaque_types`
|
||||||
/// - `free_region_relations` -- something that can be used to relate
|
/// - `free_region_relations` -- something that can be used to relate
|
||||||
/// the free regions (`'a`) that appear in the impl trait.
|
/// 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))]
|
#[instrument(level = "debug", skip(self))]
|
||||||
fn constrain_opaque_type(
|
fn constrain_opaque_type(
|
||||||
&self,
|
&self,
|
||||||
|
@ -363,7 +353,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
/// purpose of this function is to do that translation.
|
/// purpose of this function is to do that translation.
|
||||||
///
|
///
|
||||||
/// (*) C1 and C2 were introduced in the comments on
|
/// (*) 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
|
/// # Parameters
|
||||||
///
|
///
|
||||||
|
|
|
@ -88,7 +88,6 @@ use rustc_middle::hir::place::{PlaceBase, PlaceWithHirId};
|
||||||
use rustc_middle::ty::adjustment;
|
use rustc_middle::ty::adjustment;
|
||||||
use rustc_middle::ty::{self, Ty};
|
use rustc_middle::ty::{self, Ty};
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
// a variation on try that just returns unit
|
// a variation on try that just returns unit
|
||||||
|
@ -340,8 +339,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
|
||||||
self.link_fn_params(body.params);
|
self.link_fn_params(body.params);
|
||||||
self.visit_body(body);
|
self.visit_body(body);
|
||||||
self.visit_region_obligations(body_id.hir_id);
|
self.visit_region_obligations(body_id.hir_id);
|
||||||
|
|
||||||
self.constrain_opaque_types();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_region_obligations(&mut self, hir_id: hir::HirId) {
|
fn visit_region_obligations(&mut self, hir_id: hir::HirId) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue