remove unify_key::replace_if_possible
This commit is contained in:
parent
18fae7b2e5
commit
c2b5a7ea52
6 changed files with 11 additions and 43 deletions
|
@ -27,15 +27,12 @@ use super::glb::Glb;
|
|||
use super::lub::Lub;
|
||||
use super::sub::Sub;
|
||||
use super::type_variable::TypeVariableValue;
|
||||
use super::unify_key::replace_if_possible;
|
||||
use super::unify_key::{ConstVarValue, ConstVariableValue};
|
||||
use super::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
|
||||
use super::{InferCtxt, MiscVariable, TypeTrace};
|
||||
|
||||
use crate::traits::{Obligation, PredicateObligations};
|
||||
|
||||
use rustc_data_structures::sso::SsoHashMap;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::infer::unify_key::{ConstVarValue, ConstVariableValue};
|
||||
use rustc_middle::infer::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
|
||||
use rustc_middle::traits::ObligationCause;
|
||||
use rustc_middle::ty::error::{ExpectedFound, TypeError};
|
||||
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
|
||||
|
@ -140,8 +137,8 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
|
|||
return Ok(a);
|
||||
}
|
||||
|
||||
let a = replace_if_possible(&mut self.inner.borrow_mut().const_unification_table(), a);
|
||||
let b = replace_if_possible(&mut self.inner.borrow_mut().const_unification_table(), b);
|
||||
let a = self.shallow_resolve(a);
|
||||
let b = self.shallow_resolve(b);
|
||||
|
||||
let a_is_expected = relation.a_is_expected();
|
||||
|
||||
|
|
|
@ -30,17 +30,13 @@
|
|||
//! solving a set of constraints. In contrast, the type inferencer assigns a value to each type
|
||||
//! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type
|
||||
//! inferencer knows "so far".
|
||||
|
||||
use super::InferCtxt;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_middle::infer::unify_key::ToType;
|
||||
use rustc_middle::ty::fold::TypeFolder;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable};
|
||||
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
|
||||
use std::collections::hash_map::Entry;
|
||||
|
||||
use super::unify_key::ToType;
|
||||
use super::InferCtxt;
|
||||
|
||||
pub struct TypeFreshener<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
ty_freshen_count: u32,
|
||||
|
|
|
@ -70,8 +70,6 @@ mod sub;
|
|||
pub mod type_variable;
|
||||
mod undo_log;
|
||||
|
||||
pub use rustc_middle::infer::unify_key;
|
||||
|
||||
#[must_use]
|
||||
#[derive(Debug)]
|
||||
pub struct InferOk<'tcx, T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue